geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r427273 [6/6] - in /geronimo/branches/dain/notcm: applications/magicGball/magicGball-ear/src/plan/ applications/magicGball/src/plan/ configs/client-corba/src/plan/ configs/client-deployer/src/plan/ configs/client/src/plan/ configs/j2ee-corb...
Date Mon, 31 Jul 2006 21:08:24 GMT
Copied: geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/context/GeronimoTransactionManagerTest.java
(from r417848, geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/context/TransactionContextManagerTest.java)
URL: http://svn.apache.org/viewvc/geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/context/GeronimoTransactionManagerTest.java?p2=geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/context/GeronimoTransactionManagerTest.java&p1=geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/context/TransactionContextManagerTest.java&r1=417848&r2=427273&rev=427273&view=diff
==============================================================================
--- geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/context/TransactionContextManagerTest.java
(original)
+++ geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/context/GeronimoTransactionManagerTest.java
Mon Jul 31 14:08:15 2006
@@ -17,12 +17,14 @@
 
 package org.apache.geronimo.transaction.context;
 
-import javax.transaction.xa.Xid;
 import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
 
+import edu.emory.mathcs.backport.java.util.concurrent.CountDownLatch;
+import junit.framework.AssertionFailedError;
 import junit.framework.TestCase;
-import org.apache.geronimo.transaction.ImportedTransactionActiveException;
-import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
+import org.apache.geronimo.transaction.manager.ImportedTransactionActiveException;
+import org.apache.geronimo.transaction.manager.GeronimoTransactionManager;
 import org.apache.geronimo.transaction.manager.XidFactory;
 import org.apache.geronimo.transaction.manager.XidFactoryImpl;
 
@@ -32,58 +34,88 @@
  * @version $Rev$ $Date$
  *
  */
