use of com.adaptris.core.stubs.MockEncoder in project interlok by adaptris.
the class DecodingServiceTest method testSetMessageFactory.
@Test
public void testSetMessageFactory() throws Exception {
DecodingService s = new DecodingService();
assertNull(s.getMessageFactory());
s = new DecodingService(new MockEncoder());
assertNull(s.getMessageFactory());
assertTrue(s.getEncoder().currentMessageFactory() instanceof DefaultMessageFactory);
s = new DecodingService(new MockEncoder());
AdaptrisMessageFactory amf = new StubMessageFactory();
s.setMessageFactory(amf);
try {
LifecycleHelper.init(s);
assertEquals(amf, s.getMessageFactory());
assertTrue(s.getEncoder().currentMessageFactory() instanceof StubMessageFactory);
assertEquals(amf, s.getEncoder().currentMessageFactory());
} finally {
LifecycleHelper.close(s);
}
}
use of com.adaptris.core.stubs.MockEncoder in project interlok by adaptris.
the class DecodingServiceTest method testSetEncoder.
@Test
public void testSetEncoder() throws Exception {
DecodingService s = new DecodingService();
assertNull(s.getEncoder());
MockEncoder me = new MockEncoder();
s = new DecodingService(me);
assertEquals(me, s.getEncoder());
s = new DecodingService();
s.setEncoder(me);
assertEquals(me, s.getEncoder());
}
use of com.adaptris.core.stubs.MockEncoder in project interlok by adaptris.
the class DecodingServiceTest method testInit.
@Test
public void testInit() throws Exception {
DecodingService service = new DecodingService();
try {
LifecycleHelper.init(service);
fail();
} catch (CoreException expected) {
}
service.setEncoder(new MockEncoder());
LifecycleHelper.init(service);
service = new DecodingService(new MockEncoder());
LifecycleHelper.init(service);
}
use of com.adaptris.core.stubs.MockEncoder in project interlok by adaptris.
the class EncodingServiceTest method testSetMessageFactory.
@Test
public void testSetMessageFactory() throws Exception {
EncodingService s = new EncodingService();
assertNull(s.getMessageFactory());
s = new EncodingService(new MockEncoder());
assertNull(s.getMessageFactory());
assertTrue(s.getEncoder().currentMessageFactory() instanceof DefaultMessageFactory);
s = new EncodingService(new MockEncoder());
AdaptrisMessageFactory amf = new StubMessageFactory();
s.setMessageFactory(amf);
try {
LifecycleHelper.init(s);
assertEquals(amf, s.getMessageFactory());
assertTrue(s.getEncoder().currentMessageFactory() instanceof StubMessageFactory);
assertEquals(amf, s.getEncoder().currentMessageFactory());
} finally {
LifecycleHelper.close(s);
}
}
use of com.adaptris.core.stubs.MockEncoder in project interlok by adaptris.
the class EncodingServiceTest method testSetEncoder.
@Test
public void testSetEncoder() throws Exception {
EncodingService s = new EncodingService();
assertNull(s.getEncoder());
MockEncoder me = new MockEncoder();
s = new EncodingService(me);
assertEquals(me, s.getEncoder());
s = new EncodingService();
s.setEncoder(me);
assertEquals(me, s.getEncoder());
}
Aggregations