1 50 51 52 53 package net.sf.just4log; 54 55 59 60 public class FollowingDoubleTest extends JustLog1Test { 61 62 65 public FollowingDoubleTest(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 " int result = a+b;\n"+ 86 " logger.debug(\"Sum(\"+a+\",\"+b+\")=\"+result);\n"+ 87 " logger.debug(\"hello!\");\n"+ 88 " return result;\n"+ 89 " }\n"+ 90 "}"); 91 setAfter("/*\n"+ 92 " * Created on 23 juin 2003\n"+ 93 " *\n"+ 94 " */\n"+ 95 "package net.sf.just4log;\n"+ 96 "\n"+ 97 "import org.apache.commons.logging.Log;\n"+ 98 "import org.apache.commons.logging.LogFactory;\n"+ 99 "\n"+ 100 "/**\n"+ 101 " * @author Lucas Bruand\n"+ 102 " */\n"+ 103 "\n"+ 104 "public class SimpleClass {\n"+ 105 " private static Log logger = LogFactory.getLog(SimpleClass.class);\n"+ 106 " public int sum(int a, int b) {\n"+ 107 " int result = a+b;\n"+ 108 " if (logger.isDebugEnabled()) {"+ 109 " logger.debug(\"Sum(\"+a+\",\"+b+\")=\"+result);\n"+ 110 " }\n"+ 111 " if (logger.isDebugEnabled()) {"+ 112 " logger.debug(\"hello!\");\n"+ 113 " }\n"+ 114 " return result;\n"+ 115 " }\n"+ 116 "}"); 117 } 118 119 } 120 | Popular Tags |