Search in sources :

Example 1 with Source

use of org.apache.cxf.ws.rm.Source 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;
}
Also used : Identifier(org.apache.cxf.ws.rm.v200702.Identifier) RMStore(org.apache.cxf.ws.rm.persistence.RMStore) SourceSequence(org.apache.cxf.ws.rm.SourceSequence) Source(org.apache.cxf.ws.rm.Source) RMEndpoint(org.apache.cxf.ws.rm.RMEndpoint)

Aggregations

RMEndpoint (org.apache.cxf.ws.rm.RMEndpoint)1 Source (org.apache.cxf.ws.rm.Source)1 SourceSequence (org.apache.cxf.ws.rm.SourceSequence)1 RMStore (org.apache.cxf.ws.rm.persistence.RMStore)1 Identifier (org.apache.cxf.ws.rm.v200702.Identifier)1