use of com.adaptris.core.CoreException in project interlok by adaptris.
the class ActiveMqPasPollingConsumerTest method testInitNoClientIdOrSubscriptionId.
@Test
public void testInitNoClientIdOrSubscriptionId() throws Exception {
PasPollingConsumer consumer = create();
try {
consumer.init();
fail("Should fail due to missing subscription Id, client Id");
} catch (CoreException e) {
// expected
}
}
use of com.adaptris.core.CoreException in project interlok by adaptris.
the class ActiveMqPasPollingConsumerTest method testInitClientAndSubscriptionSet.
@Test
public void testInitClientAndSubscriptionSet() throws Exception {
PasPollingConsumer consumer = create();
consumer.setClientId("xxxx");
consumer.setSubscriptionId("xxxx");
try {
consumer.init();
} catch (CoreException e) {
fail(e.getMessage());
}
}
use of com.adaptris.core.CoreException in project interlok by adaptris.
the class WorkflowRetryAndFailTest method testFailedStart_ExceedsMax.
@Override
@Test
public void testFailedStart_ExceedsMax() throws Exception {
WorkflowList wfl = new WorkflowList();
WorkflowRetryAndFail strategy = new WorkflowRetryAndFail(2, new TimeInterval(10L, TimeUnit.MILLISECONDS.name()));
FailStart workflow = new FailStart(3);
wfl.add(workflow);
wfl.setLifecycleStrategy(strategy);
Channel c = createChannel(wfl);
c.requestInit();
try {
c.requestStart();
} catch (CoreException expected) {
}
// That's right 1 + 2 retries.
assertEquals(3, workflow.getAttempts());
assertEquals(InitialisedState.getInstance(), workflow.retrieveComponentState());
}
use of com.adaptris.core.CoreException in project interlok by adaptris.
the class WorkflowRetryAndFailTest method testFailedInitialise_ExceedsMax.
@Override
@Test
public void testFailedInitialise_ExceedsMax() throws Exception {
WorkflowList wfl = new WorkflowList();
WorkflowRetryAndFail strategy = new WorkflowRetryAndFail(2, new TimeInterval(10L, TimeUnit.MILLISECONDS.name()));
FailInit workflow = new FailInit(3);
wfl.add(workflow);
wfl.setLifecycleStrategy(strategy);
Channel c = createChannel(wfl);
try {
c.requestInit();
} catch (CoreException expected) {
}
// That's right 1 + 2 retries.
assertEquals(3, workflow.getAttempts());
assertEquals(ClosedState.getInstance(), workflow.retrieveComponentState());
}
use of com.adaptris.core.CoreException in project interlok by adaptris.
the class AdapterRegistryTest method testReloadFromVersionControl_NoVCS.
@Test
public void testReloadFromVersionControl_NoVCS() throws Exception {
AdapterRegistry myAdapterRegistry = (AdapterRegistry) AdapterRegistry.findInstance(new JunitBootstrapProperties(new Properties()));
try {
myAdapterRegistry.reloadFromVersionControl();
fail();
} catch (CoreException expected) {
assertEquals("No Runtime Version Control", expected.getMessage());
}
}
Aggregations