-public class TransactionContextManagerTest extends TestCase {
+public class GeronimoTransactionManagerTest extends TestCase {
 
-    private TransactionContextManager transactionContextManager;
+    private GeronimoTransactionManager geronimoTransactionManager;
     private XidFactory xidFactory = new XidFactoryImpl("geronimo.test.tm".getBytes());
 
     protected void setUp() throws Exception {
-        TransactionManagerImpl tm = new TransactionManagerImpl(1000, 
-                new XidFactoryImpl("WHAT DO WE CALL IT?".getBytes()), null, null);
-        transactionContextManager = new TransactionContextManager(tm, tm);
+        super.setUp();
+        geronimoTransactionManager = new GeronimoTransactionManager();
     }
 
     protected void tearDown() throws Exception {
-        transactionContextManager = null;
+        geronimoTransactionManager = null;
+        super.tearDown();
     }
 
     public void testImportedTxLifecycle() throws Exception {
         Xid xid = xidFactory.createXid();
-        transactionContextManager.begin(xid, 1000);
-        transactionContextManager.end(xid);
-        transactionContextManager.begin(xid, 1000);
-        transactionContextManager.end(xid);
-        int readOnly = transactionContextManager.prepare(xid);
+        geronimoTransactionManager.begin(xid, 1000);
+        geronimoTransactionManager.end(xid);
+        geronimoTransactionManager.begin(xid, 1000);
+        geronimoTransactionManager.end(xid);
+        int readOnly = geronimoTransactionManager.prepare(xid);
         assertEquals(XAResource.XA_RDONLY, readOnly);
-//        transactionContextManager.commit(xid, false);
+//        geronimoTransactionManager.commit(xid, false);
     }
 
     public void testNoConcurrentWorkSameXid() throws Exception {
-        Xid xid = xidFactory.createXid();
-        transactionContextManager.begin(xid, 1000);
+        final Xid xid = xidFactory.createXid();
+
+        final CountDownLatch startSignal = new CountDownLatch(1);
+        final CountDownLatch cleanupSignal = new CountDownLatch(1);
+        final CountDownLatch endSignal = new CountDownLatch(1);
+
+        new Thread() {
+            public void run() {
+                try {
+                    try {
+                        try {
+                            geronimoTransactionManager.begin(xid, 1000);
+                        } finally {
+                            startSignal.countDown();
+                        }
+                        cleanupSignal.await();
+                        geronimoTransactionManager.end(xid);
+                        geronimoTransactionManager.rollback(xid);
+                    } finally {
+                        endSignal.countDown();
+                    }
+                } catch (Exception e) {
+                    throw (AssertionFailedError) new AssertionFailedError().initCause(e);
+                }
+            }
+        }.start();
+
+        // wait for thread to begin the tx
+        startSignal.await();
         try {
-            transactionContextManager.begin(xid, 1000);
+            geronimoTransactionManager.begin(xid, 1000);
             fail("should not be able begin same xid twice");
         } catch (ImportedTransactionActiveException e) {
             //expected
         } finally {
-            transactionContextManager.end(xid);
-            transactionContextManager.rollback(xid);
+            // tell thread to start cleanup (e.g., end and rollback the tx)
+            cleanupSignal.countDown();
+
+            // wait for our thread to finish cleanup
+            endSignal.await();
         }
     }
 
     public void testOnlyOneImportedTxAtATime() throws Exception {
         Xid xid1 = xidFactory.createXid();
         Xid xid2 = xidFactory.createXid();
-        transactionContextManager.begin(xid1, 1000);
+        geronimoTransactionManager.begin(xid1, 1000);
         try {
-            transactionContextManager.begin(xid2, 1000);
+            geronimoTransactionManager.begin(xid2, 1000);
             fail("should not be able to begin a 2nd tx without ending the first");
         } catch (IllegalStateException e) {
             //expected
         } finally {
-            transactionContextManager.end(xid1);
-            transactionContextManager.rollback(xid1);
+            geronimoTransactionManager.end(xid1);
+            geronimoTransactionManager.rollback(xid1);
         }
     }
 }

Propchange: geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/context/GeronimoTransactionManagerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/context/GeronimoTransactionManagerTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/context/GeronimoTransactionManagerTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/log/HOWLLogTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/log/HOWLLogTest.java?rev=427273&r1=427272&r2=427273&view=diff
==============================================================================
--- geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/log/HOWLLogTest.java
(original)
+++ geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/log/HOWLLogTest.java
Mon Jul 31 14:08:15 2006
@@ -25,7 +25,6 @@
 import org.apache.geronimo.transaction.manager.TransactionLog;
 import org.apache.geronimo.transaction.manager.XidFactory;
 import org.apache.geronimo.transaction.manager.XidFactoryImpl;
-import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 
 /**
  *
@@ -63,7 +62,7 @@
                 2, //                "minBuffers",
                 10,//                "threadsWaitingForceThreshold"});
                 xidFactory,
-                new BasicServerInfo(new File(basedir, "target").getAbsolutePath())
+                new File(basedir, "target")
         );
         howlLog.doStart();
         return howlLog;

Modified: geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/HOWLLogRecoveryTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/HOWLLogRecoveryTest.java?rev=427273&r1=427272&r2=427273&view=diff
==============================================================================
--- geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/HOWLLogRecoveryTest.java
(original)
+++ geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/HOWLLogRecoveryTest.java
Mon Jul 31 14:08:15 2006
@@ -20,7 +20,6 @@
 import java.io.File;
 
 import org.apache.geronimo.transaction.log.HOWLLog;
-import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import junit.framework.Test;
 import junit.framework.TestSuite;
 import junit.extensions.TestSetup;
@@ -72,7 +71,7 @@
                 2, //                "minBuffers",
                 10,//                "threadsWaitingForceThreshold"});
                 xidFactory,
-                new BasicServerInfo(targetDir)
+                new File(targetDir)
         );
         howlLog.doStart();
         txLog = howlLog;

Modified: geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/ProtocolTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/ProtocolTest.java?rev=427273&r1=427272&r2=427273&view=diff
==============================================================================
--- geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/ProtocolTest.java
(original)
+++ geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/ProtocolTest.java
Mon Jul 31 14:08:15 2006
@@ -31,8 +31,7 @@
     private MockResource mr11, mr12, mr21, mr22;
 
     protected void setUp() throws Exception {
-        tm = new TransactionManagerImpl(1000, 
-                new XidFactoryImpl("WHAT DO WE CALL IT?".getBytes()), null, null);
+        tm = new TransactionManagerImpl();
         mrm1 = new MockResourceManager(true);
         mrm2 = new MockResourceManager(true);
         mr11 = new MockResource(mrm1, "mr11");

Modified: geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/TestTransactionManager.java
URL: http://svn.apache.org/viewvc/geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/TestTransactionManager.java?rev=427273&r1=427272&r2=427273&view=diff
==============================================================================
--- geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/TestTransactionManager.java
(original)
+++ geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/TestTransactionManager.java
Mon Jul 31 14:08:15 2006
@@ -112,8 +112,7 @@
     }
 
     protected void setUp() throws Exception {
-        tm = new TransactionManagerImpl(10 * 1000,
-                new XidFactoryImpl("WHAT DO WE CALL IT?".getBytes()), null, null);
+        tm = new TransactionManagerImpl();
         rm1 = new MockResourceManager(true);
         rm2 = new MockResourceManager(true);
         rm3 = new MockResourceManager(false);

Modified: geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/XATransactionTester.java
URL: http://svn.apache.org/viewvc/geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/XATransactionTester.java?rev=427273&r1=427272&r2=427273&view=diff
==============================================================================
--- geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/XATransactionTester.java
(original)
+++ geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/XATransactionTester.java
Mon Jul 31 14:08:15 2006
@@ -47,9 +47,7 @@
         ds = getDataSource(args);
         XAConnection xaConn = ds.getXAConnection("test", "test");
         XAResource xaRes = xaConn.getXAResource();
-        manager = new TransactionManagerImpl(10,
-                new XidFactoryImpl("WHAT DO WE CALL IT?".getBytes()), 
-                new DummyLog(), null);
+        manager = new TransactionManagerImpl(10, new DummyLog());
         Connection c = xaConn.getConnection();
         Statement s = c.createStatement();
 

Modified: geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/XidImporterTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/XidImporterTest.java?rev=427273&r1=427272&r2=427273&view=diff
==============================================================================
--- geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/XidImporterTest.java
(original)
+++ geronimo/branches/dain/notcm/modules/transaction/src/test/org/apache/geronimo/transaction/manager/XidImporterTest.java
Mon Jul 31 14:08:15 2006
@@ -44,8 +44,7 @@
     XidFactory xidFactory = new XidFactoryImpl();
 
     protected void setUp() throws Exception {
-        tm = new TransactionManagerImpl(10 * 1000, 
-                new XidFactoryImpl("WHAT DO WE CALL IT?".getBytes()), null, null);
+        tm = new TransactionManagerImpl();
     }
 
     public void testImportXid() throws Exception {

Modified: geronimo/branches/dain/notcm/modules/upgrade/src/java/org/apache/geronimo/upgrade/Upgrade1_0To1_1.java
URL: http://svn.apache.org/viewvc/geronimo/branches/dain/notcm/modules/upgrade/src/java/org/apache/geronimo/upgrade/Upgrade1_0To1_1.java?rev=427273&r1=427272&r2=427273&view=diff
==============================================================================
--- geronimo/branches/dain/notcm/modules/upgrade/src/java/org/apache/geronimo/upgrade/Upgrade1_0To1_1.java
(original)
+++ geronimo/branches/dain/notcm/modules/upgrade/src/java/org/apache/geronimo/upgrade/Upgrade1_0To1_1.java
Mon Jul 31 14:08:15 2006
@@ -40,7 +40,7 @@
 import org.apache.geronimo.deployment.service.EnvironmentBuilder;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class Upgrade1_0To1_1 {
 

Modified: geronimo/branches/dain/notcm/modules/upgrade/src/java/org/apache/geronimo/upgrade/UpgradeGBean.java
URL: http://svn.apache.org/viewvc/geronimo/branches/dain/notcm/modules/upgrade/src/java/org/apache/geronimo/upgrade/UpgradeGBean.java?rev=427273&r1=427272&r2=427273&view=diff
==============================================================================
--- geronimo/branches/dain/notcm/modules/upgrade/src/java/org/apache/geronimo/upgrade/UpgradeGBean.java
(original)
+++ geronimo/branches/dain/notcm/modules/upgrade/src/java/org/apache/geronimo/upgrade/UpgradeGBean.java
Mon Jul 31 14:08:15 2006
@@ -30,7 +30,7 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class UpgradeGBean {
 

Modified: geronimo/branches/dain/notcm/modules/upgrade/src/test-data/ejb_pkgen_1.xml
URL: http://svn.apache.org/viewvc/geronimo/branches/dain/notcm/modules/upgrade/src/test-data/ejb_pkgen_1.xml?rev=427273&r1=427272&r2=427273&view=diff
==============================================================================
--- geronimo/branches/dain/notcm/modules/upgrade/src/test-data/ejb_pkgen_1.xml (original)
+++ geronimo/branches/dain/notcm/modules/upgrade/src/test-data/ejb_pkgen_1.xml Mon Jul 31
14:08:15 2006
@@ -29,8 +29,8 @@
       </enterprise-beans>
 
       <gbean gbeanName="geronimo.server:name=CMPPKGenerator" class="org.openejb.entity.cmp.pkgenerator.SequenceTablePrimaryKeyGeneratorWrapper">
-        <reference name="TransactionContextManager">
-            <gbean-name>*:name=TransactionContextManager,*</gbean-name>
+        <reference name="TransactionManager">
+            <gbean-name>*:name=TransactionManager,*</gbean-name>
         </reference>
         <reference name="ManagedConnectionFactoryWrapper"><gbean-name>geronimo.server:J2EEApplication=null,J2EEServer=geronimo,JCAResource=geronimo-cts/database/${pom.currentVersion}/car,j2eeType=JCAManagedConnectionFactory,name=jdbc/DB1</gbean-name></reference>
         <attribute name="tableName">CUSTOM_UNKNOWNPK_TABLE1</attribute>

Modified: geronimo/branches/dain/notcm/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/RepoCopier.java
URL: http://svn.apache.org/viewvc/geronimo/branches/dain/notcm/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/RepoCopier.java?rev=427273&r1=427272&r2=427273&view=diff
==============================================================================
--- geronimo/branches/dain/notcm/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/RepoCopier.java
(original)
+++ geronimo/branches/dain/notcm/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/RepoCopier.java
Mon Jul 31 14:08:15 2006
@@ -28,7 +28,7 @@
 import java.io.IOException;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class RepoCopier {
 

Modified: geronimo/branches/dain/notcm/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/ConfigCopier.java
URL: http://svn.apache.org/viewvc/geronimo/branches/dain/notcm/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/ConfigCopier.java?rev=427273&r1=427272&r2=427273&view=diff
==============================================================================
--- geronimo/branches/dain/notcm/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/ConfigCopier.java
(original)
+++ geronimo/branches/dain/notcm/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/ConfigCopier.java
Mon Jul 31 14:08:15 2006
@@ -34,7 +34,7 @@
 /**
  * Copies all the configurations out of source config store into target config store.
  *
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class ConfigCopier {
 

Modified: geronimo/branches/dain/notcm/plugins/geronimo-packaging-plugin/src/test-resources/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/branches/dain/notcm/plugins/geronimo-packaging-plugin/src/test-resources/plan.xml?rev=427273&r1=427272&r2=427273&view=diff
==============================================================================
--- geronimo/branches/dain/notcm/plugins/geronimo-packaging-plugin/src/test-resources/plan.xml
(original)
+++ geronimo/branches/dain/notcm/plugins/geronimo-packaging-plugin/src/test-resources/plan.xml
Mon Jul 31 14:08:15 2006
@@ -97,8 +97,8 @@
   </gbean>
   <gbean name="TransactionalThreadPooledTimer" class="org.apache.geronimo.timer.jdbc.JDBCStoreThreadPooledTransactionalTimer">
     <attribute name="repeatCount">5</attribute>
-    <reference name="TransactionContextManager">
-      <name>TransactionContextManager</name>
+    <reference name="TransactionManager">
+      <name>TransactionManager</name>
     </reference>
     <reference name="ManagedConnectionFactoryWrapper">
       <name>SystemDatasource</name>
@@ -111,8 +111,8 @@
     </dependency>
   </gbean>
   <gbean name="NonTransactionalThreadPooledTimer" class="org.apache.geronimo.timer.jdbc.JDBCStoreThreadPooledNonTransactionalTimer">
-    <reference name="TransactionContextManager">
-      <name>TransactionContextManager</name>
+    <reference name="TransactionManager">
+      <name>TransactionManager</name>
     </reference>
     <reference name="ManagedConnectionFactoryWrapper">
       <name>SystemDatasource</name>

Modified: geronimo/branches/dain/notcm/plugins/geronimo-packaging-plugin/src/test-resources/result.xml
URL: http://svn.apache.org/viewvc/geronimo/branches/dain/notcm/plugins/geronimo-packaging-plugin/src/test-resources/result.xml?rev=427273&r1=427272&r2=427273&view=diff
==============================================================================
--- geronimo/branches/dain/notcm/plugins/geronimo-packaging-plugin/src/test-resources/result.xml
(original)
+++ geronimo/branches/dain/notcm/plugins/geronimo-packaging-plugin/src/test-resources/result.xml
Mon Jul 31 14:08:15 2006
@@ -96,8 +96,8 @@
   </gbean>
   <gbean name="TransactionalThreadPooledTimer" class="org.apache.geronimo.timer.jdbc.JDBCStoreThreadPooledTransactionalTimer">
     <attribute name="repeatCount">5</attribute>
-    <reference name="TransactionContextManager">
-      <name>TransactionContextManager</name>
+    <reference name="TransactionManager">
+      <name>TransactionManager</name>
     </reference>
     <reference name="ManagedConnectionFactoryWrapper">
       <name>SystemDatasource</name>
@@ -110,8 +110,8 @@
     </dependency>
   </gbean>
   <gbean name="NonTransactionalThreadPooledTimer" class="org.apache.geronimo.timer.jdbc.JDBCStoreThreadPooledNonTransactionalTimer">
-    <reference name="TransactionContextManager">
-      <name>TransactionContextManager</name>
+    <reference name="TransactionManager">
+      <name>TransactionManager</name>
     </reference>
     <reference name="ManagedConnectionFactoryWrapper">
       <name>SystemDatasource</name>

Modified: geronimo/branches/dain/notcm/plugins/geronimo-packaging-plugin/src/test/org/apache/geronimo/plugin/packaging/PlanProcessorTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/dain/notcm/plugins/geronimo-packaging-plugin/src/test/org/apache/geronimo/plugin/packaging/PlanProcessorTest.java?rev=427273&r1=427272&r2=427273&view=diff
==============================================================================
--- geronimo/branches/dain/notcm/plugins/geronimo-packaging-plugin/src/test/org/apache/geronimo/plugin/packaging/PlanProcessorTest.java
(original)
+++ geronimo/branches/dain/notcm/plugins/geronimo-packaging-plugin/src/test/org/apache/geronimo/plugin/packaging/PlanProcessorTest.java
Mon Jul 31 14:08:15 2006
@@ -30,7 +30,7 @@
 import org.apache.geronimo.kernel.repository.Artifact;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class PlanProcessorTest extends TestCase {
 



Mime
View raw message