use of com.adaptris.core.CoreException in project interlok by adaptris.
the class JettyAsyncWorkflowInterceptorTest method retrieveObjectForSampleConfig.
@Override
protected Channel retrieveObjectForSampleConfig() {
try {
Channel c = new Channel("JettyHandler");
PoolingWorkflow wf1 = new PoolingWorkflow("receiveJettyRequest");
wf1.addInterceptor(new JettyAsyncWorkflowInterceptor().withMode(JettyAsyncWorkflowInterceptor.Mode.REQUEST));
PoolingWorkflow wf2 = new PoolingWorkflow("respondToJetty");
wf2.addInterceptor(new JettyAsyncWorkflowInterceptor().withMode(JettyAsyncWorkflowInterceptor.Mode.RESPONSE));
wf2.getServiceCollection().add(new JettyResponseService(200, "text/plain"));
c.getWorkflowList().add(wf1);
c.getWorkflowList().add(wf2);
return c;
} catch (CoreException e) {
throw new RuntimeException(e);
}
}
use of com.adaptris.core.CoreException in project interlok by adaptris.
the class PasswordProtectedDatabaseConnectionTest method testConnect_WithPoorlyEncryptedPassword.
@Test
public void testConnect_WithPoorlyEncryptedPassword() throws Exception {
if (Boolean.parseBoolean(PROPERTIES.getProperty(KEY_TESTS_ENABLED, "false"))) {
DatabaseConnection con = createConnection();
con.setPassword("PW:ABCDEFG");
// We expect to see a SQL Exception after probbably 1 attempt.
try {
LifecycleHelper.init(con);
Connection sqlConnection = con.connect();
fail("Successful connection with bad password");
} catch (SQLException expected) {
} catch (CoreException expected) {
}
}
}
use of com.adaptris.core.CoreException in project interlok by adaptris.
the class PasswordProtectedDatabaseConnectionTest method testConnect_WithIncorrectPassword.
@Test
public void testConnect_WithIncorrectPassword() throws Exception {
if (Boolean.parseBoolean(PROPERTIES.getProperty(KEY_TESTS_ENABLED, "false"))) {
DatabaseConnection con = createConnection();
con.setPassword(String.valueOf(System.currentTimeMillis()));
// We expect to see a SQL Exception after probbably 1 attempt.
try {
LifecycleHelper.init(con);
Connection sqlConnection = con.connect();
fail("Successful connection with bad password");
} catch (SQLException expected) {
} catch (CoreException expected) {
}
}
}
use of com.adaptris.core.CoreException in project interlok by adaptris.
the class JmsTransactedWorkflowTest method testInit_UnsupportedConsumer.
@Test
public void testInit_UnsupportedConsumer() throws Exception {
Channel channel = createStartableChannel(activeMqBroker);
JmsTransactedWorkflow workflow = (JmsTransactedWorkflow) channel.getWorkflowList().get(0);
workflow.setConsumer(new FsConsumer().withBaseDirectoryUrl("file:////path/to/directory"));
try {
channel.requestInit();
} catch (CoreException expected) {
assertEquals("JmsTransactedWorkflow must be used with a JMSConsumer", expected.getMessage());
} finally {
channel.requestClose();
}
}
use of com.adaptris.core.CoreException in project interlok by adaptris.
the class ActiveMqPasPollingConsumerTest method testInitSubscriptionOnly.
@Test
public void testInitSubscriptionOnly() throws Exception {
PasPollingConsumer consumer = create();
consumer.setSubscriptionId("xxxx");
try {
consumer.init();
fail("Should fail due to missing client Id");
} catch (CoreException e) {
// expected
}
}
Aggregations