Title: [2431] trunk/openejb2/modules/core/src/test/org/openejb/timer: GERONIMO-1599 HOWLLog throws NPE because XidFactory is missing
Revision
2431
Author
gdamour
Date
2006-02-09 08:23:35 -0500 (Thu, 09 Feb 2006)

Log Message

GERONIMO-1599 HOWLLog throws NPE because XidFactory is missing

Extract XidFactory from TransactionManagerImpl.

Modified Paths

Diff

Modified: trunk/openejb2/modules/core/src/test/org/openejb/cluster/server/E2EIntegrationTest.java (2430 => 2431)

--- trunk/openejb2/modules/core/src/test/org/openejb/cluster/server/E2EIntegrationTest.java	2006-02-09 05:52:41 UTC (rev 2430)
+++ trunk/openejb2/modules/core/src/test/org/openejb/cluster/server/E2EIntegrationTest.java	2006-02-09 13:23:35 UTC (rev 2431)
@@ -82,6 +82,7 @@
  * @version $Revision$ $Date$
  */
 public class E2EIntegrationTest extends TestCase {
+
     private NodeInfo node1;
     private NodeInfo node2;
 

Modified: trunk/openejb2/modules/core/src/test/org/openejb/spring/spring.xml (2430 => 2431)

--- trunk/openejb2/modules/core/src/test/org/openejb/spring/spring.xml	2006-02-09 05:52:41 UTC (rev 2430)
+++ trunk/openejb2/modules/core/src/test/org/openejb/spring/spring.xml	2006-02-09 13:23:35 UTC (rev 2431)
@@ -1,10 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
 <beans>
+
+  <bean id="XidFactory" class="org.apache.geronimo.transaction.manager.XidFactoryImpl">
+  </bean>
+
   <bean id="TransactionManager" class="org.apache.geronimo.transaction.manager.TransactionManagerImpl">
     <constructor-arg index="0" value="100"/>
-    <constructor-arg index="1"><null/></constructor-arg>
+    <constructor-arg index="1" ref="XidFactory"/>
     <constructor-arg index="2"><null/></constructor-arg>
+    <constructor-arg index="3"><null/></constructor-arg>
   </bean>
 
   <bean id="TransactionContextManager" class="org.apache.geronimo.transaction.context.TransactionContextManager">

Modified: trunk/openejb2/modules/core/src/test/org/openejb/timer/TimerServiceImplTest.java (2430 => 2431)

--- trunk/openejb2/modules/core/src/test/org/openejb/timer/TimerServiceImplTest.java	2006-02-09 05:52:41 UTC (rev 2430)
+++ trunk/openejb2/modules/core/src/test/org/openejb/timer/TimerServiceImplTest.java	2006-02-09 13:23:35 UTC (rev 2431)
@@ -71,6 +71,7 @@
 import org.apache.geronimo.transaction.context.TransactionContextManager;
 import org.apache.geronimo.transaction.context.UserTransactionImpl;
 import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
+import org.apache.geronimo.transaction.manager.XidFactoryImpl;
 import org.apache.geronimo.core.service.InvocationResult;
 import org.apache.geronimo.core.service.Invocation;
 import org.openejb.ExtendedEjbDeployment;
@@ -113,7 +114,8 @@
 
     protected void setUp() throws Exception {
         super.setUp();
-        TransactionManagerImpl transactionManager = new TransactionManagerImpl(10 * 1000, null, null);
+        TransactionManagerImpl transactionManager = new TransactionManagerImpl(10 * 1000, 
+                new XidFactoryImpl("WHAT DO WE CALL IT?".getBytes()), null, null);
         transactionContextManager = new TransactionContextManager(transactionManager, transactionManager);
         executableWorkFactory = new TransactionalExecutorTaskFactory(transactionContextManager, 1);
         threadPool = new ThreadPool(5, "TestPool", 10000, this.getClass().getClassLoader(), "test:type=ThreadPool");

Modified: trunk/openejb2/modules/openejb-builder/src/test/org/openejb/deployment/DeploymentHelper.java (2430 => 2431)

--- trunk/openejb2/modules/openejb-builder/src/test/org/openejb/deployment/DeploymentHelper.java	2006-02-09 05:52:41 UTC (rev 2430)
+++ trunk/openejb2/modules/openejb-builder/src/test/org/openejb/deployment/DeploymentHelper.java	2006-02-09 13:23:35 UTC (rev 2431)
@@ -73,6 +73,7 @@
 import org.apache.geronimo.timer.vm.VMStoreThreadPooledTransactionalTimer;
 import org.apache.geronimo.transaction.context.TransactionContextManagerGBean;
 import org.apache.geronimo.transaction.manager.TransactionManagerImplGBean;
+import org.apache.geronimo.transaction.manager.XidFactoryImplGBean;
 import org.openejb.deployment.mdb.mockra.MockActivationSpec;
 import org.openejb.deployment.mdb.mockra.MockResourceAdapter;
 import org.openejb.slsb.DefaultStatelessEjbContainer;
@@ -101,6 +102,7 @@
     public static final ObjectName BMP_EJB_CONTAINER_NAME = JMXUtil.getObjectName("geronimo.test:name=Bmp,j2eeType=EjbContainer");
     public static final ObjectName CMP_EJB_CONTAINER_NAME = JMXUtil.getObjectName("geronimo.test:name=Cmp,j2eeType=EjbContainer");
     public static final ObjectName MDB_EJB_CONTAINER_NAME = JMXUtil.getObjectName("geronimo.test:name=Mdb,j2eeType=EjbContainer");
+    public static final ObjectName XIDFACTORY_NAME = JMXUtil.getObjectName(j2eeDomainName + ":type=" + NameFactory.XID_FACTORY);
     public static final ObjectName TRANSACTIONMANAGER_NAME = JMXUtil.getObjectName(j2eeDomainName + ":type=TransactionManager");
     public static final ObjectName TRANSACTIONCONTEXTMANAGER_NAME = JMXUtil.getObjectName(j2eeDomainName + ":type=TransactionContextManager");
     public static final ObjectName TRACKEDCONNECTIONASSOCIATOR_NAME = JMXUtil.getObjectName("geronimo.test:role=TrackedConnectionAssociator");
@@ -127,10 +129,15 @@
     public static Kernel setUpKernelWithTransactionManager() throws Exception {
         Kernel kernel = KernelHelper.getPreparedKernel();
 
+        GBeanData xidFacGBean = new GBeanData(XIDFACTORY_NAME, XidFactoryImplGBean.GBEAN_INFO);
+        xidFacGBean.setAttribute("tmId", "WHAT DO WE CALL IT?".getBytes());
+        start(kernel, xidFacGBean);
+        
         GBeanData tmGBean = new GBeanData(TRANSACTIONMANAGER_NAME, TransactionManagerImplGBean.GBEAN_INFO);
         Set rmpatterns = new HashSet();
         rmpatterns.add(ObjectName.getInstance("geronimo.server:j2eeType=JCAManagedConnectionFactory,*"));
         tmGBean.setAttribute("defaultTransactionTimeoutSeconds", new Integer(100));
+        tmGBean.setReferencePattern("XidFactory", XIDFACTORY_NAME);
         tmGBean.setReferencePatterns("ResourceManagers", rmpatterns);
         start(kernel, tmGBean);
 

Reply via email to