use of com.adaptris.core.jdbc.DatabaseConnection in project interlok by adaptris.
the class DatabaseConnectionCase method testConnectionWhenInitialised.
@Test
public void testConnectionWhenInitialised() throws Exception {
DatabaseConnection con = configure(createConnection());
LifecycleHelper.init(con);
con.connect();
}
use of com.adaptris.core.jdbc.DatabaseConnection in project interlok by adaptris.
the class DatabaseConnectionCase method testConnectionWhenStopped.
@Test
public void testConnectionWhenStopped() throws Exception {
DatabaseConnection con = configure(createConnection());
LifecycleHelper.init(con);
LifecycleHelper.start(con);
LifecycleHelper.stop(con);
try {
con.connect();
fail("Expected failure as not initialised");
} catch (Exception e) {
// Expected
;
}
}
use of com.adaptris.core.jdbc.DatabaseConnection in project interlok by adaptris.
the class DatabaseConnectionCase method testXmlRoundTrip.
@Test
public void testXmlRoundTrip() throws Exception {
DatabaseConnection conn1 = configure(createConnection());
DatabaseConnection conn2 = roundTrip(conn1, DefaultMarshaller.getDefaultMarshaller());
assertRoundtripEquality(conn1, conn2);
}
use of com.adaptris.core.jdbc.DatabaseConnection in project interlok by adaptris.
the class DatabaseConnectionCase method testConnectWithDebugModeAndAlwaysValidate.
@Test
public void testConnectWithDebugModeAndAlwaysValidate() throws Exception {
DatabaseConnection conn = configure(createConnection());
conn.setDebugMode(true);
conn.setAlwaysValidateConnection(true);
LifecycleHelper.init(conn);
conn.connect();
}
use of com.adaptris.core.jdbc.DatabaseConnection in project interlok by adaptris.
the class JdbcServiceListTest method testServiceList_SequenceNumber_NoAutoCommit.
@Test
public void testServiceList_SequenceNumber_NoAutoCommit() throws Exception {
createDatabase();
JdbcServiceList service = createServiceCollection();
DatabaseConnection c = createJdbcConnection();
c.setAutoCommit(false);
service.setConnection(c);
AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage();
service.add(createSequenceNumberService(null, getName(), SequenceNumberCase.DEFAULT_ID));
execute(service, msg);
doStandardAssertions(msg);
assertTrue(msg.getObjectHeaders().containsKey(JdbcConstants.OBJ_METADATA_DATABASE_CONNECTION_KEY));
Connection sqlCon = (Connection) msg.getObjectHeaders().get(JdbcConstants.OBJ_METADATA_DATABASE_CONNECTION_KEY);
}
Aggregations