Search in sources :

Example 6 with Identifier

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.Identifier in project cxf by apache.

the class DestinationTest method testAcknowledgeAlreadyAcknowledgedMessage.

@Test
public void testAcknowledgeAlreadyAcknowledgedMessage() throws SequenceFault, RMException, NoSuchMethodException, IOException {
    Method m1 = Destination.class.getDeclaredMethod("getSequence", new Class[] { Identifier.class });
    destination = EasyMock.createMockBuilder(Destination.class).addMockedMethod(m1).createMock(control);
    Message message = setupMessage();
    RMProperties rmps = control.createMock(RMProperties.class);
    EasyMock.expect(message.get(RMMessageConstants.RM_PROPERTIES_INBOUND)).andReturn(rmps);
    SequenceType st = control.createMock(SequenceType.class);
    EasyMock.expect(rmps.getSequence()).andReturn(st);
    Identifier id = control.createMock(Identifier.class);
    EasyMock.expect(st.getIdentifier()).andReturn(id);
    DestinationSequence ds = control.createMock(DestinationSequence.class);
    EasyMock.expect(destination.getSequence(id)).andReturn(ds);
    long nr = 10;
    EasyMock.expect(st.getMessageNumber()).andReturn(nr);
    ds.applyDeliveryAssurance(nr, message);
    EasyMock.expectLastCall().andReturn(false);
    InterceptorChain ic = control.createMock(InterceptorChain.class);
    EasyMock.expect(message.getInterceptorChain()).andReturn(ic);
    control.replay();
    destination.acknowledge(message);
}
Also used : InterceptorChain(org.apache.cxf.interceptor.InterceptorChain) Identifier(org.apache.cxf.ws.rm.v200702.Identifier) Message(org.apache.cxf.message.Message) Method(java.lang.reflect.Method) SequenceType(org.apache.cxf.ws.rm.v200702.SequenceType) Test(org.junit.Test)

Example 7 with Identifier

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.Identifier in project cxf by apache.

the class DestinationTest method testAcknowledgeUnknownSequence.

@Test
public void testAcknowledgeUnknownSequence() throws RMException, IOException {
    Message message = setupMessage();
    RMProperties rmps = control.createMock(RMProperties.class);
    EasyMock.expect(message.get(RMMessageConstants.RM_PROPERTIES_INBOUND)).andReturn(rmps);
    EasyMock.expect(RMContextUtils.getProtocolVariation(message)).andReturn(ProtocolVariation.RM10WSA200408);
    SequenceType st = control.createMock(SequenceType.class);
    EasyMock.expect(rmps.getSequence()).andReturn(st);
    Identifier id = control.createMock(Identifier.class);
    EasyMock.expect(st.getIdentifier()).andReturn(id).times(2);
    String sid = "sid";
    EasyMock.expect(id.getValue()).andReturn(sid);
    control.replay();
    try {
        destination.acknowledge(message);
        fail("Expected SequenceFault not thrown.");
    } catch (SequenceFault ex) {
        assertEquals(RM10Constants.UNKNOWN_SEQUENCE_FAULT_QNAME, ex.getFaultCode());
    }
}
Also used : Identifier(org.apache.cxf.ws.rm.v200702.Identifier) Message(org.apache.cxf.message.Message) SequenceType(org.apache.cxf.ws.rm.v200702.SequenceType) Test(org.junit.Test)

Example 8 with Identifier

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.Identifier in project cxf by apache.

the class DestinationTest method testGetSequence.

@Test
public void testGetSequence() {
    Identifier id = control.createMock(Identifier.class);
    String sid = "s1";
    EasyMock.expect(id.getValue()).andReturn(sid);
    control.replay();
    assertNull(destination.getSequence(id));
}
Also used : Identifier(org.apache.cxf.ws.rm.v200702.Identifier) Test(org.junit.Test)

Example 9 with Identifier

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.Identifier in project cxf by apache.

the class ManagedRMManagerTest method createTestSourceSequence.

private SourceSequence createTestSourceSequence(Source source, String sid, EndpointReferenceType to, ProtocolVariation protocol, long[] acked) {
    Identifier identifier = RMUtils.getWSRMFactory().createIdentifier();
    identifier.setValue(sid);
    SourceSequence ss = new SourceSequence(identifier, protocol);
    ss.setSource(source);
    ss.setTarget(to);
    List<SequenceAcknowledgement.AcknowledgementRange> ranges = ss.getAcknowledgement().getAcknowledgementRange();
    for (int i = 0; i < acked.length; i += 2) {
        ranges.add(createAcknowledgementRange(acked[i], acked[i + 1]));
    }
    return ss;
}
Also used : Identifier(org.apache.cxf.ws.rm.v200702.Identifier) Endpoint(org.apache.cxf.endpoint.Endpoint)

Example 10 with Identifier

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.Identifier in project cxf by apache.

the class RMEndpointTest method testShutdown.

@Test
public void testShutdown() {
    DestinationSequence ds = control.createMock(DestinationSequence.class);
    Identifier did = control.createMock(Identifier.class);
    EasyMock.expect(ds.getIdentifier()).andReturn(did).anyTimes();
    EasyMock.expect(ds.getProtocol()).andReturn(ProtocolVariation.RM10WSA200408).anyTimes();
    String d = "d";
    EasyMock.expect(did.getValue()).andReturn(d).anyTimes();
    SourceSequence ss = control.createMock(SourceSequence.class);
    Identifier sid = control.createMock(Identifier.class);
    EasyMock.expect(ss.getIdentifier()).andReturn(sid).anyTimes();
    EasyMock.expect(ss.getProtocol()).andReturn(ProtocolVariation.RM10WSA200408).anyTimes();
    String s = "s";
    EasyMock.expect(sid.getValue()).andReturn(s).anyTimes();
    ds.cancelDeferredAcknowledgments();
    EasyMock.expectLastCall().anyTimes();
    ds.cancelTermination();
    EasyMock.expectLastCall().anyTimes();
    RetransmissionQueue queue = control.createMock(RetransmissionQueue.class);
    EasyMock.expect(manager.getRetransmissionQueue()).andReturn(queue).anyTimes();
    queue.stop(ss);
    EasyMock.expectLastCall().anyTimes();
    RedeliveryQueue dqueue = control.createMock(RedeliveryQueue.class);
    EasyMock.expect(manager.getRedeliveryQueue()).andReturn(dqueue).anyTimes();
    dqueue.stop(ds);
    EasyMock.expectLastCall().anyTimes();
    control.replay();
    rme.getDestination().addSequence(ds, false);
    rme.getSource().addSequence(ss, false);
    rme.shutdown();
}
Also used : Identifier(org.apache.cxf.ws.rm.v200702.Identifier) Test(org.junit.Test)

Aggregations

Identifier (org.apache.cxf.ws.rm.v200702.Identifier)72 ArrayList (java.util.ArrayList)57 BigInteger (java.math.BigInteger)55 Test (org.junit.Test)52 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)35 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)30 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)29 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)25 NodeRef (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef)23 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)19 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)19 ElanInstance (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance)16 Uri (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri)14 List (java.util.List)13 VpnInterface (org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.interfaces.VpnInterface)13 VpnInterfaceOpDataEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn._interface.op.data.VpnInterfaceOpDataEntry)13 NodeId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)12 L2GatewayDevice (org.opendaylight.netvirt.neutronvpn.api.l2gw.L2GatewayDevice)11 Adjacency (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.adjacency.list.Adjacency)10 Port (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port)10