Search in sources :

Example 6 with WorkflowImp

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

the class ExampleWorkflowCase method testSetServiceCollection.

@Test
public void testSetServiceCollection() throws Exception {
    WorkflowImp wf = createWorkflowForGenericTests();
    ServiceCollection obj = wf.getServiceCollection();
    try {
        wf.setServiceCollection(null);
        fail();
    } catch (IllegalArgumentException e) {
    }
    assertEquals(obj, wf.getServiceCollection());
}
Also used : ServiceCollection(com.adaptris.core.ServiceCollection) WorkflowImp(com.adaptris.core.WorkflowImp) Test(org.junit.Test)

Example 7 with WorkflowImp

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

the class ExampleWorkflowCase method testSetConsumer.

@Test
public void testSetConsumer() throws Exception {
    WorkflowImp wf = createWorkflowForGenericTests();
    AdaptrisMessageConsumer obj = wf.getConsumer();
    try {
        wf.setConsumer(null);
        fail();
    } catch (IllegalArgumentException e) {
    }
    assertEquals(obj, wf.getConsumer());
}
Also used : AdaptrisMessageConsumer(com.adaptris.core.AdaptrisMessageConsumer) WorkflowImp(com.adaptris.core.WorkflowImp) Test(org.junit.Test)

Example 8 with WorkflowImp

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

the class ExampleWorkflowCase method testSetMessageLogger.

@Test
public void testSetMessageLogger() throws Exception {
    AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage();
    WorkflowImp wf = createWorkflowForGenericTests();
    assertNull(wf.getMessageLogger());
    assertNotNull(wf.messageLogger());
    assertEquals(DefaultMessageLogger.class, wf.messageLogger().getClass());
    assertNotNull(wf.messageLogger().toString(msg));
    wf.setMessageLogger(new PayloadMessageLogger());
    assertNotNull(wf.getMessageLogger());
    assertNotNull(wf.messageLogger());
    assertEquals(PayloadMessageLogger.class, wf.messageLogger().getClass());
    assertNotNull(wf.messageLogger().toString(msg));
}
Also used : AdaptrisMessage(com.adaptris.core.AdaptrisMessage) PayloadMessageLogger(com.adaptris.core.util.PayloadMessageLogger) WorkflowImp(com.adaptris.core.WorkflowImp) Test(org.junit.Test)

Example 9 with WorkflowImp

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

the class ExampleWorkflowCase method testSetChannelUnavailableWait.

@Test
public void testSetChannelUnavailableWait() throws Exception {
    WorkflowImp wf = createWorkflowForGenericTests();
    TimeInterval defaultInterval = new TimeInterval(30L, TimeUnit.SECONDS);
    TimeInterval interval = new TimeInterval(10L, TimeUnit.SECONDS);
    assertNull(wf.getChannelUnavailableWaitInterval());
    assertEquals(defaultInterval.toMilliseconds(), wf.channelUnavailableWait());
    wf.setChannelUnavailableWaitInterval(interval);
    assertEquals(interval, wf.getChannelUnavailableWaitInterval());
    assertNotSame(defaultInterval.toMilliseconds(), wf.channelUnavailableWait());
    assertEquals(interval.toMilliseconds(), wf.channelUnavailableWait());
    wf.setChannelUnavailableWaitInterval(null);
    assertNull(wf.getChannelUnavailableWaitInterval());
    assertEquals(defaultInterval.toMilliseconds(), wf.channelUnavailableWait());
}
Also used : TimeInterval(com.adaptris.util.TimeInterval) WorkflowImp(com.adaptris.core.WorkflowImp) Test(org.junit.Test)

Example 10 with WorkflowImp

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

the class ExampleWorkflowCase method testSetProducer.

@Test
public void testSetProducer() throws Exception {
    WorkflowImp wf = createWorkflowForGenericTests();
    AdaptrisMessageProducer obj = wf.getProducer();
    try {
        wf.setProducer(null);
        fail();
    } catch (IllegalArgumentException e) {
    }
    assertEquals(obj, wf.getProducer());
}
Also used : AdaptrisMessageProducer(com.adaptris.core.AdaptrisMessageProducer) WorkflowImp(com.adaptris.core.WorkflowImp) Test(org.junit.Test)

Aggregations

WorkflowImp (com.adaptris.core.WorkflowImp)10 Test (org.junit.Test)9 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)1 AdaptrisMessageConsumer (com.adaptris.core.AdaptrisMessageConsumer)1 AdaptrisMessageProducer (com.adaptris.core.AdaptrisMessageProducer)1 Channel (com.adaptris.core.Channel)1 DefaultEventHandler (com.adaptris.core.DefaultEventHandler)1 NullProcessingExceptionHandler (com.adaptris.core.NullProcessingExceptionHandler)1 NullProduceExceptionHandler (com.adaptris.core.NullProduceExceptionHandler)1 ProduceExceptionHandler (com.adaptris.core.ProduceExceptionHandler)1 ServiceCollection (com.adaptris.core.ServiceCollection)1 WorkflowInterceptor (com.adaptris.core.WorkflowInterceptor)1 MockChannel (com.adaptris.core.stubs.MockChannel)1 MockWorkflowInterceptor (com.adaptris.core.stubs.MockWorkflowInterceptor)1 PayloadMessageLogger (com.adaptris.core.util.PayloadMessageLogger)1 TimeInterval (com.adaptris.util.TimeInterval)1 ArrayList (java.util.ArrayList)1