[jboss-svn-commits] JBL Code SVN: r31981 - in labs/jbosstm/trunk/ArjunaJTS/jts: classes/com/arjuna/ats/internal/jts/recovery/contact and 6 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Mar 7 11:46:32 EST 2010


Author: mark.little at jboss.com
Date: 2010-03-07 11:46:31 -0500 (Sun, 07 Mar 2010)
New Revision: 31981

Added:
   labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/interposition/ExplicitInterpositionUnitTest.java
   labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/orbspecific/interposition/OSIInterpositionUnitTest.java
   labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/orbspecific/interposition/OTIDMapUnitTest.java
   labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/recovery/
   labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/recovery/ExpiredContactUnitTest.java
   labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/recovery/RecoveryContactUnitTest.java
   labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/utils/OTSManagerUnitTest.java
Modified:
   labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/OTSImpleManager.java
   labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/recovery/contact/ExpiredContactScanner.java
   labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/recovery/contact/RecoveryContactWriter.java
   labs/jbosstm/trunk/ArjunaJTS/jts/idl/arjuna/ArjunaOTS.idl
Log:
https://jira.jboss.org/jira/browse/JBTM-715

Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/OTSImpleManager.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/OTSImpleManager.java	2010-03-07 16:20:06 UTC (rev 31980)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/OTSImpleManager.java	2010-03-07 16:46:31 UTC (rev 31981)
@@ -43,8 +43,6 @@
 
 import org.omg.CosTransactions.*;
 
-import com.arjuna.ArjunaOTS.*;
-
 import org.omg.CORBA.SystemException;
 import org.omg.CORBA.BAD_PARAM;
 import org.omg.CORBA.UNKNOWN;

Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/recovery/contact/ExpiredContactScanner.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/recovery/contact/ExpiredContactScanner.java	2010-03-07 16:20:06 UTC (rev 31980)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/recovery/contact/ExpiredContactScanner.java	2010-03-07 16:46:31 UTC (rev 31981)
@@ -31,8 +31,6 @@
 
 package com.arjuna.ats.internal.jts.recovery.contact;
 
-import org.omg.CosTransactions.*;
-
 import java.util.*;
 import java.text.*;
 
@@ -43,7 +41,6 @@
 import com.arjuna.ats.arjuna.state.*;
 
 import com.arjuna.ats.internal.arjuna.common.UidHelper;
-import com.arjuna.ats.jts.common.jtsPropertyManager;
 import com.arjuna.ats.jts.logging.jtsLogger;
 import com.arjuna.ats.arjuna.logging.FacilityCode;
 import com.arjuna.common.util.logging.*;

Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/recovery/contact/RecoveryContactWriter.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/recovery/contact/RecoveryContactWriter.java	2010-03-07 16:20:06 UTC (rev 31980)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/recovery/contact/RecoveryContactWriter.java	2010-03-07 16:46:31 UTC (rev 31981)
@@ -33,7 +33,6 @@
 package com.arjuna.ats.internal.jts.recovery.contact;
 
 import com.arjuna.ats.jts.logging.*;
-import com.arjuna.ats.arjuna.common.*;
 import com.arjuna.ats.arjuna.logging.FacilityCode;
 import com.arjuna.ArjunaOTS.*;
 
@@ -58,70 +57,67 @@
 
 public class RecoveryContactWriter implements com.arjuna.orbportability.event.EventHandler
 {
+    private boolean _noted;
 
-private boolean _noted;
-
-public RecoveryContactWriter()
-{
-    if (jtsLogger.loggerI18N.isDebugEnabled())
+    public RecoveryContactWriter()
     {
-	jtsLogger.loggerI18N.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, 
-				   FacilityCode.FAC_CRASH_RECOVERY, 
-				   "com.arjuna.ats.internal.jts.recovery.contact.RecoveryContactWriter_1");
+        if (jtsLogger.loggerI18N.isDebugEnabled())
+        {
+            jtsLogger.loggerI18N.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, 
+                    FacilityCode.FAC_CRASH_RECOVERY, 
+            "com.arjuna.ats.internal.jts.recovery.contact.RecoveryContactWriter_1");
+        }
+
+        _noted = false;
     }
 
-    _noted = false;
-}
+    public void connected (org.omg.CORBA.Object obj)
+    {    
+        if (jtsLogger.loggerI18N.isDebugEnabled())
+        {
+            jtsLogger.loggerI18N.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, 
+                    FacilityCode.FAC_CRASH_RECOVERY, 
+                    "com.arjuna.ats.internal.jts.recovery.contact.RecoveryContactWriter_2", new Object[] {obj});
+        }
 
