void setUpRecoverReliableEndpoint(Endpoint endpoint,
Conduit conduit,
SourceSequence ss,
DestinationSequence ds, RMMessage m) {
RMStore store = control.createMock(RMStore.class);
RetransmissionQueue queue = control.createMock(RetransmissionQueue.class);
manager.setStore(store);
manager.setRetransmissionQueue(queue);
Collection<SourceSequence> sss = new ArrayList<SourceSequence>();
if (null != ss) {
sss.add(ss);
}
EasyMock.expect(store.getSourceSequences("{S}s.{P}p")).andReturn(sss);
if (null == ss) {
return;
}
Collection<DestinationSequence> dss = new ArrayList<DestinationSequence>();
if (null != ds) {
dss.add(ds);
}
EasyMock.expect(store.getDestinationSequences("{S}s.{P}p")).andReturn(dss);
if (null == ds) {
return;
}
Collection<RMMessage> ms = new ArrayList<RMMessage>();
if (null != m) {
ms.add(m);
}
Identifier id = new Identifier();
id.setValue("S1");
EasyMock.expect(ss.getIdentifier()).andReturn(id).times(null == m ? 1 : 2);
EasyMock.expect(store.getMessages(id, true)).andReturn(ms);
manager.setReliableEndpointsMap(new HashMap<Endpoint, RMEndpoint>());
RMEndpoint rme = control.createMock(RMEndpoint.class);
EasyMock.expect(manager.createReliableEndpoint(endpoint)).andReturn(rme);