use of org.apache.cxf.ws.rm.RMProperties in project cxf by apache.
the class SoapFaultFactoryTest method createInboundMessage.
private Message createInboundMessage() {
Message message = new MessageImpl();
RMProperties rmps = new RMProperties();
rmps.exposeAs(RM10Constants.NAMESPACE_URI);
RMContextUtils.storeRMProperties(message, rmps, false);
AddressingProperties maps = new AddressingProperties();
RMContextUtils.storeMAPs(maps, message, false, false);
return message;
}
use of org.apache.cxf.ws.rm.RMProperties in project cxf by apache.
the class RMSoapInInterceptorTest method testDecodeAcknowledgements2.
@Test
public void testDecodeAcknowledgements2() throws XMLStreamException {
SoapMessage message = setUpInboundMessage("resources/Acknowledgment2.xml");
RMSoapInInterceptor codec = new RMSoapInInterceptor();
codec.handleMessage(message);
RMProperties rmps = RMContextUtils.retrieveRMProperties(message, false);
Collection<SequenceAcknowledgement> acks = rmps.getAcks();
assertNotNull(acks);
assertEquals(1, acks.size());
SequenceAcknowledgement ack = acks.iterator().next();
assertNotNull(ack);
assertEquals(1, ack.getAcknowledgementRange().size());
AcknowledgementRange r1 = ack.getAcknowledgementRange().get(0);
verifyRange(r1, 1, 3);
assertNull(rmps.getSequence());
assertNull(rmps.getAcksRequested());
}
use of org.apache.cxf.ws.rm.RMProperties in project cxf by apache.
the class RMSoapInInterceptorTest method testDecodeAcknowledgements.
@Test
public void testDecodeAcknowledgements() throws XMLStreamException {
SoapMessage message = setUpInboundMessage("resources/Acknowledgment.xml");
RMSoapInInterceptor codec = new RMSoapInInterceptor();
codec.handleMessage(message);
RMProperties rmps = RMContextUtils.retrieveRMProperties(message, false);
Collection<SequenceAcknowledgement> acks = rmps.getAcks();
assertNotNull(acks);
assertEquals(1, acks.size());
SequenceAcknowledgement ack = acks.iterator().next();
assertNotNull(ack);
assertEquals(ack.getIdentifier().getValue(), SEQ_IDENTIFIER);
assertEquals(2, ack.getAcknowledgementRange().size());
AcknowledgementRange r1 = ack.getAcknowledgementRange().get(0);
AcknowledgementRange r2 = ack.getAcknowledgementRange().get(1);
verifyRange(r1, 1, 1);
verifyRange(r2, 3, 3);
assertNull(rmps.getSequence());
assertNull(rmps.getAcksRequested());
}
use of org.apache.cxf.ws.rm.RMProperties in project cxf by apache.
the class RMSoapInInterceptorTest method setUpInboundMessage.
private SoapMessage setUpInboundMessage(String resource) throws XMLStreamException {
Message message = new MessageImpl();
SoapMessage soapMessage = new SoapMessage(message);
RMProperties rmps = new RMProperties();
rmps.exposeAs(RM10Constants.NAMESPACE_URI);
RMContextUtils.storeRMProperties(soapMessage, rmps, false);
AddressingProperties maps = new AddressingProperties();
RMContextUtils.storeMAPs(maps, soapMessage, false, false);
message.put(Message.SCHEMA_VALIDATION_ENABLED, false);
InputStream is = RMSoapInInterceptorTest.class.getResourceAsStream(resource);
assertNotNull(is);
XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(is);
soapMessage.setContent(XMLStreamReader.class, reader);
ReadHeadersInterceptor rji = new ReadHeadersInterceptor(BusFactory.getDefaultBus());
rji.handleMessage(soapMessage);
StartBodyInterceptor sbi = new StartBodyInterceptor();
sbi.handleMessage(soapMessage);
return soapMessage;
}
use of org.apache.cxf.ws.rm.RMProperties in project cxf by apache.
the class RMSoapInInterceptorTest method testDecodeAcksRequested.
@Test
public void testDecodeAcksRequested() throws XMLStreamException {
SoapMessage message = setUpInboundMessage("resources/Retransmission.xml");
RMSoapInInterceptor codec = new RMSoapInInterceptor();
codec.handleMessage(message);
RMProperties rmps = RMContextUtils.retrieveRMProperties(message, false);
Collection<AckRequestedType> requested = rmps.getAcksRequested();
assertNotNull(requested);
assertEquals(1, requested.size());
AckRequestedType ar = requested.iterator().next();
assertNotNull(ar);
assertEquals(ar.getIdentifier().getValue(), SEQ_IDENTIFIER);
SequenceType s = rmps.getSequence();
assertNotNull(s);
assertEquals(s.getIdentifier().getValue(), SEQ_IDENTIFIER);
assertEquals(s.getMessageNumber(), MSG2_MESSAGE_NUMBER);
assertNull(rmps.getAcks());
}
Aggregations