[jboss-svn-commits] JBL Code SVN: r38292 - labs/jbosstm/branches/JBOSSTS_4_16/ArjunaJTS/jtax/tests/classes.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Mar 1 06:56:07 EST 2013


Author: tomjenkinson
Date: 2013-03-01 06:56:07 -0500 (Fri, 01 Mar 2013)
New Revision: 38292

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

Modified: labs/jbosstm/branches/JBOSSTS_4_16/ArjunaJTS/jtax/tests/classes/WedgedResourceDemonstrator.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_16/ArjunaJTS/jtax/tests/classes/WedgedResourceDemonstrator.java	2013-03-01 11:41:39 UTC (rev 38291)
+++ labs/jbosstm/branches/JBOSSTS_4_16/ArjunaJTS/jtax/tests/classes/WedgedResourceDemonstrator.java	2013-03-01 11:56:07 UTC (rev 38292)
@@ -19,6 +19,8 @@
  * @author JBoss Inc.
  */
 
+import static org.junit.Assert.fail;
+
 import javax.transaction.HeuristicMixedException;
 import javax.transaction.HeuristicRollbackException;
 import javax.transaction.NotSupportedException;
@@ -28,6 +30,7 @@
 import javax.transaction.xa.XAResource;
 import javax.transaction.xa.Xid;
 
+import org.junit.Test;
 import org.omg.CORBA.SystemException;
 import org.omg.CORBA.ORBPackage.InvalidName;
 
@@ -38,7 +41,8 @@
 
 public class WedgedResourceDemonstrator {
 
-	public static void main(String[] args) throws InvalidName, SystemException,
+	@Test
+	public void testWedge() throws InvalidName, SystemException,
 			NotSupportedException, javax.transaction.SystemException,
 			IllegalStateException, RollbackException, SecurityException,
 			HeuristicMixedException, HeuristicRollbackException,
@@ -49,7 +53,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 +74,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 +99,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