river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter_firmst...@apache.org
Subject svn commit: r1590379 - in /river/jtsk/skunk/qa_refactor/trunk: qa/src/com/sun/jini/test/impl/mahalo/ qa/src/com/sun/jini/test/spec/config/configurationfile/ qa/src/com/sun/jini/test/spec/io/marshalinputstream/ qa/src/com/sun/jini/test/spec/io/marshalle...
Date Sun, 27 Apr 2014 11:37:41 GMT
Author: peter_firmstone
Date: Sun Apr 27 11:37:40 2014
New Revision: 1590379

URL: http://svn.apache.org/r1590379
Log:
RIVER-336 Update to ClassLoading.  Convert remaining tests to utilise the new java.rmi.server.RMIClassLoaderSpi
provider in ClassLoading

Reduce number of tasks executed in RandomStressTest to avoid OOME on 32 bit platforms.

Updated configuration.policy to ensure that all configuration files had sufficient permission
to be tested,  broken.prop wasn't being tested, not sure how long this has been the case,
but it's fixed now.

Added:
    river/jtsk/skunk/qa_refactor/trunk/qa/src/manifest/qa1-io-tests/META-INF/services/java.rmi.server.RMIClassLoaderSpi
Modified:
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/RandomStressTest.td
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/config/configurationfile/configurationfile.policy
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalinputstream/LoadClass_ExceptionTest.td
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalinputstream/Resolve_LoadClassExceptionTest.td
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalinputstream/Resolve_LoadClassTest.td
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalledinstance/ObjectMethodsTest.td
    river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/jeri/transport/resources/ssl.policy
    river/jtsk/skunk/qa_refactor/trunk/qa/src/manifest/qa1/META-INF/services/java.rmi.server.RMIClassLoaderSpi
    river/jtsk/skunk/qa_refactor/trunk/src/net/jini/loader/ClassLoading.java

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/RandomStressTest.td
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/RandomStressTest.td?rev=1590379&r1=1590378&r2=1590379&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/RandomStressTest.td
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/impl/mahalo/RandomStressTest.td
Sun Apr 27 11:37:40 2014
@@ -6,4 +6,4 @@ testCategories=txnmanager,txnmanager_imp
 # value specified in seconds
 com.sun.jini.qa.harness.timeout=10800
 com.sun.jini.test.impl.mahalo.RandomStressTest.parts=200
