river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter_firmst...@apache.org
Subject svn commit: r1634322 [17/41] - in /river/jtsk/skunk/qa_refactor/trunk: qa/src/com/sun/jini/qa/harness/ qa/src/com/sun/jini/test/impl/end2end/e2etest/ qa/src/com/sun/jini/test/impl/joinmanager/ qa/src/com/sun/jini/test/impl/mahalo/ qa/src/com/sun/jini/t...
Date Sun, 26 Oct 2014 13:17:31 GMT
Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/LookupTaskServiceIdMapRace.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/LookupTaskServiceIdMapRace.java?rev=1634322&r1=1634321&r2=1634322&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/LookupTaskServiceIdMapRace.java
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/LookupTaskServiceIdMapRace.java
Sun Oct 26 13:17:28 2014
@@ -189,7 +189,7 @@ public class LookupTaskServiceIdMapRace 
     private static final int N_SERVICES = 2*125; //2*125;//always even
     private static final int MAX_N_SECS = 2*240;
 
-    private static boolean inShutdown   = false;
+    private static volatile boolean inShutdown = false;
 
     protected int testServiceType  = AbstractBaseTest.TEST_SERVICE;
     protected int nAddedExpected   = N_SERVICES;
@@ -199,27 +199,31 @@ public class LookupTaskServiceIdMapRace 
     protected LookupDiscoveryManager ldm;
 
     public static class SDMListener extends AbstractBaseTest.SrvcListener {
-        String sdmName;
+        final String sdmName;
         public SDMListener(QAConfig config, String sdmName) {
             super(config,"");
             this.sdmName = sdmName;
         }//end constructor
 
+        @Override
 	public void serviceAdded(ServiceDiscoveryEvent event) {
             super.serviceAdded(event);
             if(!inShutdown) {
-                logger.log(Level.FINER, "added event -- "
-                           +event.getPostEventServiceItem().serviceID+" -- "
-                           +sdmName+" (nAdded = "+this.getNAdded()+")");
+                logger.log(Level.FINER, 
+                        "added event -- {0} -- {1} (nAdded = {2})",
+                        new Object[]{event.getPostEventServiceItem().serviceID,
+                            sdmName, this.getNAdded()});
             }//endif
 	}//end serviceAdded
 
+        @Override
 	public void serviceRemoved(ServiceDiscoveryEvent event) {
             super.serviceRemoved(event);
             if(!inShutdown) {
-                logger.log(Level.FINER, "removed event -- "
-                          +event.getPreEventServiceItem().serviceID+" -- "
-                          +sdmName+" (nRemoved = "+this.getNRemoved()+")");
+                logger.log(Level.FINER,
+                        "removed event -- {0} -- {1} (nRemoved = {2})",
+                        new Object[]{event.getPreEventServiceItem().serviceID,
+                            sdmName, this.getNRemoved()});
             }//endif
 	}//end serviceAdded
     }//end class SDMListener
@@ -276,7 +280,7 @@ public class LookupTaskServiceIdMapRace 
         registerServices(startVal, nSrvcs, nAttrs, testServiceType);
 
         /* 2. Create half the SDM's and caches */
