dain 2005/01/26 18:28:02
Modified: modules/openejb-builder/src/test/org/openejb/deployment/mdb
BasicMDBContainerTest.java
Log:
ENC is now passed around as a Map instead of a jndi Context. This allows the
ejb container to modify it and inject the kernel and class loader into
references.
Changed Stateless and MDB containers to use system chain for ejbCreate and
ejbRemove invocations.
Added test to verify that ejbRemove is propertly called from the cache code.
Revision Changes Path
1.5 +8 -8
openejb/modules/openejb-builder/src/test/org/openejb/deployment/mdb/BasicMDBContainerTest.java
Index: BasicMDBContainerTest.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/openejb-builder/src/test/org/openejb/deployment/mdb/BasicMDBContainerTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- BasicMDBContainerTest.java 22 Jan 2005 00:39:16 -0000 1.4
+++ BasicMDBContainerTest.java 26 Jan 2005 23:28:02 -0000 1.5
@@ -45,11 +45,11 @@
package org.openejb.deployment.mdb;
import java.util.HashSet;
+import java.util.HashMap;
import junit.framework.TestCase;
import org.apache.geronimo.gbean.GBeanData;
import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.naming.java.ReadOnlyContext;
import org.openejb.deployment.DeploymentHelper;
import org.openejb.deployment.MDBContainerBuilder;
import org.openejb.dispatch.InterfaceMethodSignature;
@@ -83,11 +83,11 @@
return ContainerPolicy.Required;
}
});
- builder.setComponentContext(new ReadOnlyContext());
+ builder.setComponentContext(new HashMap());
container = builder.createConfiguration();
container.setName(DeploymentHelper.CONTAINER_NAME);
- //start the ejb container
+ //start the ejb container
container.setReferencePattern("TransactionContextManager",
DeploymentHelper.TRANSACTIONCONTEXTMANAGER_NAME);
container.setReferencePattern("TrackedConnectionAssociator",
DeploymentHelper.TRACKEDCONNECTIONASSOCIATOR_NAME);
container.setReferencePattern("Timer",
DeploymentHelper.TRANSACTIONALTIMER_NAME);
@@ -108,11 +108,11 @@
// @todo put a wait limit in here... otherwise this can lock a build
// Wait for 3 messages to arrive..
System.out.println("Waiting for message 1");
- MockEJB.messageCounter.acquire();
+ assertTrue(MockEJB.messageCounter.attempt(10000));
System.out.println("Waiting for message 2");
- MockEJB.messageCounter.acquire();
+ assertTrue(MockEJB.messageCounter.attempt(10000));
System.out.println("Waiting for message 3");
- MockEJB.messageCounter.acquire();
+ assertTrue(MockEJB.messageCounter.attempt(10000));
System.out.println("Done.");
assertTrue("Timer should have fired once by now...",
MockEJB.timerFired);