"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "dso-l2/src/test/java/com/tc/net/protocol/transport/ServerStackProviderTest.java" between
terracotta-core-5.7.0.tar.gz and terracotta-core-5.7.1.tar.gz

About: Terracotta - Clustering technology for Java ("Network Attached Memory", "Distributed Cache"). Source code of the server (5.x) core components.

ServerStackProviderTest.java  (terracotta-core-5.7.0):ServerStackProviderTest.java  (terracotta-core-5.7.1)
skipping to change at line 73 skipping to change at line 73
super.setUp(); super.setUp();
connectionPolicy = mock(ConnectionPolicy.class); connectionPolicy = mock(ConnectionPolicy.class);
} }
@Override @Override
protected void tearDown() throws Exception { protected void tearDown() throws Exception {
super.tearDown(); super.tearDown();
} }
public void testAttachAlreadyConnectedTransport() throws Exception { public void testAttachAlreadyConnectedTransport() throws Exception {
NetworkStackHarnessFactory harnessFactory = when(mock(NetworkStackHarnessFac NetworkStackHarnessFactory harnessFactory = mock(NetworkStackHarnessFactory.
tory.class).createServerHarness( class);
any(ServerMessageChannelFactory.class), any(MessageTransport.class), any when(harnessFactory
(MessageTransportListener[].class))).then( .createServerHarness(
invoke->{ any(ServerMessageChannelFactory.class), any(MessageTransport.class),
any(MessageTransportListener[].class)))
.then(
invoke -> {
Object[] args = invoke.getArguments(); Object[] args = invoke.getArguments();
return new ServerNetworkStackHarness((ServerMessageChannelFactory) args[0], (MessageTransport)args[1]); return new ServerNetworkStackHarness((ServerMessageChannelFactory) args[0], (MessageTransport)args[1]);
} }
).getMock(); );
ServerMessageChannelFactory serverMessageChannelFactory = mock(ServerMessage ChannelFactory.class); ServerMessageChannelFactory serverMessageChannelFactory = mock(ServerMessage ChannelFactory.class);
when(serverMessageChannelFactory.createNewChannel(any(ChannelID.class))).the n(invoke->{ when(serverMessageChannelFactory.createNewChannel(any(ChannelID.class))).the n(invoke->{
MessageChannelInternal channel = mock(MessageChannelInternal.class); MessageChannelInternal channel = mock(MessageChannelInternal.class);
ProductID product = ProductID.PERMANENT; ProductID product = ProductID.PERMANENT;
when(channel.getProductID()).thenReturn(product); when(channel.getProductID()).thenReturn(product);
when(channel.getChannelID()).thenReturn((ChannelID)invoke.getArguments()[0 ]); when(channel.getChannelID()).thenReturn((ChannelID)invoke.getArguments()[0 ]);
return channel; return channel;
}); });
MessageTransportFactory messageTransportFactory = mock(MessageTransportFacto ry.class); MessageTransportFactory messageTransportFactory = mock(MessageTransportFacto ry.class);
 End of changes. 2 change blocks. 
6 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)