use of com.adaptris.core.ServiceCollectionImp 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.ServiceCollectionImp in project interlok by adaptris.
the class ServiceCollectionCase method testCreateName.
@Test
public void testCreateName() {
ServiceCollectionImp sc = createServiceCollection();
assertEquals(sc.getClass().getName(), sc.createName());
}
use of com.adaptris.core.ServiceCollectionImp in project interlok by adaptris.
the class ServiceCollectionCase method testContinueOnFail.
@Test
public void testContinueOnFail() throws Exception {
ServiceCollectionImp sc = createServiceCollection();
assertNull(sc.getContinueOnFail());
assertEquals(false, sc.continueOnFailure());
sc.setContinueOnFail(Boolean.TRUE);
assertEquals(Boolean.TRUE, sc.getContinueOnFail());
assertEquals(true, sc.continueOnFailure());
sc.setContinueOnFail(Boolean.FALSE);
assertEquals(false, sc.continueOnFailure());
assertEquals(Boolean.FALSE, sc.getContinueOnFail());
}
use of com.adaptris.core.ServiceCollectionImp 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());
}
use of com.adaptris.core.ServiceCollectionImp in project interlok by adaptris.
the class ServiceCollectionCase method testInitWithEventHandlerAware.
@Test
public void testInitWithEventHandlerAware() throws Exception {
EventHandlerAwareService s = new EventHandlerAwareService(UUID.randomUUID().toString());
ServiceCollectionImp sc = createServiceCollection();
DefaultEventHandler eh = new DefaultEventHandler();
sc.registerEventHandler(eh);
sc.addService(new NullService(UUID.randomUUID().toString()));
sc.addService(s);
LifecycleHelper.init(sc);
assertNotNull(s.retrieveEventHandler());
assertEquals(eh, s.retrieveEventHandler());
}
Aggregations