river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter_firmst...@apache.org
Subject svn commit: r1468119 [1/15] - in /river/jtsk/skunk/qa_refactor/trunk: qa/src/com/sun/jini/qa/harness/ qa/src/com/sun/jini/test/impl/mahalo/ qa/src/com/sun/jini/test/resources/ qa/src/com/sun/jini/test/share/ qa/src/com/sun/jini/test/spec/javaspace/conf...
Date Mon, 15 Apr 2013 15:26:46 GMT
Author: peter_firmstone
Date: Mon Apr 15 15:26:44 2013
New Revision: 1468119

URL: http://svn.apache.org/r1468119
Log:
Fixing race conditions, such as unsynchronized shared access to fields and threads started in constructors.

Modified:
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/ActivationSystemAdmin.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/HeartOfTheMachine.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/MasterHarness.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/NonActivatableGroupAdmin.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/Pipe.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/Resolver.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/SlaveHarness.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/PrepareAndCommitExceptionTest.td
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/PrepareAndCommitExceptionTest2.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/PrepareAndCommitExceptionTest2.td
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/RandomStressTest.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/resources/qa1.logging
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/TestParticipantImpl.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/TxnManagerTest.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/JavaSpaceTest.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/javaspace.properties
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/txnmanager/AsynchAbortOnCommitTest.java
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/txnmanager/CommitThread.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/collection/WeakTable.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mahalo/AbortJob.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mahalo/AbortRecord.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mahalo/CommitJob.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mahalo/CommitRecord.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mahalo/Job.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mahalo/JoinStateManager.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mahalo/LeaseExpirationMgr.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mahalo/ParticipantHandle.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mahalo/ParticipantModRecord.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mahalo/ParticipantTask.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mahalo/PrepareAndCommitJob.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mahalo/PrepareJob.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mahalo/SettlerTask.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mahalo/StorableObject.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mahalo/TxnManagerImpl.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mahalo/TxnManagerImplInitializer.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mahalo/TxnManagerTransaction.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/mercury/MailboxImpl.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/outrigger/EventRegistrationWatcher.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/outrigger/OutriggerServerImpl.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/outrigger/StorableEventWatcher.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/outrigger/TxnMonitor.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/outrigger/TypeTree.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/thread/RetryTask.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/thread/TaskManager.java
    river/jtsk/skunk/qa_refactor/trunk/src/com/sun/jini/thread/WakeupManager.java
    river/jtsk/skunk/qa_refactor/trunk/src/net/jini/lookup/JoinManager.java
    river/jtsk/skunk/qa_refactor/trunk/src/org/apache/river/api/security/URIGrant.java

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/ActivationSystemAdmin.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/ActivationSystemAdmin.java?rev=1468119&r1=1468118&r2=1468119&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/ActivationSystemAdmin.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/ActivationSystemAdmin.java Mon Apr 15 15:26:44 2013
@@ -254,11 +254,13 @@ public class ActivationSystemAdmin 
 			       System.out,
 			       null, 
 			       new ActSysAnnotator("ActSys-out: "));
+            outPipe.start();
 	    errPipe = new Pipe("activation system-err", 
 			       actProcess.getErrorStream(),
 			       System.out,
 			       null,
 			       new ActSysAnnotator("ActSys-err: "));
+            errPipe.start();
 	} catch (IOException e) {
 	    throw new TestException("ActivationSystemAdmin: Failed to exec "
 				  + "the activation system", e);

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/HeartOfTheMachine.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/HeartOfTheMachine.java?rev=1468119&r1=1468118&r2=1468119&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/HeartOfTheMachine.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/HeartOfTheMachine.java Mon Apr 15 15:26:44 2013
@@ -76,6 +76,8 @@ public class HeartOfTheMachine
         } catch( Throwable t ) {
             //System.out.println("Heart NOT started");
             Logger.getLogger("com.sun.jini.qa.harness").severe("Heart NOT started");
+            if (t instanceof Error) throw (Error) t;
+            if (t instanceof RuntimeException) throw (RuntimeException) t;
         }
     }
 

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/MasterHarness.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/MasterHarness.java?rev=1468119&r1=1468118&r2=1468119&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/MasterHarness.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/MasterHarness.java Mon Apr 15 15:26:44 2013
@@ -1051,8 +1051,10 @@ class MasterHarness {
 	TestResultFilter f = new TestResultFilter();
         outPipe = 
 	    new Pipe("test-out", proc.getInputStream(), stream, null, null);
+        outPipe.start();
 	errPipe = 
 	    new Pipe("test-err", proc.getErrorStream(), stream, f, null);
+        errPipe.start();
 	return f;
     }
 

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/NonActivatableGroupAdmin.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/NonActivatableGroupAdmin.java?rev=1468119&r1=1468118&r2=1468119&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/NonActivatableGroupAdmin.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/NonActivatableGroupAdmin.java Mon Apr 15 15:26:44 2013
@@ -163,6 +163,7 @@ public class NonActivatableGroupAdmin ex
 			       System.out,
 			       null, //filter
 			       new NonActGrpAnnotator("NonActGrp-out: "));