-public void connected (org.omg.CORBA.Object obj)
-{    
-    if (jtsLogger.loggerI18N.isDebugEnabled())
-    {
-	jtsLogger.loggerI18N.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, 
-				   FacilityCode.FAC_CRASH_RECOVERY, 
-				   "com.arjuna.ats.internal.jts.recovery.contact.RecoveryContactWriter_2", new Object[] {obj});
-    }
+        // only do this once - but shouldn't need this, since de-register on writing
 
-    // only do this once - but shouldn't need this, since de-register on writing
+        if (_noted) {
+            return;
+        }
+        try {
+            ArjunaFactory theFactory = ArjunaFactoryHelper.narrow(obj);
 
-    if (_noted) {
-	return;
+            if (theFactory != null) {
+                // if that didn't blow, we have a hit
+                if (jtsLogger.loggerI18N.isDebugEnabled())
+                {
+                    jtsLogger.loggerI18N.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, 
+                            FacilityCode.FAC_CRASH_RECOVERY, 
+                    "com.arjuna.ats.internal.jts.recovery.contact.RecoveryContactWriter_1");
+                }
+
+                FactoryContactItem.createAndSave(theFactory);
+                // we've done our work, so set the flag and try to remove ourselves
+                _noted = true;
+                EventManager.getManager().removeHandler(this);
+            }
+        } catch ( Exception ex) {
+            // oh well - it probably wasn't ours
+        }
     }
-    try {
-	ArjunaFactory theFactory = ArjunaFactoryHelper.narrow(obj);
-	
-	if (theFactory != null) {
-	    // if that didn't blow, we have a hit
-	    if (jtsLogger.loggerI18N.isDebugEnabled())
-	    {
-		jtsLogger.loggerI18N.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, 
-					   FacilityCode.FAC_CRASH_RECOVERY, 
-					   "com.arjuna.ats.internal.jts.recovery.contact.RecoveryContactWriter_1");
-	    }
-	    
-	    FactoryContactItem.createAndSave(theFactory);
-	    // we've done our work, so set the flag and try to remove ourselves
-	    _noted = true;
-	    EventManager.getManager().removeHandler(this);
-	}
-    } catch ( Exception ex) {
-	// oh well - it probably wasn't ours
+
+    public void disconnected (org.omg.CORBA.Object obj)
+    {
+        // nothing to be done
     }
-}
 
-public void disconnected (org.omg.CORBA.Object obj)
-{
-    // nothing to be done
+    public String name ()
+    {
+        return "RecoveryContactEventHandler";
+    }
 }
 
-public String name ()
-{
-    return "RecoveryContactEventHandler";
-}
 
 
-}
 
-
-
-

Modified: labs/jbosstm/trunk/ArjunaJTS/jts/idl/arjuna/ArjunaOTS.idl
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/idl/arjuna/ArjunaOTS.idl	2010-03-07 16:20:06 UTC (rev 31980)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/idl/arjuna/ArjunaOTS.idl	2010-03-07 16:46:31 UTC (rev 31981)
@@ -48,20 +48,20 @@
 
     struct GlobalTransactionInfo
     {
-	long  totalNumberOfTransactions;
-	long  numberOfCommittedTransactions;
-	long  numberOfAbortedTransactions;
-	float averageLifetime;
-	long  numberOfHeuristics;
-	long  reaperTimeout;
-	long  defaultTimeout;
+		long  totalNumberOfTransactions;
+		long  numberOfCommittedTransactions;
+		long  numberOfAbortedTransactions;
+		float averageLifetime;
+		long  numberOfHeuristics;
+		long  reaperTimeout;
+		long  defaultTimeout;
     };
 
     struct TransactionInfo
     {
-	long currentDepth;
-	long timeout;
-	long numberOfThreads;
+		long currentDepth;
+		long timeout;
+		long numberOfThreads;
     };
 
     typedef sequence<CosTransactions::otid_t> txIds;
@@ -78,8 +78,8 @@
 
     interface UidCoordinator : CosTransactions::Coordinator
     {
-	readonly attribute string uid;
-	readonly attribute string topLevelUid;
+		readonly attribute string uid;
+		readonly attribute string topLevelUid;
     };
 
     interface ActionControl : CosTransactions::Control
