[jboss-svn-commits] JBL Code SVN: r38293 - in labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTS/jtax: tests/classes and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Mar 1 07:24:41 EST 2013


Author: tomjenkinson
Date: 2013-03-01 07:24:41 -0500 (Fri, 01 Mar 2013)
New Revision: 38293

Modified:
   labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTS/jtax/build.xml
   labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTS/jtax/tests/classes/WedgedResourceDemonstrator.java
Log:
JBTM-1481 Updated to return a failure when prepare fails

Modified: labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTS/jtax/build.xml
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTS/jtax/build.xml	2013-03-01 11:56:07 UTC (rev 38292)
+++ labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTS/jtax/build.xml	2013-03-01 12:24:41 UTC (rev 38293)
@@ -205,6 +205,7 @@
                     <fileset dir="${com.hp.mwlabs.ts.jtax.tests.src}">
                         <include  name="**/LastResource*TestCase.java"/>
                         <include  name="**/SubordinateTestCase.java"/>
+                        <include  name="**/WedgedResourceDemonstrator.java"/>
                     </fileset>
 	        </batchtest>
 	    </junit>

Modified: labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTS/jtax/tests/classes/WedgedResourceDemonstrator.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTS/jtax/tests/classes/WedgedResourceDemonstrator.java	2013-03-01 11:56:07 UTC (rev 38292)
+++ labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTS/jtax/tests/classes/WedgedResourceDemonstrator.java	2013-03-01 12:24:41 UTC (rev 38293)
@@ -19,6 +19,7 @@
  * @author JBoss Inc.
  */
 
+
 import javax.transaction.HeuristicMixedException;
 import javax.transaction.HeuristicRollbackException;
 import javax.transaction.NotSupportedException;
@@ -31,14 +32,16 @@
 import org.omg.CORBA.SystemException;
 import org.omg.CORBA.ORBPackage.InvalidName;
 
+import junit.framework.TestCase;
+
 import com.arjuna.ats.arjuna.recovery.RecoveryManager;
 import com.arjuna.orbportability.OA;
 import com.arjuna.orbportability.ORB;
 import com.arjuna.orbportability.RootOA;
 
-public class WedgedResourceDemonstrator {
+public class WedgedResourceDemonstrator extends TestCase {
 
-	public static void main(String[] args) throws InvalidName, SystemException,
+	public void testWedge() throws InvalidName, SystemException,
 			NotSupportedException, javax.transaction.SystemException,
 			IllegalStateException, RollbackException, SecurityException,
 			HeuristicMixedException, HeuristicRollbackException,
@@ -49,7 +52,7 @@
 			ORB myORB = ORB.getInstance("test");
 			RootOA myOA = OA.getRootOA(myORB);
 
-			myORB.initORB(args, null);
+			myORB.initORB(new String[0], null);
 			myOA.initOA();
 
 			com.arjuna.ats.internal.jts.ORBManager.setORB(myORB);
@@ -70,7 +73,7 @@
 
 		try {
 			transactionManager.commit();
-			throw new RuntimeException("Should not have been able to commit");
+			fail("Should not have been able to commit");
 		} catch (RollbackException e) {
 			// This is fine
 		} finally {
@@ -95,7 +98,8 @@
 					// just so the app will be able to clean up
 					this.wait(7000);
 				} catch (InterruptedException e) {
-					throw new NullPointerException("Interrupted, simulating jacorb");
+					throw new NullPointerException(
+							"Interrupted, simulating jacorb");
 				}
 			}
 		}



More information about the jboss-svn-commits mailing list