+            outPipe.start();
 	    ObjectInputStream proxyStream = 
 		new ObjectInputStream(process.getErrorStream());
 	    proxy = (NonActivatableGroup)

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/Pipe.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/Pipe.java?rev=1468119&r1=1468118&r2=1468119&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/Pipe.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/Pipe.java Mon Apr 15 15:26:44 2013
@@ -42,25 +42,25 @@ class Pipe implements Runnable {
     private final static String SEPARATOR = "\n";
 
     /** most recent input bytes for comparison with lineSeparator.*/
-    private byte[] lastBytes = new byte[SEPARATOR.length()];
+    private final byte[] lastBytes = new byte[SEPARATOR.length()];
     
     /** output line buffer */
-    private ByteArrayOutputStream bufOut = new ByteArrayOutputStream();;
+    private final ByteArrayOutputStream bufOut = new ByteArrayOutputStream();;
 
     /** the input stream */
-    private InputStream in;
+    private final InputStream in;
 
     /** the output PrintStream */
-    private PrintStream stream;
+    private volatile PrintStream stream;
 
     /** the input data filter */
-    private Filter filter;
+    private final Filter filter;
 
     /** the output stream annotator */
-    private Annotator annotator;
+    private final Annotator annotator;
 
     /** the thread to process the data */
-    private Thread outThread;
+    private final Thread outThread;
     
     /**
      * Create a new Pipe object and start the thread to handle the data.
@@ -83,7 +83,11 @@ class Pipe implements Runnable {
 	this.annotator = a;
 	outThread = new Thread(this, name);
 	outThread.setDaemon(true);
-	outThread.start();
+	//outThread.start();
+    }
+    
+    void start(){
+        outThread.start();
     }
 
     /**

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/Resolver.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/Resolver.java?rev=1468119&r1=1468118&r2=1468119&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/Resolver.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/Resolver.java Mon Apr 15 15:26:44 2013
@@ -54,9 +54,9 @@ import java.util.logging.Logger;
  */
 class Resolver implements Serializable {
 
-    private static Logger logger = Logger.getLogger("com.sun.jini.qa.harness");
-    private QAConfig config;
-    private HashMap tokenMap = new HashMap();
+    private final static Logger logger = Logger.getLogger("com.sun.jini.qa.harness");
+    private final QAConfig config;
+    private final HashMap tokenMap = new HashMap();
 
     /** 
      * Construct an instance of a <code>Resolver</code>.

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/SlaveHarness.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/SlaveHarness.java?rev=1468119&r1=1468118&r2=1468119&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/SlaveHarness.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/qa/harness/SlaveHarness.java Mon Apr 15 15:26:44 2013
@@ -195,6 +195,7 @@ class SlaveHarness {
 				      System.out,
 				      null,
 				      null);
+                slave.pipe.start();
 		return;
 	    } catch (ConnectException ignore) {
 	    } catch (IOException e) {
@@ -633,11 +634,11 @@ class SlaveHarness {
 		 proc.getInputStream(),
 		 System.out, 
 		 null,
-		 null);
+		 null).start();
 	new Pipe("slaveharness-err", 
 		 proc.getErrorStream(),
 		 System.out,
 		 null,
-		 null);
+		 null).start();
     }
 }

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/PrepareAndCommitExceptionTest.td
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/PrepareAndCommitExceptionTest.td?rev=1468119&r1=1468118&r2=1468119&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/PrepareAndCommitExceptionTest.td (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/PrepareAndCommitExceptionTest.td Mon Apr 15 15:26:44 2013
@@ -1,3 +1,3 @@
-include0=mahalo.properties
-testClass=PrepareAndCommitExceptionTest
-testCategories=txnmanager,txnmanager_impl
+include0=mahalo.properties
+testClass=PrepareAndCommitExceptionTest
+testCategories=txnmanager,txnmanager_impl

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/PrepareAndCommitExceptionTest2.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/PrepareAndCommitExceptionTest2.java?rev=1468119&r1=1468118&r2=1468119&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/PrepareAndCommitExceptionTest2.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/PrepareAndCommitExceptionTest2.java Mon Apr 15 15:26:44 2013
@@ -1,104 +1,104 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.jini.test.impl.mahalo;
-
-import java.util.logging.Level;
-import com.sun.jini.mahalo.*;
-import net.jini.core.lease.*;
-import net.jini.core.transaction.*;
-import net.jini.core.transaction.server.*;
-import java.io.*;
-import java.rmi.*;
-
-// Test harness specific classes
-import com.sun.jini.qa.harness.TestException;
-
-// Shared classes
-import com.sun.jini.test.share.TxnManagerTest;
-import com.sun.jini.test.share.TxnTestUtils;
-import com.sun.jini.test.share.TestParticipant;
-import com.sun.jini.test.share.TestParticipantImpl;
-
-/*
- * Test intended to exercise new prepareAndCommit semantics.
- * - Create single test participant that joins transaction
- * - then throws RemoteException on prepareAndCommit (PAC) call
- * - then eventually throws UnknownTransactionException on PAC call
- * - Test verifies that RemoteException is thrown from commit call 
- *   (with timeout greater than sleep for "clearer" thread)
- */
-public class PrepareAndCommitExceptionTest2 extends TxnManagerTest {
-
-      class Clearer implements Runnable {
-         TestParticipant part;
-         Clearer(TestParticipant part) {
-             this.part = part;
-         }
- 
-         public void run() {
-            try {
-                Thread.sleep(10000);
-            } catch (Exception e) {
-                logger.log(Level.INFO, "Caught sleep exception -- ignoring: " + e);                                    
-            }
-            try {
-                part.clearBehavior(EXCEPTION_REMOTE);
-            } catch (RemoteException re) {
-                logger.log(Level.INFO, "Caught clear exception -- ignoring: " + re);                                    
-            }
-         }
-     }  
-      
-     public void run() throws Exception {
-        TransactionManager mgr = null;
-        Transaction.Created cr = null;
-        TestParticipant part = null;
-
-        startTxnMgr();
-
-        part = new TestParticipantImpl();
-
-        mgr = manager();
-
-        logger.log(Level.INFO, "PrepareAndCommitExceptionTest2: run: mgr = " + mgr);
-        cr = TransactionFactory.create(mgr, Lease.FOREVER);
-        logger.log(Level.INFO, "Created: cr = " + cr);        
-        part.setBehavior(OP_JOIN);
-        logger.log(Level.INFO, "Configured participant to join");        
-        part.setBehavior(OP_EXCEPTION_ON_PREPARECOMMIT);
-        logger.log(Level.INFO, "Configured participant to throw an exception");                
-        part.setBehavior(EXCEPTION_REMOTE);        
-        logger.log(Level.INFO, "Configured participant to throw RE 1st");                
-        part.setBehavior(EXCEPTION_TRANSACTION);
-        logger.log(Level.INFO, "Configured participant to throw UTE 2nd");                                
-        logger.log(Level.INFO, "Configuring participant to behave");
-        part.behave(cr.transaction);
-        Clearer clearer = new Clearer(part);
-        Thread t = new Thread(clearer);
-        logger.log(Level.INFO, "Running clearer thread");                        
-        t.start();
-        logger.log(Level.INFO, "Committing transaction");                        
-        try {
-            cr.transaction.commit(60000);
-            throw new TestException("ServerException not thrown");
-        } catch (ServerException se) {
-            logger.log(Level.INFO, "Caught expected exception: " + se);                                    
-        }
-
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.sun.jini.test.impl.mahalo;
+
+import java.util.logging.Level;
+import com.sun.jini.mahalo.*;
+import net.jini.core.lease.*;
+import net.jini.core.transaction.*;
+import net.jini.core.transaction.server.*;
+import java.io.*;
+import java.rmi.*;
+
+// Test harness specific classes
+import com.sun.jini.qa.harness.TestException;
+
+// Shared classes
+import com.sun.jini.test.share.TxnManagerTest;
+import com.sun.jini.test.share.TxnTestUtils;
+import com.sun.jini.test.share.TestParticipant;
+import com.sun.jini.test.share.TestParticipantImpl;
+
+/*
+ * Test intended to exercise new prepareAndCommit semantics.
+ * - Create single test participant that joins transaction
+ * - then throws RemoteException on prepareAndCommit (PAC) call
+ * - then eventually throws UnknownTransactionException on PAC call
+ * - Test verifies that RemoteException is thrown from commit call 
+ *   (with timeout greater than sleep for "clearer" thread)
+ */
+public class PrepareAndCommitExceptionTest2 extends TxnManagerTest {
+
+      static class Clearer implements Runnable {
+         final TestParticipant part;
+         Clearer(TestParticipant part) {
+             this.part = part;
+         }
+ 
+         public void run() {
+            try {
+                Thread.sleep(10000);
+            } catch (Exception e) {
+                logger.log(Level.INFO, "Caught sleep exception -- ignoring: " + e);                                    
+            }
+            try {
+                part.clearBehavior(EXCEPTION_REMOTE);
+            } catch (RemoteException re) {
+                logger.log(Level.INFO, "Caught clear exception -- ignoring: " + re);                                    
+            }
+         }
+     }  
+      
+     public void run() throws Exception {
+        TransactionManager mgr = null;
+        Transaction.Created cr = null;
+        TestParticipant part = null;
+
+        startTxnMgr();
+
+        part = new TestParticipantImpl();
+
+        mgr = manager();
+
+        logger.log(Level.INFO, "PrepareAndCommitExceptionTest2: run: mgr = " + mgr);
+        cr = TransactionFactory.create(mgr, Lease.FOREVER);
+        logger.log(Level.INFO, "Created: cr = " + cr);        
+        part.setBehavior(OP_JOIN);
+        logger.log(Level.INFO, "Configured participant to join");        
+        part.setBehavior(OP_EXCEPTION_ON_PREPARECOMMIT);
+        logger.log(Level.INFO, "Configured participant to throw an exception");                
+        part.setBehavior(EXCEPTION_REMOTE);        
+        logger.log(Level.INFO, "Configured participant to throw RE 1st");                
+        part.setBehavior(EXCEPTION_TRANSACTION);
+        logger.log(Level.INFO, "Configured participant to throw UTE 2nd");                                
+        logger.log(Level.INFO, "Configuring participant to behave");
+        part.behave(cr.transaction);
+        Clearer clearer = new Clearer(part);
+        Thread t = new Thread(clearer);
+        logger.log(Level.INFO, "Running clearer thread");                        
+        t.start();
+        logger.log(Level.INFO, "Committing transaction");                        
+        try {
+            cr.transaction.commit(60000); 
+            throw new TestException("ServerException not thrown");
+        } catch (ServerException se) {
+            logger.log(Level.INFO, "Caught expected exception: " + se);                                    
+        }
+
+    }
+}

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/PrepareAndCommitExceptionTest2.td
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/PrepareAndCommitExceptionTest2.td?rev=1468119&r1=1468118&r2=1468119&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/PrepareAndCommitExceptionTest2.td (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/PrepareAndCommitExceptionTest2.td Mon Apr 15 15:26:44 2013
@@ -1,3 +1,3 @@
-include0=mahalo.properties
-testClass=PrepareAndCommitExceptionTest2
-testCategories=txnmanager,txnmanager_impl
+include0=mahalo.properties
+testClass=PrepareAndCommitExceptionTest2
+testCategories=txnmanager,txnmanager_impl

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/RandomStressTest.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/RandomStressTest.java?rev=1468119&r1=1468118&r2=1468119&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/RandomStressTest.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/RandomStressTest.java Mon Apr 15 15:26:44 2013
@@ -1,254 +1,254 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.jini.test.impl.mahalo;
-
-import java.util.logging.Level;
-import com.sun.jini.mahalo.*;
-import net.jini.core.lease.*;
-import net.jini.core.transaction.*;
-import net.jini.core.transaction.server.*;
-import com.sun.jini.thread.*;
-import java.io.*;
-import java.rmi.*;
-import java.util.*;
-
-// Test harness specific classes
-import com.sun.jini.qa.harness.QAConfig;
-import com.sun.jini.qa.harness.Test;
-import com.sun.jini.qa.harness.TestException;
-import com.sun.jini.test.share.TxnManagerTest;
-
-
-/**
- * This class subjects the TransactionManager to randomly selected
- * stresses in an effor to subject it to the types of load which
- * may be encountered in a real situation.
- *
- */
-public class RandomStressTest extends TxnManagerTest {
-    private static final boolean DEBUG = false;
-
-    // RandomStressTask enumeration
-    private static final int COMMIT_STRESS = 0;
-    private static final int ABORT_STRESS = 1;
-    private static final int COMMITABORT_STRESS = 2;
-    private static final int ABORTCOMMIT_STRESS = 3;
-    private static final int COUNT_STRESS_TASK = 4;
-
-    // Default values.
-    private static final int PARTS = 20; // Number of participants
-    private static final int TASKS = 1000;
-    private static final int THREADS = 150;
-    private static final long TIMEOUT = 1000 * 15;
-    private static final long TEST_TIMEOUT = 1000 * 1800;
-    private static final long SLEEP_TIME = 1000 * 15;
-    private static final float LOAD = 1.0f;
-
-    // Values with defaults.
-    private int parts = PARTS; // Number of participants
-    private int tasks = TASKS; // Number of stress tasks
-    private int threads = THREADS;
-    private long timeout = TIMEOUT;
-    private long test_timeout = TEST_TIMEOUT;
-    private long sleep_time = SLEEP_TIME;
-
-    // Another values.
-    private TransactionManager mgr = null;
-    private TaskManager threadpool = null;
-    private WakeupManager wakeupManager = null;
-    private Random random;
-    private long seed = 0;
-
-    public Test construct(QAConfig sysConfig) throws Exception {
-        super.construct(sysConfig);
-        this.parse();
-        return this;
-    }
-
-    /**
-     * Parse our args and get values from property file for this test.
-     * <DL>
-     *
-     * <DT>-seed <var>long</var><DD> Random seed.
-     *
-     * <DT>-parts <var>int</var><DD>Maximum number of participants.
-     *
-     * <DT>-tasks <var>int</var><DD>Number of RandomStressTask.
-     *
-     * <DT>-threads <var>int</var><DD>Number of threads for RandomStressTask.
-     *
-     * <DT>-timeout <var>long</var><DD>Timeout for TaskManager.
-     *
-     * </DL>
-     */
-    public void parse() throws Exception {
-
-        // Get values from property file for this test.
-        String s = "com.sun.jini.test.impl.mahalo.RandomStressTest.";
-        seed = getConfig().getLongConfigVal(s + "seed", 
-					    System.currentTimeMillis());
-        parts = getConfig().getIntConfigVal(s + "parts", PARTS);
-        tasks = getConfig().getIntConfigVal(s + "tasks", TASKS);
-        threads = getConfig().getIntConfigVal(s + "threads", THREADS);
-        timeout = getConfig().getLongConfigVal(s + "timeout", TIMEOUT);	
-        test_timeout = getConfig().getLongConfigVal(s + "test_timeout",
-						    TEST_TIMEOUT);	
-        sleep_time = getConfig().getLongConfigVal(s + "sleep_time", SLEEP_TIME);
-    }
-
-    /**
-     * Return a random integer number.
-     */
-    private int randomInt() {
-        return Math.abs(random.nextInt());
-    }
-
-    /**
-     * Create one of RandomStressTask.
-     */
-    private RandomStressTask chooseTask() {
-        RandomStressTask result = null;
-        int numparts = (randomInt() % parts) + 1;
-
-        switch (randomInt() % COUNT_STRESS_TASK) {
-          case COMMIT_STRESS:
-            result = new CommitStressTask(threadpool, wakeupManager, mgr,
-					  numparts);
-            break;
-          case ABORT_STRESS:
-            result = new AbortStressTask(threadpool, wakeupManager, mgr,
-					 numparts);
-            break;
-          case COMMITABORT_STRESS:
-            result = new CommitAbortStressTask(threadpool, wakeupManager, mgr,
-					       numparts);
-            break;
-          case ABORTCOMMIT_STRESS:
-            result = new AbortCommitStressTask(threadpool, wakeupManager, mgr,
-					       numparts);
-            break;
-        }
-
-        if (DEBUG) {
-            logger.log(Level.INFO, 
-		       "RandomStressTest: created " + result + "with "
-		      + numparts + " participants");
-        }
-        return result;
-    }
-
-    private void markTime() {
-        logger.log(Level.INFO, "RandomStressTest: @ " + new
-                Date(System.currentTimeMillis()));
-    }
-
-    /**
-     * Let GC to work after stresses.
-     */
-    public void tearDown() {
-        super.tearDown();
-        super.fullGC(); // Aggressively frees evrything by used Runtime.gc()
-    }
-
-    public void run() throws Exception {
-        logger.log(Level.INFO, "RandomStressTest: To repeat the test, note "
-                + "down the seed");
-        logger.log(Level.INFO, "RandomStressTest: seed = " + seed);
-        logger.log(Level.INFO, "TEST NOT FINISHED UNTIL I SAY DONE");
-
-        if (DEBUG) {
-            logger.log(Level.INFO, "RandomStressTest: parts   = " + parts);
-            logger.log(Level.INFO, "RandomStressTest: tasks   = " + tasks);
-            logger.log(Level.INFO, "RandomStressTest: threads = " + threads);
-            logger.log(Level.INFO, "RandomStressTest: timeout = " + timeout);
-            logger.log(Level.INFO, "RandomStressTest: test_timeout = "
-                    + test_timeout);
-            logger.log(Level.INFO, "RandomStressTest: sleep_time   = "
-                    + sleep_time);
-        }
-        random = new Random(seed);
-        threadpool = new TaskManager(threads, timeout, LOAD);
-	wakeupManager = new WakeupManager();
-
-	startTxnMgr();
-
-	mgr = manager();
-	RandomStressTask[] alltasks = new RandomStressTask[tasks];
-	RandomStressTask task = null;
-
-            // Create, queue and remember all the tasks.
-	for (int i = 0; i < tasks; i++) {
-	    task = chooseTask();
-
-	    if (task == null) {
-		throw new TestException("error creating a RandomStressTask");
-	    }
-	    threadpool.add(task);
-	    alltasks[i] = task;
-
-	    if (DEBUG) {
-		logger.log(Level.INFO, "RandomStressTest: " + (i + 1)
-			   + " tasks created.");
-		markTime();
-	    }
-	}
-
-	// Wait for all the tasks to complete.
-	boolean allComplete = true;
-        long max_count = test_timeout / sleep_time;
-	String log_msg = "Wait about " + (sleep_time / 1000) + " sec.";
-
-	for (long j = 0; j < max_count; j++) {
-	    allComplete = true;
-
-	    for (int i = 0; i < tasks; i++) {
-		if (alltasks[i] == null) {
-		    continue;
-		}
-		boolean done = alltasks[i].complete();
-
-		if (DEBUG) {
-		    logger.log(Level.INFO, 
-			       "Task #" + i + " completed: " + done);
-		    markTime();
-		}
-
-		if (done) {
-		    alltasks[i] = null; // git along little gc
-		} else {
-		    allComplete = false;
-		}
-	    }
-
-	    if (allComplete) {
-		break;
-	    }
-	    logger.log(Level.INFO, log_msg);
-
-	    try {
-		Thread.sleep(sleep_time);
-	    } catch (InterruptedException ie) {}
-	}
-
-	if (!allComplete) {
-	    throw new TestException("Some of RandomStressTask tasks "
-				  + "not yet finished");
-	}
-	logger.log(Level.INFO, "TEST DONE");
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.sun.jini.test.impl.mahalo;
+
+import java.util.logging.Level;
+import com.sun.jini.mahalo.*;
+import net.jini.core.lease.*;
+import net.jini.core.transaction.*;
+import net.jini.core.transaction.server.*;
+import com.sun.jini.thread.*;
+import java.io.*;
+import java.rmi.*;
+import java.util.*;
+
+// Test harness specific classes
+import com.sun.jini.qa.harness.QAConfig;
+import com.sun.jini.qa.harness.Test;
+import com.sun.jini.qa.harness.TestException;
+import com.sun.jini.test.share.TxnManagerTest;
+
+
+/**
+ * This class subjects the TransactionManager to randomly selected
+ * stresses in an effor to subject it to the types of load which
+ * may be encountered in a real situation.
+ *
+ */
+public class RandomStressTest extends TxnManagerTest {
+    private static final boolean DEBUG = false;
+
+    // RandomStressTask enumeration
+    private static final int COMMIT_STRESS = 0;
+    private static final int ABORT_STRESS = 1;
+    private static final int COMMITABORT_STRESS = 2;
+    private static final int ABORTCOMMIT_STRESS = 3;
+    private static final int COUNT_STRESS_TASK = 4;
+
+    // Default values.
+    private static final int PARTS = 20; // Number of participants
+    private static final int TASKS = 1000;
+    private static final int THREADS = 150;
+    private static final long TIMEOUT = 1000 * 15;
+    private static final long TEST_TIMEOUT = 1000 * 1800;
+    private static final long SLEEP_TIME = 1000 * 15;
+    private static final float LOAD = 1.0f;
+
+    // Values with defaults.
+    private int parts = PARTS; // Number of participants
+    private int tasks = TASKS; // Number of stress tasks
+    private int threads = THREADS;
+    private long timeout = TIMEOUT;
+    private long test_timeout = TEST_TIMEOUT;
+    private long sleep_time = SLEEP_TIME;
+
+    // Another values.
+    private volatile TransactionManager mgr = null;
+    private TaskManager threadpool = null;
+    private volatile WakeupManager wakeupManager = null;
+    private volatile Random random;
+    private volatile long seed = 0;
+
+    public Test construct(QAConfig sysConfig) throws Exception {
+        super.construct(sysConfig);
+        this.parse();
+        return this;
+    }
+
+    /**
+     * Parse our args and get values from property file for this test.
+     * <DL>
+     *
+     * <DT>-seed <var>long</var><DD> Random seed.
+     *
+     * <DT>-parts <var>int</var><DD>Maximum number of participants.
+     *
+     * <DT>-tasks <var>int</var><DD>Number of RandomStressTask.
+     *
+     * <DT>-threads <var>int</var><DD>Number of threads for RandomStressTask.
+     *
+     * <DT>-timeout <var>long</var><DD>Timeout for TaskManager.
+     *
+     * </DL>
+     */
+    public void parse() throws Exception {
+
+        // Get values from property file for this test.
+        String s = "com.sun.jini.test.impl.mahalo.RandomStressTest.";
+        seed = getConfig().getLongConfigVal(s + "seed", 
+					    System.currentTimeMillis());
+        parts = getConfig().getIntConfigVal(s + "parts", PARTS);
+        tasks = getConfig().getIntConfigVal(s + "tasks", TASKS);
+        threads = getConfig().getIntConfigVal(s + "threads", THREADS);
+        timeout = getConfig().getLongConfigVal(s + "timeout", TIMEOUT);	
+        test_timeout = getConfig().getLongConfigVal(s + "test_timeout",
+						    TEST_TIMEOUT);	
+        sleep_time = getConfig().getLongConfigVal(s + "sleep_time", SLEEP_TIME);
+    }
+
+    /**
+     * Return a random integer number.
+     */
+    private int randomInt() {
+        return Math.abs(random.nextInt());
+    }
+
+    /**
+     * Create one of RandomStressTask.
+     */
+    private RandomStressTask chooseTask() {
+        RandomStressTask result = null;
+        int numparts = (randomInt() % parts) + 1;
+
+        switch (randomInt() % COUNT_STRESS_TASK) {
+          case COMMIT_STRESS:
+            result = new CommitStressTask(threadpool, wakeupManager, mgr,
+					  numparts);
+            break;
+          case ABORT_STRESS:
+            result = new AbortStressTask(threadpool, wakeupManager, mgr,
+					 numparts);
+            break;
+          case COMMITABORT_STRESS:
+            result = new CommitAbortStressTask(threadpool, wakeupManager, mgr,
+					       numparts);
+            break;
+          case ABORTCOMMIT_STRESS:
+            result = new AbortCommitStressTask(threadpool, wakeupManager, mgr,
+					       numparts);
+            break;
+        }
+
+        if (DEBUG) {
+            logger.log(Level.INFO, 
+		       "RandomStressTest: created " + result + "with "
+		      + numparts + " participants");
+        }
+        return result;
+    }
+
+    private void markTime() {
+        logger.log(Level.INFO, "RandomStressTest: @ " + new
+                Date(System.currentTimeMillis()));
+    }
+
+    /**
+     * Let GC to work after stresses.
+     */
+    public void tearDown() {
+        super.tearDown();
+        super.fullGC(); // Aggressively frees evrything by used Runtime.gc()
+    }
+
+    public void run() throws Exception {
+        logger.log(Level.INFO, "RandomStressTest: To repeat the test, note "
+                + "down the seed");
+        logger.log(Level.INFO, "RandomStressTest: seed = " + seed);
+        logger.log(Level.INFO, "TEST NOT FINISHED UNTIL I SAY DONE");
+
+        if (DEBUG) {
+            logger.log(Level.INFO, "RandomStressTest: parts   = " + parts);
+            logger.log(Level.INFO, "RandomStressTest: tasks   = " + tasks);
+            logger.log(Level.INFO, "RandomStressTest: threads = " + threads);
+            logger.log(Level.INFO, "RandomStressTest: timeout = " + timeout);
+            logger.log(Level.INFO, "RandomStressTest: test_timeout = "
+                    + test_timeout);
+            logger.log(Level.INFO, "RandomStressTest: sleep_time   = "
+                    + sleep_time);
+        }
+        random = new Random(seed);
+        threadpool = new TaskManager(threads, timeout, LOAD);
+	wakeupManager = new WakeupManager();
+
+	startTxnMgr();
+
+	mgr = manager();
+	RandomStressTask[] alltasks = new RandomStressTask[tasks];
+	RandomStressTask task = null;
+
+            // Create, queue and remember all the tasks.
+	for (int i = 0; i < tasks; i++) {
+	    task = chooseTask();
+
+	    if (task == null) {
+		throw new TestException("error creating a RandomStressTask");
+	    }
+	    threadpool.add(task);
+	    alltasks[i] = task;
+
+	    if (DEBUG) {
+		logger.log(Level.INFO, "RandomStressTest: " + (i + 1)
+			   + " tasks created.");
+		markTime();
+	    }
+	}
+
+	// Wait for all the tasks to complete.
+	boolean allComplete = true;
+        long max_count = test_timeout / sleep_time;
+	String log_msg = "Wait about " + (sleep_time / 1000) + " sec.";
+
+	for (long j = 0; j < max_count; j++) {
+	    allComplete = true;
+
+	    for (int i = 0; i < tasks; i++) {
+		if (alltasks[i] == null) {
+		    continue;
+		}
+		boolean done = alltasks[i].complete();
+
+		if (DEBUG) {
+		    logger.log(Level.INFO, 
+			       "Task #" + i + " completed: " + done);
+		    markTime();
+		}
+
+		if (done) {
+		    alltasks[i] = null; // git along little gc
+		} else {
+		    allComplete = false;
+		}
+	    }
+
+	    if (allComplete) {
+		break;
+	    }
+	    logger.log(Level.INFO, log_msg);
+
+	    try {
+		Thread.sleep(sleep_time);
+	    } catch (InterruptedException ie) {}
+	}
+
+	if (!allComplete) {
+	    throw new TestException("Some of RandomStressTask tasks "
+				  + "not yet finished");
+	}
+	logger.log(Level.INFO, "TEST DONE");
+    }
+}

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/resources/qa1.logging
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/resources/qa1.logging?rev=1468119&r1=1468118&r2=1468119&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/resources/qa1.logging (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/resources/qa1.logging Mon Apr 15 15:26:44 2013
@@ -104,159 +104,159 @@ java.util.logging.FileHandler.level = IN
 #  FINEST (lowest value) 
 
 # For Everything
-sun.rmi.level = INFO
-net.jini.level = INFO
-org.apache.river.level = INFO
-com.sun.jini.level = INFO
+sun.rmi.level = SEVERE
+net.jini.level = SEVERE
+org.apache.river.level = SEVERE
+com.sun.jini.level = SEVERE
 
 # For the LogManager
-com.sun.jini.logging.LogManager.level = INFO
+com.sun.jini.logging.LogManager.level = SEVERE
 
 # For Configuration
-net.jini.config.level = INFO
+net.jini.config.level = SEVERE
 
 # For activation
-net.jini.activation.ActivatableInvocationHandler.level = INFO
+net.jini.activation.ActivatableInvocationHandler.level = SEVERE
 
 # For JRMP
-net.jini.jrmp.JrmpExporter.level = INFO
+net.jini.jrmp.JrmpExporter.level = SEVERE
 
 # For Jini ERI
-net.jini.jeri.level = INFO
-net.jini.jeri.BasicInvocationDispatcher.level = INFO
-net.jini.jeri.BasicInvocationHandler.level = INFO
-#net.jini.jeri.BasicJeriExporter.level = INFO
-#net.jini.jeri.BasicObjectEndpoint.level = FINEST
+net.jini.jeri.level = SEVERE
+net.jini.jeri.BasicInvocationDispatcher.level = SEVERE
+net.jini.jeri.BasicInvocationHandler.level = SEVERE
+#net.jini.jeri.BasicJeriExporter.level = SEVERE
+#net.jini.jeri.BasicObjectEndpoint.level = SEVERE
 
 # For Jini ERI connection 
-#net.jini.jeri.connection.level = INFO
-#net.jini.jeri.connection.ConnectionManager.level = INFO
-#net.jini.jeri.connection.ServerConnectionManager.level = INFO
-#net.jini.jeri.connection.mux.level = INFO
+#net.jini.jeri.connection.level = SEVERE
+#net.jini.jeri.connection.ConnectionManager.level = SEVERE
+#net.jini.jeri.connection.ServerConnectionManager.level = SEVERE
+#net.jini.jeri.connection.mux.level = SEVERE
 
 # For HttpEndpoint and HttpServerEndpoint
-#net.jini.jeri.http.level = INFO
-#net.jini.jeri.http.client.level = INFO
-#net.jini.jeri.http.server.level = INFO
+#net.jini.jeri.http.level = SEVERE
+#net.jini.jeri.http.client.level = SEVERE
+#net.jini.jeri.http.server.level = SEVERE
 
 # For TcpEndpoint and TcpServerEndpoint
-#net.jini.jeri.tcp.level = INFO
-#net.jini.jeri.tcp.client.level = INFO
-#net.jini.jeri.tcp.server.level = INFO
+#net.jini.jeri.tcp.level = SEVERE
+#net.jini.jeri.tcp.client.level = SEVERE
+#net.jini.jeri.tcp.server.level = SEVERE
 
 # For SSL 
-#net.jini.jeri.ssl.level = INFO
-#net.jini.jeri.ssl.client.level = INFO
-#net.jini.jeri.ssl.server.level = INFO
-#net.jini.jeri.ssl.init.level = INFO
+#net.jini.jeri.ssl.level = SEVERE
+#net.jini.jeri.ssl.client.level = SEVERE
+#net.jini.jeri.ssl.server.level = SEVERE
+#net.jini.jeri.ssl.init.level = SEVERE
 
 # For Kerberos 
-#net.jini.jeri.kerberos.level = INFO
-#net.jini.jeri.kerberos.client.level = INFO
-#net.jini.jeri.kerberos.server.level = INFO
+#net.jini.jeri.kerberos.level = SEVERE
+#net.jini.jeri.kerberos.client.level = SEVERE
+#net.jini.jeri.kerberos.server.level = SEVERE
 
 # For IIOP 
-net.jini.iiop.IiopExporter.level = INFO
+net.jini.iiop.IiopExporter.level = SEVERE
 
 # For Preferred Classes
-net.jini.loader.level = INFO
-net.jini.loader.pref.PreferredClassLoader.level = INFO
-net.jini.loader.pref.PreferredClassLoader.preferred.level = INFO
-net.jini.loader.pref.PreferredClassLoader.exception.level = INFO
-net.jini.loader.pref.PreferredClassProvider.level = INFO
+net.jini.loader.level = SEVERE
+net.jini.loader.pref.PreferredClassLoader.level = SEVERE
+net.jini.loader.pref.PreferredClassLoader.preferred.level = SEVERE
+net.jini.loader.pref.PreferredClassLoader.exception.level = SEVERE
+net.jini.loader.pref.PreferredClassProvider.level = SEVERE
 
 # For Security: trust, integrity, policy and permission granting,
 #               proxy trust verification
-net.jini.security.level = INFO
-#net.jini.security.trust.level = INFO
-#net.jini.security.integrity.level = INFO
-net.jini.security.policy.level = INFO
+net.jini.security.level = SEVERE
+#net.jini.security.trust.level = SEVERE
+#net.jini.security.integrity.level = SEVERE
+net.jini.security.policy.level = SEVERE
 
 # For HTTPMD
-net.jini.url.httpmd.level = INFO
+net.jini.url.httpmd.level = SEVERE
 
 # For Discovery
-com.sun.jini.discovery.level = INFO
-#com.sun.jini.discovery.DiscoveryV1.level = INFO
-#com.sun.jini.discovery.DiscoveryV2.level = INFO
-#com.sun.jini.discovery.x500.level = INFO
+com.sun.jini.discovery.level = SEVERE
+#com.sun.jini.discovery.DiscoveryV1.level = SEVERE
+#com.sun.jini.discovery.DiscoveryV2.level = SEVERE
+#com.sun.jini.discovery.x500.level = SEVERE
 
 # For the Helper Utilities
-net.jini.discovery.LookupDiscovery.level = INFO
-net.jini.discovery.LookupLocatorDiscovery.level = INFO
-net.jini.lookup.JoinManager.level = INFO
-net.jini.lookup.ServiceDiscoveryManager.level = INFO
-net.jini.lease.LeaseRenewalManager.level = INFO
+net.jini.discovery.LookupDiscovery.level = SEVERE
+net.jini.discovery.LookupLocatorDiscovery.level = SEVERE
+net.jini.lookup.JoinManager.level = SEVERE
+net.jini.lookup.ServiceDiscoveryManager.level = SEVERE
+net.jini.lease.LeaseRenewalManager.level = SEVERE
 
 # For Thread Pool Utilities
-com.sun.jini.thread.RetryTask.level = INFO
-com.sun.jini.thread.WakeupManager.level = INFO
-com.sun.jini.thread.ThreadPool.level = INFO
+com.sun.jini.thread.RetryTask.level = SEVERE
+com.sun.jini.thread.WakeupManager.level = SEVERE
+com.sun.jini.thread.ThreadPool.level = SEVERE
 
 # For Starting the Services
-com.sun.jini.start.level = INFO
-#com.sun.jini.start.ClassLoaderUtil.level = INFO
-#com.sun.jini.start.proxy.level = INFO
-#com.sun.jini.start.resources.service.level = INFO
-#com.sun.jini.start.service.starter.level = INFO
-#com.sun.jini.start.sharedGroup.level = INFO
-#com.sun.jini.start.wrapper.level = INFO
+com.sun.jini.start.level = SEVERE
+#com.sun.jini.start.ClassLoaderUtil.level = SEVERE
+#com.sun.jini.start.proxy.level = SEVERE
+#com.sun.jini.start.resources.service.level = SEVERE
+#com.sun.jini.start.service.starter.level = SEVERE
+#com.sun.jini.start.sharedGroup.level = SEVERE
+#com.sun.jini.start.wrapper.level = SEVERE
 
 # For Reggie
-com.sun.jini.reggie.level = INFO
+com.sun.jini.reggie.level = SEVERE
 
 # For Mahalo
-com.sun.jini.mahalo.destroy.level = INFO
-com.sun.jini.mahalo.init.level = INFO
-com.sun.jini.mahalo.operations.level = INFO
-com.sun.jini.mahalo.participant.level = INFO
-com.sun.jini.mahalo.persistence.level = INFO
-com.sun.jini.mahalo.startup.level = INFO
-com.sun.jini.mahalo.transactions.level = INFO
+com.sun.jini.mahalo.destroy.level = SEVERE
+com.sun.jini.mahalo.init.level = SEVERE
+com.sun.jini.mahalo.operations.level = SEVERE
+com.sun.jini.mahalo.participant.level = SEVERE
+com.sun.jini.mahalo.persistence.level = SEVERE
+com.sun.jini.mahalo.startup.level = SEVERE
+com.sun.jini.mahalo.transactions.level = SEVERE
 
 # For Fiddler
-com.sun.jini.fiddler.discard.level = INFO
-com.sun.jini.fiddler.events.level = INFO
-com.sun.jini.fiddler.groups.level = INFO
-com.sun.jini.fiddler.lease.level = INFO
-com.sun.jini.fiddler.locators.level = INFO
-com.sun.jini.fiddler.persist.level = INFO
-com.sun.jini.fiddler.problem.level = INFO
-com.sun.jini.fiddler.registration.level = INFO
-com.sun.jini.fiddler.startup.level = INFO
-com.sun.jini.fiddler.tasks.level = INFO
+com.sun.jini.fiddler.discard.level = SEVERE
+com.sun.jini.fiddler.events.level = SEVERE
+com.sun.jini.fiddler.groups.level = SEVERE
+com.sun.jini.fiddler.lease.level = SEVERE
+com.sun.jini.fiddler.locators.level = SEVERE
+com.sun.jini.fiddler.persist.level = SEVERE
+com.sun.jini.fiddler.problem.level = SEVERE
+com.sun.jini.fiddler.registration.level = SEVERE
+com.sun.jini.fiddler.startup.level = SEVERE
+com.sun.jini.fiddler.tasks.level = SEVERE
 
 # For Mercury
-com.sun.jini.mercury.admin.level = INFO
-com.sun.jini.mercury.delivery.level = INFO
-com.sun.jini.mercury.expiration.level = INFO
-com.sun.jini.mercury.init.level = INFO
-com.sun.jini.mercury.lease.level = INFO
-com.sun.jini.mercury.operations.level = INFO
-com.sun.jini.mercury.persistence.level = INFO
-com.sun.jini.mercury.receive.level = INFO
-com.sun.jini.mercury.recovery.level = INFO
-com.sun.jini.mercury.startup.level = INFO
+com.sun.jini.mercury.admin.level = SEVERE
+com.sun.jini.mercury.delivery.level = SEVERE
+com.sun.jini.mercury.expiration.level = SEVERE
+com.sun.jini.mercury.init.level = SEVERE
+com.sun.jini.mercury.lease.level = SEVERE
+com.sun.jini.mercury.operations.level = SEVERE
+com.sun.jini.mercury.persistence.level = SEVERE
+com.sun.jini.mercury.receive.level = SEVERE
+com.sun.jini.mercury.recovery.level = SEVERE
+com.sun.jini.mercury.startup.level = SEVERE
 
 # For Norm
-com.sun.jini.norm.level = INFO
+com.sun.jini.norm.level = SEVERE
 
 # For Outrigger
-com.sun.jini.outrigger.entryMatching.level = INFO
-com.sun.jini.outrigger.event.level = FINEST
-com.sun.jini.outrigger.iterator.level = INFO
-com.sun.jini.outrigger.join.level = INFO
-com.sun.jini.outrigger.leases.level = FINEST
-com.sun.jini.outrigger.lifecycle.level = INFO
-com.sun.jini.outrigger.operations.level = INFO
-com.sun.jini.outrigger.store.level = INFO
-com.sun.jini.outrigger.transactions.level = INFO
+com.sun.jini.outrigger.entryMatching.level = SEVERE
+com.sun.jini.outrigger.event.level = SEVERE
+com.sun.jini.outrigger.iterator.level = SEVERE
+com.sun.jini.outrigger.join.level = SEVERE
+com.sun.jini.outrigger.leases.level = SEVERE
+com.sun.jini.outrigger.lifecycle.level = SEVERE
+com.sun.jini.outrigger.operations.level = SEVERE
+com.sun.jini.outrigger.store.level = SEVERE
+com.sun.jini.outrigger.transactions.level = SEVERE
 
 # For the Browser Client
-com.sun.jini.example.browser.level = INFO
+com.sun.jini.example.browser.level = SEVERE
 
 # For the test harness, tests, and infrastructure.
-com.sun.jini.qa.harness.test.level = INFO
-com.sun.jini.qa.harness.service.level = INFO
-com.sun.jini.qa.harness.config.level = INFO
-com.sun.jini.test.spec.jeri.mux.level = INFO
+com.sun.jini.qa.harness.test.level = SEVERE
+com.sun.jini.qa.harness.service.level = SEVERE
+com.sun.jini.qa.harness.config.level = SEVERE
+com.sun.jini.test.spec.jeri.mux.level = SEVERE

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/TestParticipantImpl.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/TestParticipantImpl.java?rev=1468119&r1=1468118&r2=1468119&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/TestParticipantImpl.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/TestParticipantImpl.java Mon Apr 15 15:26:44 2013
@@ -1,316 +1,332 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.jini.test.share;
-
-import com.sun.jini.mahalo.*;
-import net.jini.core.transaction.*;
-import net.jini.core.transaction.server.*;
-
-import com.sun.jini.qa.harness.QATestEnvironment;
-import com.sun.jini.qa.harness.QAConfig;
-
-import net.jini.config.Configuration;
-import net.jini.config.ConfigurationException;
-import net.jini.export.Exporter;
-import net.jini.export.ProxyAccessor;
-import net.jini.security.TrustVerifier;
-import net.jini.security.proxytrust.ServerProxyTrust;
-
-import com.sun.jini.proxy.BasicProxyTrustVerifier;
-
-import java.io.*;
-import java.rmi.*;
-import java.rmi.registry.*;
-import java.rmi.server.*;
-import java.util.BitSet;
-
-/**
- *
- */
-public class TestParticipantImpl
-    implements TxnManagerTestOpcodes, TransactionConstants,
-	       TransactionParticipant, TestParticipant, ProxyAccessor,
-	       ServerProxyTrust
-{
-    private String name;
-    private BitSet behavior; 
-    private final Object lock2;
-    private long crashcount;
-    private ServerTransaction str;
-    private static final long TENSECONDS = 1000 * 10;
-    private static final long THIRTYSECONDS = TENSECONDS *3;
-    private static final boolean DEBUG = true;
-    private TransactionParticipant proxy;
-
-    public TestParticipantImpl() throws RemoteException {
-	this(DEFAULT_NAME);
-    }
-
-    public TestParticipantImpl(String name) throws RemoteException {
-	this.name  = name;
-	lock2      = new Object();
-	crashcount = System.currentTimeMillis();
-	behavior   = new BitSet(OPERATION_COUNT);
-	Configuration c = QAConfig.getConfig().getConfiguration();
-	Exporter exporter = QAConfig.getDefaultExporter();
-	if (c instanceof com.sun.jini.qa.harness.QAConfiguration) {
-	    try {
-		exporter = (Exporter) c.getEntry("test",
-						 "transactionParticipantExporter",
-						 Exporter.class);
-	    } catch (ConfigurationException e) {
-		throw new RemoteException("Configuration Error", e);
-	    }
-	}
-	proxy = (TransactionParticipant)exporter.export(this);
-    }
-
-    public Object getProxy() {
-	return proxy;
-    }
-
-    public TrustVerifier getProxyVerifier() {
-	return new BasicProxyTrustVerifier(proxy);
-    }
-
-    private boolean checkBit(int bit) {
-	boolean result = false;
-
-	if (bit < 0) {
-	    throw new IllegalArgumentException(name + ": " +
-			"checkBit: bit position must be non-negative");
-	}
-
-	try {
-	    result = behavior.get(bit);
-	} catch (IndexOutOfBoundsException ioobe) {
-	    System.out.println(name + ": checkBit: " + ioobe.getMessage());
-	    ioobe.printStackTrace();
-	}
-
-	return result;
-    }
-
-    private void changeBit(int bit, boolean val) {
-
-	if (bit < 0) {
-	    throw new IllegalArgumentException(name + ": " +
-			"changeBit: bit position must be non-negative");
-	}
-
-	try {
-	    if (val) {
-		behavior.set(bit);
-	    } else {
-		behavior.clear(bit);
-	    }
-	} catch (IndexOutOfBoundsException ioobe) {
-	    System.out.println(name + ": changeBit: " + ioobe.getMessage());
-	    ioobe.printStackTrace();
-	}
-    }
-
-    public void behave(Transaction tr)
-	throws RemoteException, TransactionException {
-
-	str = (ServerTransaction) tr;
- 
-	if (checkBit(OP_JOIN)) {
-	    if (DEBUG) {
-		System.out.println(name + ": joining");
-	    }
-
-	    str.join(proxy, crashcount);
-	    if(checkBit(OP_TIMEOUT_JOIN)) {
-		if(checkBit(OP_TIMEOUT_VERYLONG)) {
-		    doTimeout(THIRTYSECONDS);
-		} else {
-		    doTimeout(TENSECONDS);
-		}
-	    }
-	}
-  
-	if (checkBit(OP_INCR_CRASHCOUNT)) {
-	    synchronized(lock2) {
-		crashcount++;
-	    }
-	}
-
-	if (checkBit(OP_JOIN_IDEMPOTENT)) {
-	    if (DEBUG) {
-		System.out.println(name + ": joining again");
-	    }
-
-	    str.join(proxy, crashcount);
-
-	    if(checkBit(OP_TIMEOUT_JOIN)) {
-		if(checkBit(OP_TIMEOUT_VERYLONG)) {
-		    doTimeout(THIRTYSECONDS);
-		} else {
-		    doTimeout(TENSECONDS);
-		}
-	    }
-	}
-    }
-
-    public void setBehavior(int how) throws RemoteException {
-	changeBit(how,true);
-    }
-
-    public void clearBehavior(int how) throws RemoteException {
-	changeBit(how,false);
-    }
-
-    public boolean getBehavior(int how) throws RemoteException {
-	return checkBit(how);
-    }
-
-    private void doException()
-	throws UnknownTransactionException, RemoteException
-    {
-	if (checkBit(EXCEPTION_REMOTE))
-	    throw new RemoteException(name + ": doException");
-
-	if (checkBit(EXCEPTION_TRANSACTION))
-	    throw new UnknownTransactionException(name + ":doException");
-    }
-
-    private void doTimeout(long millis) {
-	try {
-	    Thread.sleep(millis);
-	} catch (InterruptedException ie) {
-	    ;
-	}
-    }
-
-    public int prepare(TransactionManager mgr, long id)
-	throws UnknownTransactionException, RemoteException
-    {
-	if (DEBUG) {
-	    System.out.println(name + ": prepare");
-	}
-
-	if (checkBit(OP_TIMEOUT_PREPARE)) {
-	    if (checkBit(OP_TIMEOUT_VERYLONG)) {
-		doTimeout(THIRTYSECONDS);
-	    } else {
-		doTimeout(TENSECONDS);
-	    }
-	}
-
-	if (checkBit(OP_EXCEPTION_ON_PREPARE)) {
-	    doException();
-	}
-
-	if (checkBit(OP_VOTE_NOTCHANGED)) {
-	    return NOTCHANGED;
-	}
-
-	if (checkBit(OP_VOTE_PREPARED)) {
-	    return PREPARED;
-	}
-
-	if (checkBit(OP_VOTE_ABORTED)) {
-	    return ABORTED;
-	}
-
-	return NOTCHANGED;
-    }
-
-
-    public void commit(TransactionManager mgr, long id)
-	throws UnknownTransactionException, RemoteException
-    {
-	if (DEBUG) {
-	    System.out.println(name + ": commit");
-	}
-
-	if (checkBit(OP_TIMEOUT_COMMIT)) {
-	    if(checkBit(OP_TIMEOUT_VERYLONG)) {
-		doTimeout(THIRTYSECONDS);
-	    } else {
-		doTimeout(TENSECONDS);
-	    }
-	}
-
-	if (checkBit(OP_EXCEPTION_ON_COMMIT)) {
-	    doException();
-	}
-    }
-
-    public void abort(TransactionManager mgr, long id)
-	throws UnknownTransactionException, RemoteException
-    {
-	if (DEBUG) {
-	    System.out.println(name + ": abort");
-	}
-
-	if (checkBit(OP_TIMEOUT_ABORT)) {
-	    if (checkBit(OP_TIMEOUT_VERYLONG)) {
-		System.out.println("OP_TIMOUT_ABORT | OP_TIMEOUT_VERYLONG");
-		doTimeout(THIRTYSECONDS);
-	    } else {
-		doTimeout(TENSECONDS);
-	    }
-	}
-
-	if (checkBit(OP_EXCEPTION_ON_ABORT)) {
-	    doException();
-	}
-    }
-
-
-    public int prepareAndCommit(TransactionManager mgr, long id)
-	throws UnknownTransactionException, RemoteException
-    {
-	if (DEBUG) {
-	    System.out.println(name + ": prepareAndCommit");
-	}
-
-	if (checkBit(OP_TIMEOUT_PREPARECOMMIT)) {
-	    if (checkBit(OP_TIMEOUT_VERYLONG)) {
-		doTimeout(THIRTYSECONDS);
-	    } else {
-		doTimeout(TENSECONDS);
-	    }
-	}
-
-	if (checkBit(OP_EXCEPTION_ON_PREPARECOMMIT)) {
-	    doException();
-	}
- 
-	if (checkBit(OP_VOTE_NOTCHANGED)) {
-	    return NOTCHANGED;
-	}
- 
-	if (checkBit(OP_VOTE_PREPARED)) {
-	    return PREPARED;
-	}
- 
-	if (checkBit(OP_VOTE_ABORTED)) {
-	    return ABORTED;
-	}
-
-	return NOTCHANGED;
-    }
-
-    public static void main(String[] args) throws RemoteException {
-	TestParticipant part = new TestParticipantImpl();
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.jini.test.share;
+
+import com.sun.jini.mahalo.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import net.jini.core.transaction.*;
+import net.jini.core.transaction.server.*;
+
+import com.sun.jini.qa.harness.QATestEnvironment;
+import com.sun.jini.qa.harness.QAConfig;
+
+import net.jini.config.Configuration;
+import net.jini.config.ConfigurationException;
+import net.jini.export.Exporter;
+import net.jini.export.ProxyAccessor;
+import net.jini.security.TrustVerifier;
+import net.jini.security.proxytrust.ServerProxyTrust;
+
+import com.sun.jini.proxy.BasicProxyTrustVerifier;
+
+import java.io.*;
+import java.rmi.*;
+import java.rmi.registry.*;
+import java.rmi.server.*;
+import java.util.BitSet;
+
+/**
+ *
+ */
+public class TestParticipantImpl
+    implements TxnManagerTestOpcodes, TransactionConstants,
+	       TransactionParticipant, TestParticipant, ProxyAccessor,
+	       ServerProxyTrust
+{
+    private final String name;
+    private final BitSet behavior; 
+    private final Object lock2;
+    private volatile long crashcount; // atomic increment with lock2
+    private volatile ServerTransaction str;
+    private static final long TENSECONDS = 1000 * 10;
+    private static final long THIRTYSECONDS = TENSECONDS *3;
+    private static final boolean DEBUG = false;// Change to true for detailed transaction information
+    private volatile TransactionParticipant proxy = null;
+    private Exporter exporter;
+
+    public TestParticipantImpl() throws RemoteException {
+	this(DEFAULT_NAME);
+    }
+
+    public TestParticipantImpl(String name) throws RemoteException {
+	this.name  = name;
+	lock2      = new Object();
+	crashcount = System.currentTimeMillis();
+	behavior   = new BitSet(OPERATION_COUNT);
+	Configuration c = QAConfig.getConfig().getConfiguration();
+	exporter = QAConfig.getDefaultExporter();
+	if (c instanceof com.sun.jini.qa.harness.QAConfiguration) {
+	    try {
+		exporter = (Exporter) c.getEntry("test",
+						 "transactionParticipantExporter",
+						 Exporter.class);
+	    } catch (ConfigurationException e) {
+		throw new RemoteException("Configuration Error", e);
+	    }
+	}
+        // Can't export here without this escaping.
+    }
+
+    public Object getProxy() {
+        if (proxy != null){
+	return proxy;
+        } else {
+            synchronized (lock2){
+                if (proxy != null) return proxy; // Don't export it twice.
+                try {
+                    proxy = (TransactionParticipant)exporter.export(this);
+                    exporter = null;
+                } catch (ExportException ex) {
+                    // Nothing we can do
+    }
+            }
+        }
+        return proxy; // May be null
+    }
+
+    public TrustVerifier getProxyVerifier() {
+	return new BasicProxyTrustVerifier(getProxy());
+    }
+
+    private boolean checkBit(int bit) {
+	boolean result = false;
+
+	if (bit < 0) {
+	    throw new IllegalArgumentException(name + ": " +
+			"checkBit: bit position must be non-negative");
+	}
+
+	try {
+	    result = behavior.get(bit);
+	} catch (IndexOutOfBoundsException ioobe) {
+	    System.out.println(name + ": checkBit: " + ioobe.getMessage());
+	    ioobe.printStackTrace();
+	}
+
+	return result;
+    }
+
+    private void changeBit(int bit, boolean val) {
+
+	if (bit < 0) {
+	    throw new IllegalArgumentException(name + ": " +
+			"changeBit: bit position must be non-negative");
+	}
+
+	try {
+	    if (val) {
+		behavior.set(bit);
+	    } else {
+		behavior.clear(bit);
+	    }
+	} catch (IndexOutOfBoundsException ioobe) {
+	    System.out.println(name + ": changeBit: " + ioobe.getMessage());
+	    ioobe.printStackTrace();
+	}
+    }
+
+    public void behave(Transaction tr)
+	throws RemoteException, TransactionException {
+
+	str = (ServerTransaction) tr;
+ 
+	if (checkBit(OP_JOIN)) {
+	    if (DEBUG) {
+		System.out.println(name + ": joining");
+	    }
+
+	    str.join((TransactionParticipant) getProxy(), crashcount);
+	    if(checkBit(OP_TIMEOUT_JOIN)) {
+		if(checkBit(OP_TIMEOUT_VERYLONG)) {
+		    doTimeout(THIRTYSECONDS);
+		} else {
+		    doTimeout(TENSECONDS);
+		}
+	    }
+	}
+  
+	if (checkBit(OP_INCR_CRASHCOUNT)) {
+	    synchronized(lock2) {
+		crashcount++;
+	    }
+	}
+
+	if (checkBit(OP_JOIN_IDEMPOTENT)) {
+	    if (DEBUG) {
+		System.out.println(name + ": joining again");
+	    }
+
+	    str.join((TransactionParticipant) getProxy(), crashcount);
+
+	    if(checkBit(OP_TIMEOUT_JOIN)) {
+		if(checkBit(OP_TIMEOUT_VERYLONG)) {
+		    doTimeout(THIRTYSECONDS);
+		} else {
+		    doTimeout(TENSECONDS);
+		}
+	    }
+	}
+    }
+
+    public void setBehavior(int how) throws RemoteException {
+	changeBit(how,true);
+    }
+
+    public void clearBehavior(int how) throws RemoteException {
+	changeBit(how,false);
+    }
+
+    public boolean getBehavior(int how) throws RemoteException {
+	return checkBit(how);
+    }
+
+    private void doException()
+	throws UnknownTransactionException, RemoteException
+    {
+	if (checkBit(EXCEPTION_REMOTE))
+	    throw new RemoteException(name + ": doException");
+
+	if (checkBit(EXCEPTION_TRANSACTION))
+	    throw new UnknownTransactionException(name + ":doException");
+    }
+
+    private void doTimeout(long millis) {
+	try {
+	    Thread.sleep(millis);
+	} catch (InterruptedException ie) {
+	    ;
+	}
+    }
+
+    public int prepare(TransactionManager mgr, long id)
+	throws UnknownTransactionException, RemoteException
+    {
+	if (DEBUG) {
+	    System.out.println(name + ": prepare");
+	}
+
+	if (checkBit(OP_TIMEOUT_PREPARE)) {
+	    if (checkBit(OP_TIMEOUT_VERYLONG)) {
+		doTimeout(THIRTYSECONDS);
+	    } else {
+		doTimeout(TENSECONDS);
+	    }
+	}
+
+	if (checkBit(OP_EXCEPTION_ON_PREPARE)) {
+	    doException();
+	}
+
+	if (checkBit(OP_VOTE_NOTCHANGED)) {
+	    return NOTCHANGED;
+	}
+
+	if (checkBit(OP_VOTE_PREPARED)) {
+	    return PREPARED;
+	}
+
+	if (checkBit(OP_VOTE_ABORTED)) {
+	    return ABORTED;
+	}
+
+	return NOTCHANGED;
+    }
+
+
+    public void commit(TransactionManager mgr, long id)
+	throws UnknownTransactionException, RemoteException
+    {
+	if (DEBUG) {
+	    System.out.println(name + ": commit");
+	}
+
+	if (checkBit(OP_TIMEOUT_COMMIT)) {
+	    if(checkBit(OP_TIMEOUT_VERYLONG)) {
+		doTimeout(THIRTYSECONDS);
+	    } else {
+		doTimeout(TENSECONDS);
+	    }
+	}
+
+	if (checkBit(OP_EXCEPTION_ON_COMMIT)) {
+	    doException();
+	}
+    }
+
+    public void abort(TransactionManager mgr, long id)
+	throws UnknownTransactionException, RemoteException
+    {
+	if (DEBUG) {
+	    System.out.println(name + ": abort");
+	}
+
+	if (checkBit(OP_TIMEOUT_ABORT)) {
+	    if (checkBit(OP_TIMEOUT_VERYLONG)) {
+		System.out.println("OP_TIMOUT_ABORT | OP_TIMEOUT_VERYLONG");
+		doTimeout(THIRTYSECONDS);
+	    } else {
+		doTimeout(TENSECONDS);
+	    }
+	}
+
+	if (checkBit(OP_EXCEPTION_ON_ABORT)) {
+	    doException();
+	}
+    }
+
+
+    public int prepareAndCommit(TransactionManager mgr, long id)
+	throws UnknownTransactionException, RemoteException
+    {
+	if (DEBUG) {
+	    System.out.println(name + ": prepareAndCommit");
+	}
+
+	if (checkBit(OP_TIMEOUT_PREPARECOMMIT)) {
+	    if (checkBit(OP_TIMEOUT_VERYLONG)) {
+		doTimeout(THIRTYSECONDS);
+	    } else {
+		doTimeout(TENSECONDS);
+	    }
+	}
+
+	if (checkBit(OP_EXCEPTION_ON_PREPARECOMMIT)) {
+	    doException();
+	}
+ 
+	if (checkBit(OP_VOTE_NOTCHANGED)) {
+	    return NOTCHANGED;
+	}
+ 
+	if (checkBit(OP_VOTE_PREPARED)) {
+	    return PREPARED;
+	}
+ 
+	if (checkBit(OP_VOTE_ABORTED)) {
+	    return ABORTED;
+	}
+
+	return NOTCHANGED;
+    }
+
+    public static void main(String[] args) throws RemoteException {
+	TestParticipant part = new TestParticipantImpl();
+    }
+}

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/TxnManagerTest.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/TxnManagerTest.java?rev=1468119&r1=1468118&r2=1468119&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/TxnManagerTest.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/share/TxnManagerTest.java Mon Apr 15 15:26:44 2013
@@ -1,76 +1,80 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.sun.jini.test.share;
-
-import java.util.logging.Level;
-
-import com.sun.jini.mahalo.*;
-import net.jini.core.transaction.*;
-import net.jini.core.transaction.server.*;
-
-import net.jini.config.Configuration;
-import net.jini.config.ConfigurationException;
-import net.jini.security.ProxyPreparer;
-
-import java.io.*;
-import java.rmi.*;
-
-import com.sun.jini.qa.harness.QAConfig;
-import com.sun.jini.qa.harness.Test;
-import com.sun.jini.qa.harness.TestException;
-
-/**
- */
-public abstract class TxnManagerTest extends TestBase
-    implements TransactionConstants, TxnManagerTestOpcodes, Test
-{
-    protected static final boolean DEBUG = true;
-
-    TransactionManager[] mgrs = new TransactionManager[1];
-
-    public TransactionManager manager() throws RemoteException {
-	return (TransactionManager) mgrs[0];
-    }
-
-    protected void startTxnMgr() throws TestException {
-	specifyServices(new Class[] {TransactionManager.class}); 
-	mgrs[0]= (TransactionManager)services[0]; // prepared by specifyServices
-    }
-
-    public Test construct(QAConfig config) throws Exception {
-        super.construct(config);
-        super.parse();
-        return this;
-    }
-
-    /**
-     * This method aggressively frees evrything by used Runtime.gc().
-     */
-    final static public synchronized void fullGC() {
-	Runtime rt  = Runtime.getRuntime();
-	long isFree = rt.freeMemory();
-	long wasFree;
-	do {
-	    wasFree = isFree;
-	    rt.runFinalization();
-	    rt.gc();
-	    isFree = rt.freeMemory();
-	} while (isFree > wasFree);
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.sun.jini.test.share;
+
+import java.util.logging.Level;
+
+import com.sun.jini.mahalo.*;
+import net.jini.core.transaction.*;
+import net.jini.core.transaction.server.*;
+
+import net.jini.config.Configuration;
+import net.jini.config.ConfigurationException;
+import net.jini.security.ProxyPreparer;
+
+import java.io.*;
+import java.rmi.*;
+
+import com.sun.jini.qa.harness.QAConfig;
+import com.sun.jini.qa.harness.Test;
+import com.sun.jini.qa.harness.TestException;
+
+/**
+ */
+public abstract class TxnManagerTest extends TestBase
+    implements TransactionConstants, TxnManagerTestOpcodes, Test
+{
+    protected static final boolean DEBUG = true;
+
+    final TransactionManager[] mgrs = new TransactionManager[1];
+
+    public TransactionManager manager() throws RemoteException {
+        synchronized (mgrs){
+	return (TransactionManager) mgrs[0];
+    }
+    }
+
+    protected void startTxnMgr() throws TestException {
+	specifyServices(new Class[] {TransactionManager.class}); 
+        synchronized (mgrs){
+	mgrs[0]= (TransactionManager)services[0]; // prepared by specifyServices
+    }
+    }
+
+    public Test construct(QAConfig config) throws Exception {
+        super.construct(config);
+        super.parse();
+        return this;
+    }
+
+    /**
+     * This method aggressively frees evrything by used Runtime.gc().
+     */
+    final static public synchronized void fullGC() {
+	Runtime rt  = Runtime.getRuntime();
+	long isFree = rt.freeMemory();
+	long wasFree;
+	do {
+	    wasFree = isFree;
+	    rt.runFinalization();
+	    rt.gc();
+	    isFree = rt.freeMemory();
+	} while (isFree > wasFree);
+    }
+}

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/JavaSpaceTest.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/JavaSpaceTest.java?rev=1468119&r1=1468118&r2=1468119&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/JavaSpaceTest.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/JavaSpaceTest.java Mon Apr 15 15:26:44 2013
@@ -192,7 +192,9 @@ public abstract class JavaSpaceTest exte
             if (trc == null) {
                 throw new TestException("Null transaction has been obtained.");
             }
+            synchronized (txns){
             txns.add(trc.transaction);
+            }
             return trc.transaction;
         } catch (Exception e) {
             throw new TestException("Could not create transaction.", e);

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/javaspace.properties
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/javaspace.properties?rev=1468119&r1=1468118&r2=1468119&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/javaspace.properties (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/javaspace/conformance/javaspace.properties Mon Apr 15 15:26:44 2013
@@ -1,27 +1,27 @@
-net.jini.core.transaction.server.TransactionManager.log.0=TxnManagerImpl_log0
-net.jini.core.transaction.server.TransactionManager.log.1=TxnManagerImpl_log1
-net.jini.core.transaction.server.TransactionManager.resourcename=service
-
-com.sun.jini.test.spec.javaspace.conformance.txnManager=net.jini.core.transaction.server.TransactionManager
-
-# this value is used for waiting for notifications time
-com.sun.jini.test.spec.javaspace.conformance.waitingNotificationsTime=10000
-
-# this value is used instead of Lease.FOREVER value to avoid infinite lease times
-com.sun.jini.test.spec.javaspace.conformance.lease.forever=600000
-
-# this value is used for checking read and take invocations*
-com.sun.jini.test.spec.javaspace.conformance.checkTime=10000
-
-# timeout2 must be greater than (timeout1 + instantTime)
-# it is recommended that timeout2 be greater than (timeout1 + 2*instantTime)
-com.sun.jini.test.spec.javaspace.conformance.timeout1=24000
-com.sun.jini.test.spec.javaspace.conformance.timeout2=48000
-
-#  general round trip time expected to non-blocking operations.
-#  should be set to checkTime / 2. 
-com.sun.jini.test.spec.javaspace.conformance.instantTime = 5000
-
-# default test description values for this component
-testConfiguration=<url:com/sun/jini/test/spec/javaspace/conformance/configs/<config>/default.config>
-testCodebase=http://${HOST}:${com.sun.jini.test.port}/qa1-javaspace-dl.jar
+net.jini.core.transaction.server.TransactionManager.log.0=TxnManagerImpl_log0
+net.jini.core.transaction.server.TransactionManager.log.1=TxnManagerImpl_log1
+net.jini.core.transaction.server.TransactionManager.resourcename=service
+
+com.sun.jini.test.spec.javaspace.conformance.txnManager=net.jini.core.transaction.server.TransactionManager
+
+# this value is used for waiting for notifications time
+com.sun.jini.test.spec.javaspace.conformance.waitingNotificationsTime=10000
+
+# this value is used instead of Lease.FOREVER value to avoid infinite lease times
+com.sun.jini.test.spec.javaspace.conformance.lease.forever=600000
+
+# this value is used for checking read and take invocations*
+com.sun.jini.test.spec.javaspace.conformance.checkTime=10000
+
+# timeout2 must be greater than (timeout1 + instantTime)
+# it is recommended that timeout2 be greater than (timeout1 + 2*instantTime)
+com.sun.jini.test.spec.javaspace.conformance.timeout1=20000
+com.sun.jini.test.spec.javaspace.conformance.timeout2=40000
+
+#  general round trip time expected to non-blocking operations.
+#  should be set to checkTime / 2. 
+com.sun.jini.test.spec.javaspace.conformance.instantTime = 5000
+
+# default test description values for this component
+testConfiguration=<url:com/sun/jini/test/spec/javaspace/conformance/configs/<config>/default.config>
+testCodebase=http://${HOST}:${com.sun.jini.test.port}/qa1-javaspace-dl.jar

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/txnmanager/AsynchAbortOnCommitTest.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/txnmanager/AsynchAbortOnCommitTest.java?rev=1468119&r1=1468118&r2=1468119&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/txnmanager/AsynchAbortOnCommitTest.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/txnmanager/AsynchAbortOnCommitTest.java Mon Apr 15 15:26:44 2013
@@ -1,108 +1,108 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.sun.jini.test.spec.txnmanager;
-
-import java.util.logging.Level;
-import com.sun.jini.mahalo.*;
-import net.jini.core.lease.*;
-import net.jini.core.transaction.*;
-import net.jini.core.transaction.server.*;
-import java.io.*;
-import java.rmi.*;
-
-// Test harness specific classes
-import com.sun.jini.qa.harness.TestException;
-
-// Shared classes
-import com.sun.jini.test.share.TxnManagerTest;
-import com.sun.jini.test.share.TxnTestUtils;
-import com.sun.jini.test.share.TestParticipant;
-
-
-public class AsynchAbortOnCommitTest extends TxnManagerTest {
-    private static final int NUM_PARTICIPANTS = 10;
-    private static final long WAIT_TIME = 30000;
-
-    public void run() throws Exception {
-        TransactionManager mgr = null;
-        Transaction.Created cr = null;
-        ServerTransaction str = null;
-        TestParticipant[] parts = null;
-        int state = 0;
-
-        startTxnMgr();
-
-        logger.log(Level.INFO, 
-		   "AsynchAbortOnCommitTest: creating " + NUM_PARTICIPANTS
-                 + " participants");
-        parts = TxnTestUtils.createParticipants(NUM_PARTICIPANTS);
-
-        // Set the behavior for the specified number of participants.
-        try {
-            mgr = manager();
-
-            if (DEBUG) {
-                logger.log(Level.INFO, "AsynchAbortOnCommitTest: run: mgr = " + mgr);
-            }
-            cr = TransactionFactory.create(mgr, Lease.FOREVER);
-            str = (ServerTransaction) cr.transaction;
-            state = str.mgr.getState(str.id);
-            logger.log(Level.INFO, "AsynchAbortOnCommitTest: setting behavior for "
-                    + NUM_PARTICIPANTS + " participants");
-            TxnTestUtils.setBulkBehavior(OP_JOIN, parts);
-            TxnTestUtils.setBulkBehavior(OP_VOTE_PREPARED, parts);
-            TxnTestUtils.setBulkBehavior(OP_TIMEOUT_COMMIT, parts);
-            TxnTestUtils.setBulkBehavior(OP_TIMEOUT_VERYLONG, parts);
-            TxnTestUtils.doBulkBehavior(cr.transaction, parts);
-            Thread committer = new CommitThread(cr.transaction, WAIT_TIME);
-            committer.start();
-
-            /*
-             * Wait for the transaction to switch
-             * from VOTING to COMMITTED, then proceed to
-             * abort the transaction
-             */
-            while (true) {
-                state = str.mgr.getState(str.id);
-
-                if (DEBUG) {
-                    int st = state;
-                    logger.log(Level.INFO, "state = "
-                            + com.sun.jini.constants.TxnConstants.getName(st));
-                }
-
-                if (state == COMMITTED) {
-                    break;
-                }
-            }
-            cr.transaction.abort();
-        } catch (CannotAbortException cae) {
-
-            // Expected exception. Test passed.
-            if (DEBUG) {
-                cae.printStackTrace();
-                logger.log(Level.INFO, cae.getMessage());
-            }
-            return;
-        } catch (TransactionException bte) {
-            logger.log(Level.INFO, "AsynchAbortOnCommitTest: run: The commit "
-                    + "happened so fast, I was unable to abort");
-        }
-        throw new TestException( "CannotAbortException is not raised");
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.sun.jini.test.spec.txnmanager;
+
+import java.util.logging.Level;
+import com.sun.jini.mahalo.*;
+import net.jini.core.lease.*;
+import net.jini.core.transaction.*;
+import net.jini.core.transaction.server.*;
+import java.io.*;
+import java.rmi.*;
+
+// Test harness specific classes
+import com.sun.jini.qa.harness.TestException;
+
+// Shared classes
+import com.sun.jini.test.share.TxnManagerTest;
+import com.sun.jini.test.share.TxnTestUtils;
+import com.sun.jini.test.share.TestParticipant;
+
+
+public class AsynchAbortOnCommitTest extends TxnManagerTest {
+    private static final int NUM_PARTICIPANTS = 10;
+    private static final long WAIT_TIME = 30000;
+
+    public void run() throws Exception {
+        TransactionManager mgr = null;
+        Transaction.Created cr = null;
+        ServerTransaction str = null;
+        TestParticipant[] parts = null;
+        int state = 0;
+
+        startTxnMgr();
+
+        logger.log(Level.INFO, 
+		   "AsynchAbortOnCommitTest: creating " + NUM_PARTICIPANTS
+                 + " participants");
+        parts = TxnTestUtils.createParticipants(NUM_PARTICIPANTS);
+
+        // Set the behavior for the specified number of participants.
+        try {
+            mgr = manager();
+
+            if (DEBUG) {
+                logger.log(Level.INFO, "AsynchAbortOnCommitTest: run: mgr = " + mgr);
+            }
+            cr = TransactionFactory.create(mgr, Lease.FOREVER);
+            str = (ServerTransaction) cr.transaction;
+            state = str.mgr.getState(str.id);
+            logger.log(Level.INFO, "AsynchAbortOnCommitTest: setting behavior for "
+                    + NUM_PARTICIPANTS + " participants");
+            TxnTestUtils.setBulkBehavior(OP_JOIN, parts);
+            TxnTestUtils.setBulkBehavior(OP_VOTE_PREPARED, parts);
+            TxnTestUtils.setBulkBehavior(OP_TIMEOUT_COMMIT, parts);
+            TxnTestUtils.setBulkBehavior(OP_TIMEOUT_VERYLONG, parts);
+            TxnTestUtils.doBulkBehavior(cr.transaction, parts);
+            Thread committer = new CommitThread(cr.transaction, WAIT_TIME);
+            committer.start();
+
+            /*
+             * Wait for the transaction to switch
+             * from VOTING to COMMITTED, then proceed to
+             * abort the transaction
+             */
+            while (true) {
+                state = str.mgr.getState(str.id);
+
+//                if (DEBUG) {
+//                    int st = state;
+//                    logger.log(Level.FINEST, "state = "
+//                            + com.sun.jini.constants.TxnConstants.getName(st));
+//                }
+
+                if (state == COMMITTED) {
+                    break;
+                }
+            }
+            cr.transaction.abort();
+        } catch (CannotAbortException cae) {
+
+            // Expected exception. Test passed.
+            if (DEBUG) {
+                cae.printStackTrace();
+                logger.log(Level.INFO, cae.getMessage());
+            }
+            return;
+        } catch (TransactionException bte) {
+            logger.log(Level.INFO, "AsynchAbortOnCommitTest: run: The commit "
+                    + "happened so fast, I was unable to abort");
+        }
+        throw new TestException( "CannotAbortException is not raised");
+    }
+}



Mime
View raw message