@@ -91,7 +91,7 @@
 
     interface ArjunaSubtranAwareResource : CosTransactions::SubtransactionAwareResource
     {
-	CosTransactions::Vote prepare_subtransaction ();
+		CosTransactions::Vote prepare_subtransaction ();
     };
 
     /*
@@ -102,17 +102,17 @@
 
     interface ArjunaFactory : CosTransactions::TransactionFactory
     {
-	txIds numberOfTransactions (in ArjunaOTS::TransactionType t) raises(CosTransactions::Inactive, CosTransactions::NoTransaction);
-
-	txIds getChildTransactions (in CosTransactions::otid_t parent) raises(CosTransactions::Inactive, CosTransactions::NoTransaction);
-
-	CosTransactions::Status getCurrentStatus (in CosTransactions::otid_t uid) raises(CosTransactions::NoTransaction);
-	CosTransactions::Status getStatus (in CosTransactions::otid_t uid) raises(CosTransactions::NoTransaction);
-
-	GlobalTransactionInfo getGlobalInfo ();
-	TransactionInfo getTransactionInfo (in CosTransactions::otid_t uid) raises(CosTransactions::NoTransaction);
-
-	CosTransactions::Control getTransaction (in CosTransactions::otid_t uid) raises(CosTransactions::NoTransaction);
+		txIds numberOfTransactions (in ArjunaOTS::TransactionType t) raises(CosTransactions::Inactive, CosTransactions::NoTransaction);
+	
+		txIds getChildTransactions (in CosTransactions::otid_t parent) raises(CosTransactions::Inactive, CosTransactions::NoTransaction);
+	
+		CosTransactions::Status getCurrentStatus (in CosTransactions::otid_t uid) raises(CosTransactions::NoTransaction);
+		CosTransactions::Status getStatus (in CosTransactions::otid_t uid) raises(CosTransactions::NoTransaction);
+	
+		GlobalTransactionInfo getGlobalInfo ();
+		TransactionInfo getTransactionInfo (in CosTransactions::otid_t uid) raises(CosTransactions::NoTransaction);
+	
+		CosTransactions::Control getTransaction (in CosTransactions::otid_t uid) raises(CosTransactions::NoTransaction);
     };
 
     interface ArjunaTransaction : UidCoordinator, CosTransactions::Terminator
@@ -121,26 +121,26 @@
 
     interface Current : CosTransactions::Current
     {
-	long get_timeout ();
+		long get_timeout ();
     };
 
     interface OTSAbstractRecord : ArjunaSubtranAwareResource
     {
-	readonly attribute long type_id;
-	readonly attribute string uid;
-
-	boolean propagateOnAbort ();
-	boolean propagateOnCommit ();
-
-	boolean saveRecord ();
-
-	void merge (in OTSAbstractRecord record);
-	void alter (in OTSAbstractRecord record);
-
-	boolean shouldAdd (in OTSAbstractRecord record);
-	boolean shouldAlter (in OTSAbstractRecord record);
-	boolean shouldMerge (in OTSAbstractRecord record);
-	boolean shouldReplace (in OTSAbstractRecord record);
+		readonly attribute long type_id;
+		readonly attribute string uid;
+	
+		boolean propagateOnAbort ();
+		boolean propagateOnCommit ();
+	
+		boolean saveRecord ();
+	
+		void merge (in OTSAbstractRecord record);
+		void alter (in OTSAbstractRecord record);
+	
+		boolean shouldAdd (in OTSAbstractRecord record);
+		boolean shouldAlter (in OTSAbstractRecord record);
+		boolean shouldMerge (in OTSAbstractRecord record);
+		boolean shouldReplace (in OTSAbstractRecord record);
     };
 
     // for JTA 1.1 TransactionSynchronizationRegistry support, a marker interface
@@ -152,8 +152,8 @@
     // for managing synchronisations via the admin tools
     interface ManagedSynchronization : CosTransactions::Synchronization
     {
-	readonly attribute string implementationType;
-	readonly attribute string instanceName;
+		readonly attribute string implementationType;
+		readonly attribute string instanceName;
     };
 };
 

Added: labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/interposition/ExplicitInterpositionUnitTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/interposition/ExplicitInterpositionUnitTest.java	                        (rev 0)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/interposition/ExplicitInterpositionUnitTest.java	2010-03-07 16:46:31 UTC (rev 31981)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors 
+ * as indicated by the @author tags. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2004,
+ *
+ * Arjuna Technologies Ltd,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.  
+ *
+ * $Id: xidcheck.java 2342 2006-03-30 13:06:17Z  $
+ */
+
+package com.hp.mwtests.ts.jts.interposition;
+
+import org.junit.Test;
+
+import com.arjuna.ArjunaOTS.InterpositionFailed;
+import com.arjuna.ats.internal.jts.OTSImpleManager;
+import com.arjuna.ats.jts.ExplicitInterposition;
+import com.hp.mwtests.ts.jts.orbspecific.resources.ExplicitStackImple;
+import com.hp.mwtests.ts.jts.resources.TestBase;
+
+import static org.junit.Assert.*;
+
+public class ExplicitInterpositionUnitTest extends TestBase
+{
+    @Test
+    public void test () throws Exception
+    {
+        ExplicitStackImple stack = new ExplicitStackImple();
+        OTSImpleManager.current().begin();
+        
+        assertEquals(stack.push(10, OTSImpleManager.current().get_control()), 0);
+        
+        OTSImpleManager.current().rollback();
+        
+        OTSImpleManager.current().begin();
+        
+        ExplicitInterposition inter = new ExplicitInterposition(OTSImpleManager.current().get_control().get_coordinator().get_txcontext(), true);
+        
+        inter.unregisterTransaction();
+        
+        OTSImpleManager.current().rollback();
+    }
+}

