Changeset 319 for trunk/JavaHelperLibTest/src
- Timestamp:
- 12/14/11 16:39:02 (13 years ago)
- Location:
- trunk/JavaHelperLibTest/src/de/ugoe/cs/util/console
- Files:
-
- 10 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaHelperLibTest/src/de/ugoe/cs/util/console/ConsoleTest.java
r255 r319 2 2 3 3 import org.junit.*; 4 import de.ugoe.cs.util.console.listener.ITraceListener; 5 import de.ugoe.cs.util.console.listener.IOutputListener; 6 import de.ugoe.cs.util.console.listener.IExceptionListener; 7 import de.ugoe.cs.util.console.listener.IErrorListener; 8 import de.ugoe.cs.util.console.listener.ICommandListener; 4 import de.ugoe.cs.util.console.mock.MockCommandListener; 5 import de.ugoe.cs.util.console.mock.MockErrorListener; 6 import de.ugoe.cs.util.console.mock.MockExceptionListener; 7 import de.ugoe.cs.util.console.mock.MockObserver; 8 import de.ugoe.cs.util.console.mock.MockOutputListener; 9 import de.ugoe.cs.util.console.mock.MockTraceListener; 9 10 import static org.junit.Assert.*; 10 11 … … 19 20 private static final String ENDLINE = System.getProperty("line.separator"); 20 21 21 private class MockCommandListener implements ICommandListener {22 private String lastCommand = null;23 24 public String getLastCommand() {25 return lastCommand;26 }27 28 @Override29 public void commandNotification(String command) {30 lastCommand = command;31 }32 }33 34 private class MockErrorListener implements IErrorListener {35 private String lastError = null;36 public String getLastError() {37 return lastError;38 }39 @Override40 public void errorMsg(String errMessage) {41 lastError = errMessage;42 }43 }44 45 private class MockExceptionListener implements IExceptionListener {46 47 private Exception lastException = null;48 public Exception getLastException() {49 return lastException;50 }51 52 @Override53 public void logException(Exception e) {54 lastException = e;55 }56 }57 58 private class MockOutputListener implements IOutputListener {59 private String lastOutput = null;60 public String getLastOutput() {61 return lastOutput;62 }63 @Override64 public void outputMsg(String newMessage) {65 lastOutput = newMessage;66 }67 }68 69 private class MockTraceListener implements ITraceListener {70 private String lastTrace = null;71 public String getLastTrace() {72 return lastTrace;73 }74 @Override75 public void traceMsg(String traceMessage) {76 lastTrace = traceMessage;77 }78 }79 80 @SuppressWarnings("deprecation")81 private class MockObserver implements ConsoleObserver {82 83 @Override84 public void commandNotification(String command) {85 }86 @Override87 public void errorMsg(String errMessage) {88 }89 @Override90 public void logException(Exception e) {91 }92 @Override93 public void outputMsg(String newMessage) {94 }95 @Override96 public void traceMsg(String traceMessage) {97 }98 }99 100 22 @Test 101 23 public void testCommandNotification_1() -
trunk/JavaHelperLibTest/src/de/ugoe/cs/util/console/TestAll.java
r273 r319 19 19 FileOutputListenerTest.class, 20 20 TextConsoleTest.class, 21 ConsoleTest.class 21 ConsoleTest.class, 22 CommandExecuterTest.class 22 23 }) 23 24 public class TestAll {
Note: See TracChangeset
for help on using the changeset viewer.