Search in sources :

Example 51 with NullService

use of com.adaptris.core.NullService in project interlok by adaptris.

the class ServiceCollectionCase method testSetAtPosition.

@Test
public void testSetAtPosition() throws Exception {
    ServiceCollectionImp sc = createServiceCollection();
    sc.addService(new NullService(UUID.randomUUID().toString()));
    WaitService wait = new WaitService(UUID.randomUUID().toString());
    sc.addService(wait);
    sc.addService(new NullService(UUID.randomUUID().toString()));
    Service s = sc.set(1, new NullService(UUID.randomUUID().toString()));
    assertEquals(WaitService.class, s.getClass());
    assertEquals(wait, s);
    assertEquals(3, sc.size());
    assertFalse(sc.contains(wait));
}
Also used : WaitService(com.adaptris.core.services.WaitService) ServiceCollectionImp(com.adaptris.core.ServiceCollectionImp) NullService(com.adaptris.core.NullService) NullService(com.adaptris.core.NullService) Service(com.adaptris.core.Service) EventHandlerAwareService(com.adaptris.core.stubs.EventHandlerAwareService) WaitService(com.adaptris.core.services.WaitService) Test(org.junit.Test)

Example 52 with NullService

use of com.adaptris.core.NullService in project interlok by adaptris.

the class ServiceCollectionCase method testClear.

@Test
public void testClear() {
    ServiceCollectionImp list = createServiceCollection();
    list.add(new NullService(UUID.randomUUID().toString()));
    list.add(new NullService(UUID.randomUUID().toString()));
    list.add(new NullService(UUID.randomUUID().toString()));
    list.add(new NullService(UUID.randomUUID().toString()));
    assertEquals(4, list.size());
    list.clear();
    assertEquals(0, list.size());
}
Also used : ServiceCollectionImp(com.adaptris.core.ServiceCollectionImp) NullService(com.adaptris.core.NullService) Test(org.junit.Test)

Example 53 with NullService

use of com.adaptris.core.NullService in project interlok by adaptris.

the class ServiceCollectionCase method testSetServices.

@Test
public void testSetServices() throws Exception {
    ServiceCollectionImp sc = createServiceCollection();
    List<Service> services = Arrays.asList(new Service[] { new NullService(UUID.randomUUID().toString()), new NullService(UUID.randomUUID().toString()) });
    sc.setServices(services);
    assertEquals(2, sc.size());
    assertEquals(services, sc.getServices());
    try {
        sc.setServices(null);
        fail();
    } catch (IllegalArgumentException e) {
    }
    assertEquals(2, sc.size());
    assertEquals(services, sc.getServices());
}
Also used : ServiceCollectionImp(com.adaptris.core.ServiceCollectionImp) NullService(com.adaptris.core.NullService) NullService(com.adaptris.core.NullService) Service(com.adaptris.core.Service) EventHandlerAwareService(com.adaptris.core.stubs.EventHandlerAwareService) WaitService(com.adaptris.core.services.WaitService) Test(org.junit.Test)

Example 54 with NullService

use of com.adaptris.core.NullService in project interlok by adaptris.

the class ServiceCollectionCase method testSubList.

@Test
public void testSubList() {
    ServiceCollectionImp list = createServiceCollection();
    list.add(new NullService(UUID.randomUUID().toString()));
    list.add(new NullService(UUID.randomUUID().toString()));
    list.add(new NullService(UUID.randomUUID().toString()));
    list.add(new NullService(UUID.randomUUID().toString()));
    assertNotNull(list.subList(0, 2));
    assertEquals(2, list.subList(0, 2).size());
}
Also used : ServiceCollectionImp(com.adaptris.core.ServiceCollectionImp) NullService(com.adaptris.core.NullService) Test(org.junit.Test)

Aggregations

NullService (com.adaptris.core.NullService)54 Test (org.junit.Test)53 ServiceCollectionImp (com.adaptris.core.ServiceCollectionImp)16 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)15 WaitService (com.adaptris.core.services.WaitService)9 PooledSplitJoinService (com.adaptris.core.services.splitter.PooledSplitJoinService)9 TimeInterval (com.adaptris.util.TimeInterval)9 Service (com.adaptris.core.Service)5 XpathMessageSplitter (com.adaptris.core.services.splitter.XpathMessageSplitter)5 EventHandlerAwareService (com.adaptris.core.stubs.EventHandlerAwareService)5 InsertNode (com.adaptris.util.text.xml.InsertNode)5 XPath (com.adaptris.util.text.xml.XPath)5 Adapter (com.adaptris.core.Adapter)4 AdaptrisMarshaller (com.adaptris.core.AdaptrisMarshaller)4 ServiceException (com.adaptris.core.ServiceException)4 BootstrapProperties (com.adaptris.core.management.BootstrapProperties)4 BodyPartIterator (com.adaptris.util.text.mime.BodyPartIterator)4 ObjectName (javax.management.ObjectName)4 SharedService (com.adaptris.core.SharedService)3 ComponentLifecycle (com.adaptris.core.ComponentLifecycle)2