Added: labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/orbspecific/interposition/OSIInterpositionUnitTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/orbspecific/interposition/OSIInterpositionUnitTest.java	                        (rev 0)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/orbspecific/interposition/OSIInterpositionUnitTest.java	2010-03-07 16:46:31 UTC (rev 31981)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors 
+ * as indicated by the @author tags. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2004,
+ *
+ * Arjuna Technologies Ltd,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.  
+ *
+ * $Id: xidcheck.java 2342 2006-03-30 13:06:17Z  $
+ */
+
+package com.hp.mwtests.ts.jts.orbspecific.interposition;
+
+import org.junit.Test;
+import org.omg.CosTransactions.Control;
+import org.omg.CosTransactions.PropagationContext;
+
+import com.arjuna.ats.internal.jts.OTSImpleManager;
+import com.arjuna.ats.internal.jts.interposition.resources.osi.OSIInterposition;
+import com.arjuna.ats.internal.jts.interposition.resources.osi.OSIInterpositionCreator;
+import com.arjuna.ats.internal.jts.orbspecific.ControlImple;
+import com.hp.mwtests.ts.jts.resources.TestBase;
+
+import static org.junit.Assert.*;
+
+public class OSIInterpositionUnitTest extends TestBase
+{
+    @Test
+    public void test () throws Exception
+    {
+        OTSImpleManager.current().begin();
+        
+        PropagationContext ctx = OTSImpleManager.current().get_control().get_coordinator().get_txcontext();
+        OSIInterpositionCreator creator = new OSIInterpositionCreator();
+        Control cnt = creator.recreate(ctx);
+        ControlImple impl = creator.recreateLocal(ctx);
+        
+        assertTrue(cnt != null);
+        assertTrue(impl != null);
+        
+        OTSImpleManager.current().rollback();
+    }
+}

Added: labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/orbspecific/interposition/OTIDMapUnitTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/orbspecific/interposition/OTIDMapUnitTest.java	                        (rev 0)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/orbspecific/interposition/OTIDMapUnitTest.java	2010-03-07 16:46:31 UTC (rev 31981)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors 
+ * as indicated by the @author tags. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2004,
+ *
+ * Arjuna Technologies Ltd,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.  
+ *
+ * $Id: xidcheck.java 2342 2006-03-30 13:06:17Z  $
+ */
+
+package com.hp.mwtests.ts.jts.orbspecific.interposition;
+
+import org.junit.Test;
+import org.omg.CosTransactions.PropagationContext;
+import org.omg.CosTransactions.otid_t;
+
+import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.ats.internal.jts.OTSImpleManager;
+import com.arjuna.ats.internal.jts.interposition.resources.osi.OTIDMap;
+import com.hp.mwtests.ts.jts.resources.TestBase;
+
+import static org.junit.Assert.*;
+
+public class OTIDMapUnitTest extends TestBase
+{
+    @Test
+    public void test () throws Exception
+    {
+        OTSImpleManager.current().begin();
+        
+        PropagationContext ctx = OTSImpleManager.current().get_control().get_coordinator().get_txcontext();
+        otid_t tid = ctx.current.otid;
+        
+        assertTrue(OTIDMap.find(tid).notEquals(Uid.nullUid()));
+        assertTrue(OTIDMap.remove(OTIDMap.find(tid)));
+        
+        OTSImpleManager.current().rollback();
+    }
+}

