return sid;
}
private Identifier setupSourceSequence(String s) throws IOException, SQLException {
IMocksControl control = EasyMock.createNiceControl();
SourceSequence seq = control.createMock(SourceSequence.class);
Identifier sid = RMUtils.getWSRMFactory().createIdentifier();
sid.setValue(s);
Date expiry = null;
Identifier osid = null;
BigInteger cmn = BigInteger.ONE;
boolean lm = false;
if ("sequence2".equals(s)) {
expiry = new Date(System.currentTimeMillis() + 3600 * 1000);
osid = RMUtils.getWSRMFactory().createIdentifier();
osid.setValue("offeringSequence");
cmn = BigInteger.TEN;
lm = true;
}
EasyMock.expect(seq.getIdentifier()).andReturn(sid);
EasyMock.expect(seq.getExpiry()).andReturn(expiry);
EasyMock.expect(seq.getOfferingSequenceIdentifier()).andReturn(osid);
EasyMock.expect(seq.getEndpointIdentifier()).andReturn(CLIENT_ENDPOINT_ID);
EasyMock.expect(seq.getCurrentMessageNr()).andReturn(cmn);
EasyMock.expect(seq.isLastMessage()).andReturn(lm);
EasyMock.expect(seq.getIdentifier()).andReturn(sid);
control.replay();
store.createSourceSequence(seq);
store.beginTransaction();
store.updateSourceSequence(seq);