- Timestamp:
- 08/27/12 15:28:52 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/java-utils-test/src/test/java/de/ugoe/cs/util/console/TextConsoleTest.java
r479 r636 3 3 import java.io.ByteArrayOutputStream; 4 4 import java.io.PrintStream; 5 import java.util.logging.Level; 5 6 6 7 import org.junit.*; … … 69 70 fixture.setDebug(true); 70 71 String traceMessage = "test"; 72 Level traceLevel = Level.WARNING; 73 String expectedMessage = "[WARNING] test"; 71 74 72 fixture.traceMsg(traceMessage );75 fixture.traceMsg(traceMessage, traceLevel); 73 76 74 assertEquals( traceMessage, outContent.toString());77 assertEquals(expectedMessage, outContent.toString()); 75 78 } 76 79 … … 78 81 public void testTraceMsg_2() throws Exception { 79 82 TextConsole fixture = new TextConsole(); 80 fixture.setDebug( false);83 fixture.setDebug(true); 81 84 String traceMessage = "test"; 85 Level traceLevel = Level.INFO; 86 String expectedMessage = "[INFO] test"; 82 87 83 fixture.traceMsg(traceMessage );88 fixture.traceMsg(traceMessage, traceLevel); 84 89 85 assertEquals( "", outContent.toString());90 assertEquals(expectedMessage, outContent.toString()); 86 91 } 92 93 @Test 94 public void testTraceMsg_3() throws Exception { 95 TextConsole fixture = new TextConsole(); 96 fixture.setDebug(false); 97 String traceMessage = "[INFO] test"; 98 Level traceLevel = Level.INFO; 99 100 101 fixture.traceMsg(traceMessage, traceLevel); 102 103 assertEquals("", outContent.toString()); 104 } 87 105 88 106 @Before
Note: See TracChangeset
for help on using the changeset viewer.