use of org.orcid.jaxb.model.record.summary_rc1.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.orcid.jaxb.model.record.summary_rc1.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.orcid.jaxb.model.record.summary_rc1.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.orcid.jaxb.model.record.summary_rc1.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(Long.valueOf(1));
range.setUpper(Long.valueOf(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.orcid.jaxb.model.record.summary_rc1.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();
}
Aggregations