-        for (int i=0; i<(N_SDM/2); i++) {
+        for (int i=0, n = (N_SDM/2); i<n; i++) {
             ServiceDiscoveryManager sdm = new ServiceDiscoveryManager
                                       (ldm,null,testConfig.getConfiguration());
             sdmList.add(sdm);
@@ -305,7 +309,7 @@ public class LookupTaskServiceIdMapRace 
         boolean done = false;
         while( (nSecsTotal < MAX_N_SECS) && !done ) {
             done = true;
-            for(int i=0;i<sdmListeners.size();i++) {
+            for(int i=0, n = sdmListeners.size();i<n;i++) {
                 SDMListener l = (SDMListener)sdmListeners.get(i);
                 if( l.getNAdded() != nAddedExpected ) {
                     done = false;
@@ -324,8 +328,8 @@ public class LookupTaskServiceIdMapRace 
             SDMListener l = (SDMListener)sdmListeners.get(i);
             int nAddedThisSDM = l.getNAdded();
             logger.log(Levels.HANDLED,
-                       ""+nAddedThisSDM+" added events -- "
-                       +N_SERVICES+" services -- SDM_"+i);
+                    "{0} added events -- {1} services -- SDM_{2}", 
+                    new Object[]{nAddedThisSDM, N_SERVICES, i});
             if(nAddedThisSDM != nAddedExpected) nWithWrongAdded++;
         }//end loop
 
@@ -335,8 +339,8 @@ public class LookupTaskServiceIdMapRace 
             SDMListener l = (SDMListener)sdmListeners.get(i);
             int nRemovedThisSDM = l.getNRemoved();
             logger.log(Levels.HANDLED,
-                       ""+nRemovedThisSDM+" removed events -- "
-                       +"SDM_"+i);
+                       "{0} removed events -- SDM_{1}",
+                       new Object[]{nRemovedThisSDM, i});
             if(nRemovedThisSDM > 0) nWithWrongRemoved++;
         }//end loop
 
@@ -345,22 +349,22 @@ public class LookupTaskServiceIdMapRace 
         /* 8. Determine if/how failure has occurred */
         String failStr = null;
         if( (nWithWrongAdded > 0) && (nWithWrongRemoved > 0) ) {
-            failStr = new String(" -- failure -- "+nWithWrongAdded
-                                 +" SDMs with wrong number of added "
-                                 +"events, "+nWithWrongRemoved+" SDMs with "
-                                 +"wrong number of removed events");
+            failStr = " -- failure -- "+nWithWrongAdded
+                    +" SDMs with wrong number of added "
+                    +"events, "+nWithWrongRemoved+" SDMs with "
+                    +"wrong number of removed events";
         } else if(nWithWrongAdded > 0) {
-            failStr = new String(" -- failure -- "+nWithWrongAdded
-                                 +" SDMs with wrong number of added "
-                                 +"events, (removed events OKAY) ");
+            failStr = " -- failure -- "+nWithWrongAdded
+                    +" SDMs with wrong number of added "
+                    +"events, (removed events OKAY) ";
         } else if(nWithWrongRemoved > 0) {
-            failStr = new String(" -- failure -- "+nWithWrongRemoved
-                                 +" SDMs with wrong number of removed "
-                                 +"event, (added events OKAY) ");
+            failStr = " -- failure -- "+nWithWrongRemoved
+                    +" SDMs with wrong number of removed "
+                    +"event, (added events OKAY) ";
         }//endif
 
         /* Turn off events from the lookup service before exiting */
-        for(int i=0; i<caches.size(); i++) {
+        for(int i=0, n = caches.size(); i<n; i++) {
             try {
                 ((LookupCache)caches.get(i)).terminate();
             } catch(Exception e) {

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/NotifyEventDropProxyTaskRace.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/NotifyEventDropProxyTaskRace.java?rev=1634322&r1=1634321&r2=1634322&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/NotifyEventDropProxyTaskRace.java
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/NotifyEventDropProxyTaskRace.java
Sun Oct 26 13:17:28 2014
@@ -169,7 +169,6 @@ public class NotifyEventDropProxyTaskRac
 	    cache = srvcDiscoveryMgr.createLookupCache(template,
 						       firstStageFilter,
 						       srvcListener);
-	    cacheList.add(cache);
             logger.log(Level.FINE, 
 		       "cache created ... wait "+nSecsRemoteCall
 		       +" seconds for event registration to complete");

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/ReRegisterGoodEquals.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/ReRegisterGoodEquals.java?rev=1634322&r1=1634321&r2=1634322&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/ReRegisterGoodEquals.java
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/ReRegisterGoodEquals.java
Sun Oct 26 13:17:28 2014
@@ -24,7 +24,6 @@ import com.sun.jini.test.spec.servicedis
 import com.sun.jini.test.share.DiscoveryServiceUtil;
 
 import net.jini.lookup.LookupCache;
-import net.jini.lookup.ServiceDiscoveryManager;
 
 import java.rmi.RemoteException;
 
@@ -106,27 +105,24 @@ public class ReRegisterGoodEquals extend
 	    cache = srvcDiscoveryMgr.createLookupCache(template,
 						       firstStageFilter,
 						       srvcListener);
-	    cacheList.add(cache);
 	} catch(RemoteException e) {
 	    throw new TestException(" -- RemoteException during lookup cache "
 				    +"creation");
 	}
-	logger.log(Level.FINE, "wait "
-		   +getnSecsServiceDiscovery()+" seconds to allow the "
-		   +"cache to be populated ... ");
+	logger.log(Level.FINE, "wait {0}"+" seconds to allow the "
+		   +"cache to be populated ... ", getnSecsServiceDiscovery());
         DiscoveryServiceUtil.delayMS(getnSecsServiceDiscovery()*1000);
         /* Re-register new proxies */
 	reRegisterServices(0, getnServices(), getnAttributes(),testServiceType);
-	logger.log(Level.FINE, "wait "
-		   +getnSecsServiceDiscovery()+" seconds to allow the "
-		   +"cache to be re-populated ... ");
+	logger.log(Level.FINE, "wait {0}"+" seconds to allow the "
+		   +"cache to be re-populated ... ", getnSecsServiceDiscovery());
         DiscoveryServiceUtil.delayMS(getnSecsServiceDiscovery()*1000);
 	int nAdded   = srvcListener.getNAdded();
 	int nRemoved = srvcListener.getNRemoved();
-	logger.log(Level.FINE, "nAdded = "+nAdded
-		   +", nAddedExpected = "+nAddedExpected
-		   +", nRemoved = "+nRemoved
-		   +", nRemovedExpected = "+nRemovedExpected);
+        int nChanged = srvcListener.getNChanged();
+	logger.log(Level.FINE, 
+                "nAdded = {0}, nAddedExpected = {1}, nRemoved = {2}, nRemovedExpected = {3},
nChanged = {4}, nChangedExpected = {5}",
+                new Object[]{nAdded, nAddedExpected, nRemoved, nRemovedExpected, nChanged,
nChangedExpected});
 	if((nAdded != nAddedExpected) || (nRemoved != nRemovedExpected)) {
 	    throw new TestException(" -- failure -- nAdded = "+nAdded
 				    +", nAddedExpected = "+nAddedExpected

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/start/aggregatepolicyprovider/UntrustedGetContextClassLoader.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/start/aggregatepolicyprovider/UntrustedGetContextClassLoader.java?rev=1634322&r1=1634321&r2=1634322&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/start/aggregatepolicyprovider/UntrustedGetContextClassLoader.java
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/start/aggregatepolicyprovider/UntrustedGetContextClassLoader.java
Sun Oct 26 13:17:28 2014
@@ -1,66 +1,68 @@
-/*
- * 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.
- */
-/* @test
- * @summary Verify that AggregatePolicyProvider does not invoke
- *          Thread.getContextClassLoader if overridden by subclass
- * @run main/othervm/policy=policy Test
- */
-package com.sun.jini.test.impl.start.aggregatepolicyprovider;
-
-import com.sun.jini.start.AggregatePolicyProvider;
-import net.jini.security.policy.*;
-import com.sun.jini.qa.harness.QATestEnvironment;
-import com.sun.jini.qa.harness.Test;
-import com.sun.jini.qa.harness.TestException;
-
-public class UntrustedGetContextClassLoader extends QATestEnvironment implements Test {
-
-    static AggregatePolicyProvider policy;
-
-    public void run() throws Exception {
-	if (System.getSecurityManager() == null) {
-	    System.setSecurityManager(new SecurityManager());
-	}
-	policy = new AggregatePolicyProvider();
-	ClassLoader ldr = UntrustedGetContextClassLoader.class.getClassLoader();
-	policy.setPolicy(ldr, new PolicyFileProvider());
-	Thread.currentThread().setContextClassLoader(ldr);
-	Test test = new Test();
-	test.start();
-
-	try { test.join(); } catch (InterruptedException ex) {}
-
-	if (test.getContextClassLoaderCalled) {
-	    throw new TestException("getContextClassLoader has been called.");
-	}
-    }
-
-
-    class Test extends Thread {
-        public boolean getContextClassLoaderCalled;
-
-        public ClassLoader getContextClassLoader() {
-            getContextClassLoaderCalled = true;
-            return super.getContextClassLoader();
-        }
-    
-        public void run() {
-            policy.getPermissions(getClass().getProtectionDomain());
-        }
-    }
-}
+/*
+ * 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.
+ */
+/* @test
+ * @summary Verify that AggregatePolicyProvider does not invoke
+ *          Thread.getContextClassLoader if overridden by subclass
+ * @run main/othervm/policy=policy Test
+ */
+package com.sun.jini.test.impl.start.aggregatepolicyprovider;
+
+import com.sun.jini.start.AggregatePolicyProvider;
+import net.jini.security.policy.*;
+import com.sun.jini.qa.harness.QATestEnvironment;
+import com.sun.jini.qa.harness.Test;
+import com.sun.jini.qa.harness.TestException;
+
+public class UntrustedGetContextClassLoader extends QATestEnvironment implements Test {
+
+    static AggregatePolicyProvider policy;
+
+    public void run() throws Exception {
+	if (System.getSecurityManager() == null) {
+	    System.setSecurityManager(new SecurityManager());
+	}
+	policy = new AggregatePolicyProvider();
+	ClassLoader ldr = UntrustedGetContextClassLoader.class.getClassLoader();
+	policy.setPolicy(ldr, new PolicyFileProvider());
+	Thread.currentThread().setContextClassLoader(ldr);
+	Test test = new Test();
+	test.start();
+
+	try { test.join(); } catch (InterruptedException ex) {
+            Thread.currentThread().interrupt();
+        }
+
+	if (test.getContextClassLoaderCalled) {
+	    throw new TestException("getContextClassLoader has been called.");
+	}
+    }
+
+
+    class Test extends Thread {
+        public boolean getContextClassLoaderCalled;
+
+        public ClassLoader getContextClassLoader() {
+            getContextClassLoaderCalled = true;
+            return super.getContextClassLoader();
+        }
+    
+        public void run() {
+            policy.getPermissions(getClass().getProtectionDomain());
+        }
+    }
+}

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=1634322&r1=1634321&r2=1634322&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 Sun
Oct 26 13:17:28 2014
@@ -104,10 +104,10 @@ java.util.logging.FileHandler.level = IN
 #  FINEST (lowest value) 
 
 # For Everything
-sun.rmi.level = CONFIG
-net.jini.level = FINE
-org.apache.river.level = CONFIG
-com.sun.jini.level = CONFIG
+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 = SEVERE
@@ -184,9 +184,9 @@ com.sun.jini.discovery.level = SEVERE
 # For the Helper Utilities
 net.jini.discovery.LookupDiscovery.level = SEVERE
 net.jini.discovery.LookupLocatorDiscovery.level = SEVERE
-net.jini.lookup.JoinManager.level = FINE
+net.jini.lookup.JoinManager.level = SEVERE
 net.jini.lookup.ServiceDiscoveryManager.level = SEVERE
-net.jini.lease.LeaseRenewalManager.level = FINEST
+net.jini.lease.LeaseRenewalManager.level = SEVERE
 
 # For Thread Pool Utilities
 com.sun.jini.thread.RetryTask.level = SEVERE
@@ -246,7 +246,7 @@ com.sun.jini.outrigger.entryMatching.lev
 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 = CONFIG
+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
@@ -256,6 +256,7 @@ com.sun.jini.outrigger.transactions.leve
 com.sun.jini.example.browser.level = SEVERE
 
 # For the test harness, tests, and infrastructure.
+com.sun.jini.qa.harness.level = CONFIG
 com.sun.jini.qa.harness.test.level = CONFIG
 com.sun.jini.qa.harness.service.level = CONFIG
 com.sun.jini.qa.harness.config.level = CONFIG



Mime
View raw message