-com.sun.jini.test.impl.mahalo.RandomStressTest.tasks=10000
+com.sun.jini.test.impl.mahalo.RandomStressTest.tasks=5000

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/config/configurationfile/configurationfile.policy
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/config/configurationfile/configurationfile.policy?rev=1590379&r1=1590378&r2=1590379&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/config/configurationfile/configurationfile.policy
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/config/configurationfile/configurationfile.policy
Sun Apr 27 11:37:40 2014
@@ -17,6 +17,8 @@ grant {
     permission java.lang.RuntimePermission "setSecurityManager";
     permission java.lang.RuntimePermission "setIO";
     permission java.lang.RuntimePermission "getProtectionDomain";
+    permission java.lang.RuntimePermission "setFactory";
+    permission java.lang.RuntimePermission "getenv.SOUL";
     permission javax.security.auth.AuthPermission "createLoginContext.com.sun.jini.Test";
     permission javax.security.auth.AuthPermission "doAs";
 
@@ -61,6 +63,7 @@ grant {
     permission java.io.FilePermission "${java.io.tmpdir}${/}valid.prop", "read,write,delete";

     permission java.io.FilePermission "${java.io.tmpdir}${/}valid.prop1","read,write,delete";

     permission java.io.FilePermission "${java.io.tmpdir}${/}unexist.prop","read,write,delete";

+    permission java.io.FilePermission "${java.io.tmpdir}${/}broken.prop","read,write,delete";
 
     permission java.io.FilePermission "c:\\temp",             "read,write,delete"; 
     permission java.io.FilePermission "c:\\temp\\-",          "write,delete"; 

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalinputstream/LoadClass_ExceptionTest.td
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalinputstream/LoadClass_ExceptionTest.td?rev=1590379&r1=1590378&r2=1590379&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalinputstream/LoadClass_ExceptionTest.td
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalinputstream/LoadClass_ExceptionTest.td
Sun Apr 27 11:37:40 2014
@@ -1,7 +1,7 @@
 testClass=LoadClass_ExceptionTest
 testCategories=io,io_spec
 testClasspath=${altClasspath}$:<file:lib/qa1-io-marshalinputstream-test.jar>
-testjvmargs=-Djava.rmi.server.RMIClassLoaderSpi=com.sun.jini.test.spec.io.util.FakeRMIClassLoaderSpi
+testjvmargs=-Dnet.jini.loader.ClassLoading.provider=com.sun.jini.test.spec.io.util.FakeRMIClassLoaderSpi
 
 com.sun.jini.test.spec.io.util.fakeArgumentJar=http://${HOST}:${com.sun.jini.test.port}/qa1-io-util-dl.jar
 com.sun.jini.qa.harness.runkitserver=false 

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalinputstream/Resolve_LoadClassExceptionTest.td
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalinputstream/Resolve_LoadClassExceptionTest.td?rev=1590379&r1=1590378&r2=1590379&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalinputstream/Resolve_LoadClassExceptionTest.td
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalinputstream/Resolve_LoadClassExceptionTest.td
Sun Apr 27 11:37:40 2014
@@ -1,7 +1,7 @@
 testClass=Resolve_LoadClassExceptionTest
 testCategories=io,io_spec
 testClasspath=${altClasspath}$:<file:lib/qa1-io-marshalinputstream-test.jar>
-testjvmargs=-Djava.rmi.server.RMIClassLoaderSpi=com.sun.jini.test.spec.io.util.FakeRMIClassLoaderSpi
+testjvmargs=-Dnet.jini.loader.ClassLoading.provider=com.sun.jini.test.spec.io.util.FakeRMIClassLoaderSpi
 
 com.sun.jini.test.spec.io.util.fakeArgumentJar=http://${HOST}:${com.sun.jini.test.port}/qa1-io-util-dl.jar
 com.sun.jini.qa.harness.runkitserver=false 

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalinputstream/Resolve_LoadClassTest.td
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalinputstream/Resolve_LoadClassTest.td?rev=1590379&r1=1590378&r2=1590379&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalinputstream/Resolve_LoadClassTest.td
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalinputstream/Resolve_LoadClassTest.td
Sun Apr 27 11:37:40 2014
@@ -1,7 +1,7 @@
 testClass=Resolve_LoadClassTest
 testCategories=io,io_spec
 testClasspath=${altClasspath}$:<file:lib/qa1-io-marshalinputstream-test.jar>
-testjvmargs=-Djava.rmi.server.RMIClassLoaderSpi=com.sun.jini.test.spec.io.util.FakeRMIClassLoaderSpi
+testjvmargs=-Dnet.jini.loader.ClassLoading.provider=com.sun.jini.test.spec.io.util.FakeRMIClassLoaderSpi
 com.sun.jini.qa.harness.runkitserver=false 
 com.sun.jini.qa.harness.runjiniserver=false
 include0=../io.properties

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalledinstance/ObjectMethodsTest.td
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalledinstance/ObjectMethodsTest.td?rev=1590379&r1=1590378&r2=1590379&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalledinstance/ObjectMethodsTest.td
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/io/marshalledinstance/ObjectMethodsTest.td
Sun Apr 27 11:37:40 2014
@@ -1,7 +1,7 @@
 testClass=ObjectMethodsTest
 testCategories=io,io_spec
 testClasspath=${altClasspath}$:<file:lib/qa1-io-marshalledinstance-test.jar>
-testjvmargs=-Djava.rmi.server.RMIClassLoaderSpi=com.sun.jini.test.spec.io.util.FakeRMIClassLoaderSpi
+testjvmargs=-Dnet.jini.loader.ClassLoading.provider=com.sun.jini.test.spec.io.util.FakeRMIClassLoaderSpi
 com.sun.jini.qa.harness.runkitserver=false 
 com.sun.jini.qa.harness.runjiniserver=false
 include0=../io.properties

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/jeri/transport/resources/ssl.policy
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/jeri/transport/resources/ssl.policy?rev=1590379&r1=1590378&r2=1590379&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/jeri/transport/resources/ssl.policy
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/jeri/transport/resources/ssl.policy
Sun Apr 27 11:37:40 2014
@@ -19,6 +19,8 @@ grant codebase "file:${com.sun.jini.qa.h
     permission javax.security.auth.AuthPermission "*";
     permission java.lang.RuntimePermission "createSecurityManager";
     permission java.lang.RuntimePermission "accessClassInPackage.sun.util.logging.resources";
+    permission java.lang.RuntimePermission "createClassLoader";
+    permission java.lang.RuntimePermission "setFactory";
 };
 
 grant codebase "file:${com.sun.jini.qa.harness.testJar}" {
@@ -27,6 +29,8 @@ grant codebase "file:${com.sun.jini.qa.h
     permission java.util.PropertyPermission "*", "read,write";
     permission javax.security.auth.AuthPermission "*";
     permission java.lang.RuntimePermission "createSecurityManager";
+    permission java.lang.RuntimePermission "createClassLoader";
+    permission java.lang.RuntimePermission "setFactory";
 };
 
 grant codebase "file:${com.sun.jini.jsk.home}${/}lib/jsk-platform.jar" {

Added: river/jtsk/skunk/qa_refactor/trunk/qa/src/manifest/qa1-io-tests/META-INF/services/java.rmi.server.RMIClassLoaderSpi
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/manifest/qa1-io-tests/META-INF/services/java.rmi.server.RMIClassLoaderSpi?rev=1590379&view=auto
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/manifest/qa1-io-tests/META-INF/services/java.rmi.server.RMIClassLoaderSpi
(added)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/manifest/qa1-io-tests/META-INF/services/java.rmi.server.RMIClassLoaderSpi
Sun Apr 27 11:37:40 2014
@@ -0,0 +1 @@
+com.sun.jini.test.spec.io.util.FakeRMIClassLoaderSpi

Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/manifest/qa1/META-INF/services/java.rmi.server.RMIClassLoaderSpi
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/manifest/qa1/META-INF/services/java.rmi.server.RMIClassLoaderSpi?rev=1590379&r1=1590378&r2=1590379&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/manifest/qa1/META-INF/services/java.rmi.server.RMIClassLoaderSpi
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/manifest/qa1/META-INF/services/java.rmi.server.RMIClassLoaderSpi
Sun Apr 27 11:37:40 2014
@@ -1 +1 @@
-com.sun.jini.test.spec.loader.util.QATestPreferredClassProvider
\ No newline at end of file
+com.sun.jini.test.spec.loader.util.QATestPreferredClassProvider

Modified: river/jtsk/skunk/qa_refactor/trunk/src/net/jini/loader/ClassLoading.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/src/net/jini/loader/ClassLoading.java?rev=1590379&r1=1590378&r2=1590379&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/src/net/jini/loader/ClassLoading.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/src/net/jini/loader/ClassLoading.java Sun Apr 27 11:37:40
2014
@@ -39,6 +39,9 @@ import java.util.concurrent.ExecutionExc
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.FutureTask;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import net.jini.security.Security;
@@ -166,7 +169,7 @@ public final class ClassLoading {
                         );
                     }
                 }
