Changeset 18 for simplerunner/src/test/java
- Timestamp:
- 06/11/20 16:34:40 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
simplerunner/src/test/java/geniusweb/simplerunner/SessionRunnerTest.java
r9 r18 17 17 18 18 import geniusweb.protocol.CurrentNegoState; 19 import geniusweb.protocol.NegoState; 19 20 import geniusweb.protocol.ProtocolException; 20 21 import geniusweb.protocol.partyconnection.ProtocolToPartyConnFactory; … … 22 23 import geniusweb.protocol.session.SessionSettings; 23 24 import geniusweb.protocol.session.SessionState; 24 import geniusweb.simplerunner.NegoRunner;25 25 import tudelft.utilities.listener.Listener; 26 26 import tudelft.utilities.logging.ReportToLogger; … … 59 59 ProtocolToPartyConnFactory.class); 60 60 61 NegoRunner runner = spy( 62 new NegoRunner(settings, factory, logger)); 61 NegoRunner runner = spy(new NegoRunner(settings, factory, logger)); 63 62 runner.run(); 64 63 … … 82 81 ProtocolToPartyConnFactory factory = mock( 83 82 ProtocolToPartyConnFactory.class); 84 NegoRunner runner = spy( 85 new NegoRunner(settings, factory, logger)); 83 NegoRunner runner = spy(new NegoRunner(settings, factory, logger) { 84 @Override 85 protected void logFinal(Level level, NegoState state) { 86 log.log(level, state.toString()); 87 } 88 }); 86 89 ArgumentCaptor<Listener> listener = ArgumentCaptor 87 90 .forClass(Listener.class); … … 109 112 ProtocolToPartyConnFactory factory = mock( 110 113 ProtocolToPartyConnFactory.class); 111 NegoRunner runner = spy( 112 new NegoRunner(settings, factory, logger)); 114 NegoRunner runner = spy(new NegoRunner(settings, factory, logger) { 115 @Override 116 protected void logFinal(Level level, NegoState state) { 117 log.log(level, state.toString()); 118 } 119 }); 113 120 ArgumentCaptor<Listener> listener = ArgumentCaptor 114 121 .forClass(Listener.class); … … 120 127 verify(runner, times(1)).stop(); 121 128 // check that the protocol error is logged properly 122 verify(logger, times(1)).log(eq(Level.WARNING), any(String.class), 123 eq(PROTOCOL_EXC)); 129 verify(logger, times(1)).log(eq(Level.WARNING), any(String.class)); 124 130 } 125 131
Note:
See TracChangeset
for help on using the changeset viewer.