use of org.apache.cxf.ws.rm.v200502.Identifier in project cxf by apache.
the class RMSoapOutInterceptorTest method setUpOutbound.
private void setUpOutbound() {
ObjectFactory factory = new ObjectFactory();
s1 = factory.createSequenceType();
Identifier sid = factory.createIdentifier();
sid.setValue("sequence1");
s1.setIdentifier(sid);
s1.setMessageNumber(ONE);
s2 = factory.createSequenceType();
sid = factory.createIdentifier();
sid.setValue("sequence2");
s2.setIdentifier(sid);
s2.setMessageNumber(TEN);
ack1 = factory.createSequenceAcknowledgement();
SequenceAcknowledgement.AcknowledgementRange r = factory.createSequenceAcknowledgementAcknowledgementRange();
r.setLower(ONE);
r.setUpper(ONE);
ack1.getAcknowledgementRange().add(r);
ack1.setIdentifier(s1.getIdentifier());
ack2 = factory.createSequenceAcknowledgement();
r = factory.createSequenceAcknowledgementAcknowledgementRange();
r.setLower(ONE);
r.setUpper(TEN);
ack2.getAcknowledgementRange().add(r);
ack2.setIdentifier(s2.getIdentifier());
ar1 = factory.createAckRequestedType();
ar1.setIdentifier(s1.getIdentifier());
ar2 = factory.createAckRequestedType();
ar2.setIdentifier(s2.getIdentifier());
}
use of org.apache.cxf.ws.rm.v200502.Identifier in project cxf by apache.
the class RetransmissionQueueImplTest method setUpSequence.
private SourceSequence setUpSequence(String sid, Long[] messageNumbers, boolean[] isAcked) {
SourceSequence sequence = createMock(SourceSequence.class);
Identifier id = createMock(Identifier.class);
sequence.getIdentifier();
EasyMock.expectLastCall().andReturn(id).anyTimes();
id.getValue();
EasyMock.expectLastCall().andReturn(sid).anyTimes();
identifiers.add(id);
Source source = createMock(Source.class);
sequence.getSource();
EasyMock.expectLastCall().andReturn(source).anyTimes();
source.getReliableEndpoint();
EasyMock.expectLastCall().andReturn(endpoint).anyTimes();
boolean includesAcked = false;
for (int i = 0; isAcked != null && i < isAcked.length; i++) {
sequence.isAcknowledged(messageNumbers[i]);
EasyMock.expectLastCall().andReturn(isAcked[i]);
if (isAcked[i]) {
includesAcked = true;
}
}
if (includesAcked) {
RMStore store = createMock(RMStore.class);
manager.getStore();
EasyMock.expectLastCall().andReturn(store);
}
return sequence;
}
use of org.apache.cxf.ws.rm.v200502.Identifier in project cxf by apache.
the class SoapFaultFactoryTest method createSoap12FaultWithAcknowledgementDetail.
@Test
public void createSoap12FaultWithAcknowledgementDetail() {
SoapBinding sb = control.createMock(SoapBinding.class);
EasyMock.expect(sb.getSoapVersion()).andReturn(Soap12.getInstance());
SequenceAcknowledgement ack = new SequenceAcknowledgement();
Identifier id = new Identifier();
id.setValue("sid");
ack.setIdentifier(id);
SequenceAcknowledgement.AcknowledgementRange range = new SequenceAcknowledgement.AcknowledgementRange();
range.setLower(new Long(1));
range.setUpper(new Long(10));
ack.getAcknowledgementRange().add(range);
setupSequenceFault(true, RM10Constants.INVALID_ACKNOWLEDGMENT_FAULT_QNAME, ack);
control.replay();
SoapFaultFactory factory = new SoapFaultFactory(sb);
SoapFault fault = (SoapFault) factory.createFault(sf, createInboundMessage());
assertEquals("reason", fault.getReason());
assertEquals(Soap12.getInstance().getSender(), fault.getFaultCode());
assertEquals(RM10Constants.INVALID_ACKNOWLEDGMENT_FAULT_QNAME, fault.getSubCode());
Element elem = fault.getDetail();
assertEquals(RM10Constants.NAMESPACE_URI, elem.getNamespaceURI());
assertEquals("SequenceAcknowledgement", elem.getLocalName());
control.verify();
}
use of org.apache.cxf.ws.rm.v200502.Identifier in project cxf by apache.
the class SoapFaultFactoryTest method createSoap12FaultWithIdentifierDetail.
@Test
public void createSoap12FaultWithIdentifierDetail() {
SoapBinding sb = control.createMock(SoapBinding.class);
EasyMock.expect(sb.getSoapVersion()).andReturn(Soap12.getInstance());
Identifier id = new Identifier();
id.setValue("sid");
setupSequenceFault(true, RM10Constants.UNKNOWN_SEQUENCE_FAULT_QNAME, id);
control.replay();
SoapFaultFactory factory = new SoapFaultFactory(sb);
SoapFault fault = (SoapFault) factory.createFault(sf, createInboundMessage());
assertEquals("reason", fault.getReason());
assertEquals(Soap12.getInstance().getSender(), fault.getFaultCode());
assertEquals(RM10Constants.UNKNOWN_SEQUENCE_FAULT_QNAME, fault.getSubCode());
Element elem = fault.getDetail();
assertEquals(RM10Constants.NAMESPACE_URI, elem.getNamespaceURI());
assertEquals("Identifier", elem.getLocalName());
control.verify();
}
use of org.apache.cxf.ws.rm.v200502.Identifier in project cxf by apache.
the class Destination method ackRequested.
void ackRequested(Message message) throws SequenceFault, RMException {
// TODO
Collection<AckRequestedType> ars = RMContextUtils.retrieveRMProperties(message, false).getAcksRequested();
if (null == ars) {
return;
}
for (AckRequestedType ar : ars) {
Identifier id = ar.getIdentifier();
DestinationSequence seq = getSequence(id);
if (null == seq) {
continue;
}
ackImmediately(seq, message);
}
}
Aggregations