-                logger.log(Level.CONFIG, "uable to find {0}" , providerName);
+                logger.log(Level.CONFIG, "uable to find {0}" , name);
                 return null;
             }
         });
@@ -577,7 +580,15 @@ public final class ClassLoading {
         if (loader == null) return Class.forName(name, initialize, loader);
         ExecutorService exec = loaderMap.get(loader);
         if (exec == null){
-            exec = Executors.newSingleThreadExecutor(new NamedThreadFactory(loader.toString(),true));
+            exec = new ThreadPoolExecutor(
+                    1,
+                    1,
+                    0,
+                    TimeUnit.SECONDS,
+                    new LinkedBlockingQueue(),
+                    new NamedThreadFactory(loader.toString(),true),
+                    new ThreadPoolExecutor.CallerRunsPolicy()
+            );
             ExecutorService existed = loaderMap.putIfAbsent(loader, exec);
             if (existed != null){
                 exec = existed;
@@ -598,6 +609,7 @@ public final class ClassLoading {
             if (t instanceof SecurityException) throw (SecurityException) t;
             if (t instanceof ClassNotFoundException ) 
                 throw (ClassNotFoundException) t;
+            if (t instanceof NullPointerException) throw (NullPointerException) t;
             throw new ClassNotFoundException("Unable to find Class:" + name, t);
         }
     }



Mime
View raw message