1 50 51 52 53 package net.sf.just4log; 54 55 59 60 public class WhileTest extends JustLog1Test { 61 62 65 public WhileTest(String arg0) { 66 super(arg0); 67 } 68 protected void setUp() throws Exception { 69 setBefore("/*\n"+ 70 " * Created on 23 juin 2003\n"+ 71 " *\n"+ 72 " */\n"+ 73 "package net.sf.just4log;\n"+ 74 "\n"+ 75 "import org.apache.commons.logging.Log;\n"+ 76 "import org.apache.commons.logging.LogFactory;\n"+ 77 "\n"+ 78 "/**\n"+ 79 " * @author Lucas Bruand\n"+ 80 " */\n"+ 81 "\n"+ 82 "public class SimpleClass {\n"+ 83 " private static Log logger = LogFactory.getLog(SimpleClass.class);\n"+ 84 " public int sum(int a, int b) {\n"+ 85 " while (true) {\n"+ 86 " int result = a+b;\n"+ 87 " logger.debug(\"Sum(\"+a+\",\"+b+\")=\"+result);\n"+ 88 " return result;\n"+ 89 " }\n"+ 90 " }\n"+ 91 "}"); 92 setAfter("/*\n"+ 93 " * Created on 23 juin 2003\n"+ 94 " *\n"+ 95 " */\n"+ 96 "package net.sf.just4log;\n"+ 97 "\n"+ 98 "import org.apache.commons.logging.Log;\n"+ 99 "import org.apache.commons.logging.LogFactory;\n"+ 100 "\n"+ 101 "/**\n"+ 102 " * @author Lucas Bruand\n"+ 103 " */\n"+ 104 "\n"+ 105 "public class SimpleClass {\n"+ 106 " private static Log logger = LogFactory.getLog(SimpleClass.class);\n"+ 107 " public int sum(int a, int b) {\n"+ 108 " while (true) {\n"+ 109 " int result = a+b;\n"+ 110 " if (logger.isDebugEnabled()) {"+ 111 " logger.debug(\"Sum(\"+a+\",\"+b+\")=\"+result);\n"+ 112 " }"+ 113 " return result;\n"+ 114 " }\n"+ 115 " }\n"+ 116 "}"); 117 } 118 119 } 120 | Popular Tags |