}
}
private Identifier setupDestinationSequence(String s) throws IOException, SQLException {
IMocksControl control = EasyMock.createNiceControl();
DestinationSequence seq = control.createMock(DestinationSequence.class);
Identifier sid = RMUtils.getWSRMFactory().createIdentifier();
sid.setValue(s);
EndpointReferenceType epr = RMUtils.createReference(Names.WSA_ANONYMOUS_ADDRESS);
SequenceAcknowledgement ack = RMUtils.getWSRMFactory().createSequenceAcknowledgement();
AcknowledgementRange range =
RMUtils.getWSRMFactory().createSequenceAcknowledgementAcknowledgementRange();
range.setLower(BigInteger.ONE);
range.setUpper(BigInteger.ONE);
ack.getAcknowledgementRange().add(range);
BigInteger lmn = null;
if ("sequence2".equals(s)) {
range =
RMUtils.getWSRMFactory().createSequenceAcknowledgementAcknowledgementRange();
range.setLower(new BigInteger("3"));
range.setUpper(BigInteger.TEN);
ack.getAcknowledgementRange().add(range);
lmn = BigInteger.TEN;
}
EasyMock.expect(seq.getIdentifier()).andReturn(sid);
EasyMock.expect(seq.getAcksTo()).andReturn(epr);
EasyMock.expect(seq.getEndpointIdentifier()).andReturn(SERVER_ENDPOINT_ID);
EasyMock.expect(seq.getLastMessageNr()).andReturn(lmn);
InputStream is = RMUtils.getPersistenceUtils().getAcknowledgementAsInputStream(ack);
EasyMock.expect(seq.getAcknowledgmentAsStream()).andReturn(is);
EasyMock.expect(seq.getIdentifier()).andReturn(sid);
control.replay();
store.createDestinationSequence(seq);
store.beginTransaction();
store.updateDestinationSequence(seq);