Search in sources :

Example 1 with StateManagedComponent

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

the class LifecycleHelperTest method testLifecycle.

@Test
public void testLifecycle() throws Exception {
    StateManagedComponent stateManaged = new NullService();
    ComponentLifecycle noState = new ChannelList();
    try {
        initAndStart(stateManaged);
        initAndStart(noState);
        initAndStart(null);
        stopAndClose(null);
    } finally {
        stopAndClose(stateManaged);
        stopAndClose(noState);
    }
}
Also used : NullService(com.adaptris.core.NullService) ComponentLifecycle(com.adaptris.core.ComponentLifecycle) StateManagedComponent(com.adaptris.core.StateManagedComponent) ChannelList(com.adaptris.core.ChannelList) Test(org.junit.Test)

Example 2 with StateManagedComponent

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

the class LoggingHelperTest method testFriendlyNameStateManagedComponent.

@Test
public void testFriendlyNameStateManagedComponent() throws Exception {
    assertEquals("", friendlyName((StateManagedComponent) null));
    NullService service = new NullService();
    assertEquals("NullService", friendlyName((StateManagedComponent) service));
    service.setUniqueId("testFriendlyNameService");
    assertEquals("NullService(testFriendlyNameService)", friendlyName((StateManagedComponent) service));
}
Also used : NullService(com.adaptris.core.NullService) StateManagedComponent(com.adaptris.core.StateManagedComponent) Test(org.junit.Test)

Aggregations

NullService (com.adaptris.core.NullService)2 StateManagedComponent (com.adaptris.core.StateManagedComponent)2 Test (org.junit.Test)2 ChannelList (com.adaptris.core.ChannelList)1 ComponentLifecycle (com.adaptris.core.ComponentLifecycle)1