Search in sources :

Example 46 with Identifier

use of org.geotoolkit.sml.xml.v100.Identifier in project cxf by apache.

the class ManagedRMManagerTest method createTestDestinationSequence.

private DestinationSequence createTestDestinationSequence(Destination destination, String sid, EndpointReferenceType to, ProtocolVariation protocol, long[] acked) {
    Identifier identifier = RMUtils.getWSRMFactory().createIdentifier();
    identifier.setValue(sid);
    DestinationSequence ds = new DestinationSequence(identifier, to, null, protocol);
    ds.setDestination(destination);
    List<SequenceAcknowledgement.AcknowledgementRange> ranges = ds.getAcknowledgment().getAcknowledgementRange();
    for (int i = 0; i < acked.length; i += 2) {
        ranges.add(createAcknowledgementRange(acked[i], acked[i + 1]));
    }
    return ds;
}
Also used : Identifier(org.apache.cxf.ws.rm.v200702.Identifier) Endpoint(org.apache.cxf.endpoint.Endpoint)

Example 47 with Identifier

use of org.geotoolkit.sml.xml.v100.Identifier in project cxf by apache.

the class AbstractEndpointTest method testGenerateSequenceIdentifier.

@Test
public void testGenerateSequenceIdentifier() {
    RMManager mgr = control.createMock(RMManager.class);
    EasyMock.expect(rme.getManager()).andReturn(mgr);
    SequenceIdentifierGenerator generator = control.createMock(SequenceIdentifierGenerator.class);
    EasyMock.expect(mgr.getIdGenerator()).andReturn(generator);
    Identifier id = control.createMock(Identifier.class);
    EasyMock.expect(generator.generateSequenceIdentifier()).andReturn(id);
    control.replay();
    AbstractEndpoint tested = new AbstractEndpoint(rme);
    assertSame(id, tested.generateSequenceIdentifier());
    control.verify();
}
Also used : Identifier(org.apache.cxf.ws.rm.v200702.Identifier) Test(org.junit.Test)

Example 48 with Identifier

use of org.geotoolkit.sml.xml.v100.Identifier in project cxf by apache.

the class AbstractSequenceTest method testIdentifierEquals.

@Test
public void testIdentifierEquals() {
    Identifier id1 = null;
    Identifier id2 = null;
    assertTrue(AbstractSequence.identifierEquals(id1, id2));
    ObjectFactory factory = new ObjectFactory();
    id1 = factory.createIdentifier();
    id1.setValue("seq1");
    assertFalse(AbstractSequence.identifierEquals(id1, id2));
    id2 = factory.createIdentifier();
    id2.setValue("seq2");
    assertFalse(AbstractSequence.identifierEquals(id1, id2));
    id2.setValue("seq1");
    assertTrue(AbstractSequence.identifierEquals(id1, id2));
}
Also used : Identifier(org.apache.cxf.ws.rm.v200702.Identifier) ObjectFactory(org.apache.cxf.ws.rm.v200702.ObjectFactory) Test(org.junit.Test)

Example 49 with Identifier

use of org.geotoolkit.sml.xml.v100.Identifier in project cxf by apache.

the class DestinationTest method testAddRemoveSequence.

@Test
public void testAddRemoveSequence() {
    DestinationSequence ds = control.createMock(DestinationSequence.class);
    ds.setDestination(destination);
    EasyMock.expectLastCall();
    Identifier id = control.createMock(Identifier.class);
    EasyMock.expect(ds.getIdentifier()).andReturn(id).times(3);
    String sid = "s1";
    EasyMock.expect(id.getValue()).andReturn(sid).times(3);
    RMManager manager = control.createMock(RMManager.class);
    EasyMock.expect(rme.getManager()).andReturn(manager).times(2);
    RMStore store = control.createMock(RMStore.class);
    EasyMock.expect(manager.getStore()).andReturn(store).times(2);
    store.createDestinationSequence(ds);
    EasyMock.expectLastCall();
    store.removeDestinationSequence(id);
    EasyMock.expectLastCall();
    control.replay();
    destination.addSequence(ds);
    assertEquals(1, destination.getAllSequences().size());
    assertSame(ds, destination.getSequence(id));
    destination.removeSequence(ds);
    assertEquals(0, destination.getAllSequences().size());
}
Also used : Identifier(org.apache.cxf.ws.rm.v200702.Identifier) RMStore(org.apache.cxf.ws.rm.persistence.RMStore) Test(org.junit.Test)

Example 50 with Identifier

use of org.geotoolkit.sml.xml.v100.Identifier in project cxf by apache.

the class ProxyTest method testOfferedIdentifier.

@Test
public void testOfferedIdentifier() {
    OfferType offer = control.createMock(OfferType.class);
    Identifier id = control.createMock(Identifier.class);
    EasyMock.expect(offer.getIdentifier()).andReturn(id).anyTimes();
    control.replay();
    Proxy proxy = new Proxy(rme);
    assertNull(proxy.getOfferedIdentifier());
    proxy.setOfferedIdentifier(offer);
    assertSame(id, proxy.getOfferedIdentifier());
}
Also used : Identifier(org.apache.cxf.ws.rm.v200702.Identifier) OfferType(org.apache.cxf.ws.rm.v200702.OfferType) Test(org.junit.Test)

Aggregations

Identifier (org.apache.cxf.ws.rm.v200702.Identifier)72 Test (org.junit.Test)43 ArrayList (java.util.ArrayList)13 Message (org.apache.cxf.message.Message)11 SourceSequence (org.apache.cxf.ws.rm.SourceSequence)11 RMMessage (org.apache.cxf.ws.rm.persistence.RMMessage)11 SequenceAcknowledgement (org.apache.cxf.ws.rm.v200702.SequenceAcknowledgement)11 Connection (java.sql.Connection)9 AddressingProperties (org.apache.cxf.ws.addressing.AddressingProperties)8 SQLException (java.sql.SQLException)7 Date (java.util.Date)7 EndpointReferenceType (org.apache.cxf.ws.addressing.EndpointReferenceType)7 DestinationSequence (org.apache.cxf.ws.rm.DestinationSequence)7 InputStream (java.io.InputStream)6 Method (java.lang.reflect.Method)6 AttributedURIType (org.apache.cxf.ws.addressing.AttributedURIType)6 RMStore (org.apache.cxf.ws.rm.persistence.RMStore)6 SequenceType (org.apache.cxf.ws.rm.v200702.SequenceType)6 JAXBElement (javax.xml.bind.JAXBElement)5 SoapBinding (org.apache.cxf.binding.soap.SoapBinding)5