Search in sources :

Example 6 with DummyTransactionManager

use of com.adaptris.core.transaction.DummyTransactionManager in project interlok by adaptris.

the class SharedComponentListTest method testSharedTransactionManager_StandardLookup.

@Test
public void testSharedTransactionManager_StandardLookup() throws Exception {
    Adapter adapter = new Adapter();
    adapter.setUniqueId(getName());
    adapter.getSharedComponents().setTransactionManager(new DummyTransactionManager(getName()));
    try {
        start(adapter);
        SharedTransactionManager conn = new SharedTransactionManager(getName());
        conn.init();
        assertNotNull(conn.proxiedTransactionManager());
    } finally {
        stop(adapter);
    }
}
Also used : DummyTransactionManager(com.adaptris.core.transaction.DummyTransactionManager) SharedTransactionManager(com.adaptris.core.transaction.SharedTransactionManager) Test(org.junit.Test)

Example 7 with DummyTransactionManager

use of com.adaptris.core.transaction.DummyTransactionManager in project interlok by adaptris.

the class SharedComponentListTest method retrieveObjectForSampleConfig.

@Override
protected Object retrieveObjectForSampleConfig() {
    Adapter adapter = null;
    try {
        adapter = createAdapter();
        for (ConnectionBuilder b : ConnectionBuilder.values()) {
            adapter.getSharedComponents().addConnection(b.build());
        }
        TransactionManager transactionManager = new DummyTransactionManager("myTransactionManager");
        adapter.getSharedComponents().setTransactionManager(transactionManager);
        Channel c = new Channel();
        c.setProduceConnection(new SharedConnection("goofy_edison"));
        c.setConsumeConnection(new EmbeddedConnection());
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    return adapter;
}
Also used : DummyTransactionManager(com.adaptris.core.transaction.DummyTransactionManager) SharedTransactionManager(com.adaptris.core.transaction.SharedTransactionManager) TransactionManager(com.adaptris.core.transaction.TransactionManager) DummyTransactionManager(com.adaptris.core.transaction.DummyTransactionManager) EmbeddedConnection(com.adaptris.core.http.jetty.EmbeddedConnection) NamingException(javax.naming.NamingException) PasswordException(com.adaptris.security.exc.PasswordException)

Aggregations

DummyTransactionManager (com.adaptris.core.transaction.DummyTransactionManager)7 Test (org.junit.Test)6 TransactionManager (com.adaptris.core.transaction.TransactionManager)5 SharedTransactionManager (com.adaptris.core.transaction.SharedTransactionManager)4 CoreException (com.adaptris.core.CoreException)3 InitialContext (javax.naming.InitialContext)2 EmbeddedConnection (com.adaptris.core.http.jetty.EmbeddedConnection)1 PooledConnectionProperties (com.adaptris.core.jdbc.PooledConnectionProperties)1 PasswordException (com.adaptris.security.exc.PasswordException)1 Properties (java.util.Properties)1 NamingException (javax.naming.NamingException)1