use of com.adaptris.core.transaction.DummyTransactionManager in project interlok by adaptris.
the class JndiHelperTest method testUnbindUnboundTransactionManager.
@Test
public void testUnbindUnboundTransactionManager() throws Exception {
TransactionManager transactionManager = new DummyTransactionManager(getName());
try {
JndiHelper.unbind(transactionManager, false);
fail();
} catch (CoreException expected) {
// not previously bound, so should error.
}
}
use of com.adaptris.core.transaction.DummyTransactionManager in project interlok by adaptris.
the class JndiHelperTest method testBindTransactionManager_AlreadyBound.
@Test
public void testBindTransactionManager_AlreadyBound() throws Exception {
TransactionManager transactionManager = new DummyTransactionManager(getName());
InitialContext initialContext = new InitialContext(env);
JndiHelper.bind(initialContext, transactionManager, false);
try {
JndiHelper.bind(initialContext, transactionManager, true);
fail();
} catch (CoreException expected) {
;
}
try {
JndiHelper.bind(initialContext, transactionManager, false);
fail();
} catch (CoreException expected) {
;
}
JndiHelper.unbindQuietly(initialContext, transactionManager, false);
}
use of com.adaptris.core.transaction.DummyTransactionManager in project interlok by adaptris.
the class JndiHelperTest method testUnbindUnboundTransactionManager_Debug.
@Test
public void testUnbindUnboundTransactionManager_Debug() throws Exception {
TransactionManager transactionManager = new DummyTransactionManager(getName());
try {
JndiHelper.unbind(transactionManager, true);
fail();
} catch (CoreException expected) {
// not previously bound, so should error.
}
}
use of com.adaptris.core.transaction.DummyTransactionManager in project interlok by adaptris.
the class SharedComponentListTest method testSharedTransactionManager_CompEnvLookupName.
@Test
public void testSharedTransactionManager_CompEnvLookupName() throws Exception {
Adapter adapter = new Adapter();
adapter.setUniqueId(getName());
adapter.getSharedComponents().setTransactionManager(new DummyTransactionManager(getName()));
try {
start(adapter);
SharedTransactionManager conn = new SharedTransactionManager("comp/env/" + getName());
conn.init();
assertNotNull(conn.proxiedTransactionManager());
} finally {
stop(adapter);
}
}
use of com.adaptris.core.transaction.DummyTransactionManager in project interlok by adaptris.
the class SharedComponentListTest method testBindJNDITransactionManager.
@Test
public void testBindJNDITransactionManager() throws Exception {
Adapter adapter = new Adapter();
adapter.setUniqueId(getName());
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, JndiContextFactory.class.getName());
InitialContext initialContext = new InitialContext(env);
try {
start(adapter);
adapter.getSharedComponents().setTransactionManager(new DummyTransactionManager(getName()));
adapter.getSharedComponents().bindJNDI(getName());
TransactionManager lookedup = (TransactionManager) initialContext.lookup("adapter:comp/env/" + getName());
assertNotNull(lookedup);
assertEquals(getName(), lookedup.getUniqueId());
adapter.getSharedComponents().bindJNDI("ShouldGetIgnored");
} finally {
stop(adapter);
}
}
Aggregations