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;
}
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();
}
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));
}
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());
}
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());
}
Aggregations