djencks 2004/10/05 03:04:05
Modified: modules/core/src/test/org/openejb/transaction
ContainerPolicyTest.java
Log:
Use TransactionContextManager rather than TransactionContext static methods. Mostly
fix GERONIMO-355. Progress on GERONIMO-347. This demonstrates the problems in
GERONIMO-359 and GERONIMO-360 (there are now itest failures)
Revision Changes Path
1.3 +11 -6
openejb/modules/core/src/test/org/openejb/transaction/ContainerPolicyTest.java
Index: ContainerPolicyTest.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/test/org/openejb/transaction/ContainerPolicyTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ContainerPolicyTest.java 18 Jul 2004 22:32:30 -0000 1.2
+++ ContainerPolicyTest.java 5 Oct 2004 07:04:05 -0000 1.3
@@ -81,10 +81,10 @@
public void testNotSupportedInContext() throws Throwable {
MockUnspecifiedTransactionContext outer = new
MockUnspecifiedTransactionContext(interceptor);
- TransactionContext.setContext(outer);
+ transactionContextManager.setContext(outer);
ContainerPolicy.NotSupported.invoke(interceptor, invocation,
transactionContextManager);
- assertTrue(TransactionContext.getContext() == outer);
+ assertTrue(transactionContextManager.getContext() == outer);
assertTrue(interceptor.context instanceof UnspecifiedTransactionContext);
assertTrue(interceptor.context != outer);
assertTrue(outer.suspended);
@@ -112,17 +112,22 @@
protected void setUp() throws Exception {
super.setUp();
txnManager = new MockTransactionManager();
- transactionContextManager = new TransactionContextManager(txnManager);
- interceptor = new MockInterceptor();
+ transactionContextManager = new TransactionContextManager(txnManager, null,
null);
+ interceptor = new MockInterceptor(transactionContextManager);
invocation = new EJBInvocationImpl(EJBInterfaceType.LOCAL, 0, null);
}
private static class MockInterceptor implements Interceptor {
+ private final TransactionContextManager transactionContextManager;
private boolean throwException;
private TransactionContext context;
+ public MockInterceptor(TransactionContextManager transactionContextManager)
{
+ this.transactionContextManager = transactionContextManager;
+ }
+
public InvocationResult invoke(Invocation invocation) throws Throwable {
- context = TransactionContext.getContext();
+ context = transactionContextManager.getContext();
if (throwException) {
throw new MockSystemException();
} else {