use of com.adaptris.core.NullService in project interlok by adaptris.
the class LifecycleHelperTest method testRegisterEventHandler.
@Test
public void testRegisterEventHandler() throws Exception {
registerEventHandler(new NullService(), new DefaultEventHandler());
registerEventHandler(null, new DefaultEventHandler());
registerEventHandler(new Channel(), new DefaultEventHandler());
}
use of com.adaptris.core.NullService in project interlok by adaptris.
the class LifecycleHelperTest method testInterlokLifecycleAnnotation.
@Test
public void testInterlokLifecycleAnnotation() throws Exception {
NullService nested = new NullService();
// Turtles all the way down for a bit of recursive fun.
WrappingService service = new WrappingService(new WrappingService(new WrappingService(nested)));
try {
initAndStart(service, false);
assertSame(StartedState.getInstance(), nested.retrieveComponentState());
} finally {
stopAndClose(service, false);
}
assertSame(ClosedState.getInstance(), nested.retrieveComponentState());
}
use of com.adaptris.core.NullService in project interlok by adaptris.
the class LoggingHelperTest method testFriendlyNameService.
@Test
public void testFriendlyNameService() throws Exception {
assertEquals("", friendlyName((Service) null));
NullService service = new NullService();
assertEquals("NullService", friendlyName(service));
service.setUniqueId("");
assertEquals("NullService", friendlyName(service));
service.setUniqueId("testFriendlyNameService");
assertEquals("NullService(testFriendlyNameService)", friendlyName(service));
}
use of com.adaptris.core.NullService in project interlok by adaptris.
the class ServiceCollectionCase method testLastIndexOf.
@Test
public void testLastIndexOf() throws Exception {
ServiceCollectionImp sc = createServiceCollection();
sc.addService(new NullService(UUID.randomUUID().toString()));
WaitService s = new WaitService(UUID.randomUUID().toString());
sc.addService(new NullService(UUID.randomUUID().toString()));
sc.addService(s);
assertEquals(2, sc.lastIndexOf(s));
}
use of com.adaptris.core.NullService in project interlok by adaptris.
the class ServiceCollectionCase method testAddService.
@Test
public void testAddService() throws Exception {
ServiceCollectionImp sc = createServiceCollection();
sc.addService(new NullService(UUID.randomUUID().toString()));
assertEquals(1, sc.size());
try {
sc.addService(null);
fail();
} catch (IllegalArgumentException e) {
}
assertEquals(1, sc.size());
}
Aggregations