Added: labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/recovery/ExpiredContactUnitTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/recovery/ExpiredContactUnitTest.java	                        (rev 0)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/recovery/ExpiredContactUnitTest.java	2010-03-07 16:46:31 UTC (rev 31981)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors 
+ * as indicated by the @author tags. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2004,
+ *
+ * Arjuna Technologies Ltd,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.  
+ *
+ * $Id: xidcheck.java 2342 2006-03-30 13:06:17Z  $
+ */
+
+package com.hp.mwtests.ts.jts.recovery;
+
+import org.junit.Test;
+
+import com.arjuna.ats.internal.jts.recovery.contact.ExpiredContactScanner;
+import com.hp.mwtests.ts.jts.resources.TestBase;
+
+import static org.junit.Assert.*;
+
+public class ExpiredContactUnitTest extends TestBase
+{
+    @Test
+    public void test () throws Exception
+    {
+        ExpiredContactScanner scanner = new ExpiredContactScanner();
+        
+        scanner.scan();
+        
+        assertTrue(scanner.toBeUsed());
+    }
+}

Added: labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/recovery/RecoveryContactUnitTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/recovery/RecoveryContactUnitTest.java	                        (rev 0)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/recovery/RecoveryContactUnitTest.java	2010-03-07 16:46:31 UTC (rev 31981)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors 
+ * as indicated by the @author tags. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2004,
+ *
+ * Arjuna Technologies Ltd,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.  
+ *
+ * $Id: xidcheck.java 2342 2006-03-30 13:06:17Z  $
+ */
+
+package com.hp.mwtests.ts.jts.recovery;
+
+import org.junit.Test;
+
+import com.arjuna.ats.internal.jts.OTSImpleManager;
+import com.arjuna.ats.internal.jts.recovery.contact.RecoveryContactWriter;
+import com.hp.mwtests.ts.jts.resources.TestBase;
+
+import static org.junit.Assert.*;
+
+public class RecoveryContactUnitTest extends TestBase
+{
+    @Test
+    public void test () throws Exception
+    {
+        RecoveryContactWriter writer = new RecoveryContactWriter();
+        OTSImpleManager.current().begin();
+        
+        writer.connected(OTSImpleManager.get_factory());
+        
+        writer.disconnected(null);
+        
+        assertTrue(writer.name() != null);
+        
+        OTSImpleManager.current().rollback();
+    }
+}

Added: labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/utils/OTSManagerUnitTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/utils/OTSManagerUnitTest.java	                        (rev 0)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/utils/OTSManagerUnitTest.java	2010-03-07 16:46:31 UTC (rev 31981)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors 
+ * as indicated by the @author tags. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2004,
+ *
+ * Arjuna Technologies Ltd,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.  
+ *
+ * $Id: xidcheck.java 2342 2006-03-30 13:06:17Z  $
+ */
+
+package com.hp.mwtests.ts.jts.utils;
+
+import org.junit.Test;
+
+import com.arjuna.ats.internal.jts.OTSImpleManager;
+import com.arjuna.ats.jts.OTSManager;
+import com.hp.mwtests.ts.jts.resources.TestBase;
+
+import static org.junit.Assert.*;
+
+public class OTSManagerUnitTest extends TestBase
+{
+    @Test
+    public void test () throws Exception
+    {
+        assertTrue(OTSManager.factory() != null);
+        assertTrue(OTSManager.get_factory() != null);      
+        
+        OTSImpleManager.current().begin();
+        
+        OTSManager.destroyControl(OTSImpleManager.current().get_control());
+        
+        OTSImpleManager.current().suspend();
+        
+        OTSImpleManager.current().begin();
+        
+        OTSManager.destroyControl(OTSImpleManager.current().suspendWrapper().getImple());
+        
+        OTSManager.setLocalSlotId(1234);
+        
+        assertEquals(OTSManager.getLocalSlotId(), 1234);
+        
+        OTSManager.setReceivedSlotId(5678);
+        
+        assertEquals(OTSManager.getReceivedSlotId(), 5678);
+        
+        OTSManager.setORB(null);
+        OTSManager.setPOA(null);
+    }
+}



More information about the jboss-svn-commits mailing list