InputStream is = getClass().getResourceAsStream("resources/CreateSequenceResponseOfferAccepted.xml");
TestInputStreamContext istreamCtx = new TestInputStreamContext();
istreamCtx.setInputStream(is);
ct.setInputStreamMessageContext(istreamCtx);
IMocksControl control = EasyMock.createNiceControl();
RMHandler handler = control.createMock(RMHandler.class);
RMProxy proxy = new RMProxy(handler);
RMSource source = control.createMock(RMSource.class);
SourcePolicyType sp = control.createMock(SourcePolicyType.class);
Identifier sid = RMUtils.getWSRMFactory().createIdentifier();
sid.setValue("s1");
Duration osd = DatatypeFactory.newInstance().newDuration("PT24H");
assertNotNull(osd);
Identifier offeredSid = RMUtils.getWSRMFactory().createIdentifier();
offeredSid.setValue("s1Offer");
expect(handler.getBinding()).andReturn(binding);
expect(handler.getTransport()).andReturn(ct);
expect(source.getSourcePolicies()).andReturn(sp);
expect(sp.getAcksTo()).andReturn(null);
expect(sp.getSequenceExpiration()).andReturn(null);
expect(sp.isIncludeOffer()).andReturn(true);
expect(sp.getOfferedSequenceExpiration()).andReturn(null);
expect(source.generateSequenceIdentifier()).andReturn(offeredSid);
expect(handler.getBinding()).andReturn(binding).times(2);
// Moved to CreateSequenceResponse handling on RMServant
//source.addSequence(EasyMock.isA(SourceSequence.class));
//expectLastCall();
//source.setCurrent((Identifier)EasyMock.isNull(), EasyMock.isA(SourceSequence.class));
//expectLastCall();
// Moved to CreateSequenceResponse handling on RMServant
//expect(source.getHandler()).andReturn(handler);
//expect(handler.getDestination()).andReturn(dest);
//dest.addSequence(isA(DestinationSequence.class));
control.replay();
proxy.createSequence(source,
getTo(),
RMUtils.createReference(Names.WSA_ANONYMOUS_ADDRESS),
ContextUtils.WSA_OBJECT_FACTORY.createRelatesToType());
control.verify();
assertTrue("expected send", binding.isSent());
}