Author: pats Date: Wed Oct 20 21:19:27 2010 New Revision: 1025760 URL: http://svn.apache.org/viewvc?rev=1025760&view=rev Log: RIVER-361: Tidy up GetStateTest. Set a ten minute limit on final spin loop, require the aborted transaction to stay aborted, and specifically require the UnknownTransactionException.
Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/txnmanager/GetStateTest.java Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/txnmanager/GetStateTest.java URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/txnmanager/GetStateTest.java?rev=1025760&r1=1025759&r2=1025760&view=diff ============================================================================== --- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/txnmanager/GetStateTest.java (original) +++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/txnmanager/GetStateTest.java Wed Oct 20 21:19:27 2010 @@ -193,14 +193,18 @@ public class GetStateTest extends TxnMan // things happened too quickly so transaction now gone } + long timeout = System.currentTimeMillis() + 10 * 60 * 1000; try { - while (true) { + while (System.currentTimeMillis() < timeout) { state = str.mgr.getState(str.id); + if(state != ABORTED) { + throw new TestException("Non-aborted state after abort call"); + } } - } catch (TransactionException bte) { + } catch (UnknownTransactionException bte) { // Expected exception. Second test passed. return; } catch (RemoteException re) {} - throw new TestException( "TransactionException is not raised"); + throw new TestException( "UnknownTransactionException is not raised"); } }