-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Component/s: Runtime
-
Environment:Windows 2012 server
-
Tags:
-
Backlog priority:1,000
-
Sprint:DevOps Sprint 10, nxSL Sprint 9.1.4, nxSL Sprint 9.1.5
-
Story Points:5
org.nuxeo.runtime.osgi.util.jar.tests.TestClassLoaderInstrumentation fails under Windows 2012 server. Looking at the code, the reason why it would not fail under other Windows versions is not clear (code dates from 2012!):
Test set: org.nuxeo.runtime.osgi.util.jar.tests.TestClassLoaderInstrumentation
------------------------------------------------------------------------------- Tests run: 4, Failures: 0, Errors: 2, Skipped: 2, Time elapsed: 0.094 sec <<< FAILURE! - in org.nuxeo.runtime.osgi.util.jar.tests.TestClassLoaderInstrumentation canDeleteJar(org.nuxeo.runtime.osgi.util.jar.tests.TestClassLoaderInstrumentation) Time elapsed: 0.094 sec <<< ERROR! java.lang.IllegalStateException: cannot locate binaries at org.nuxeo.runtime.osgi.util.jar.tests.JarBuilder.locateBinaries(JarBuilder.java:71) at org.nuxeo.runtime.osgi.util.jar.tests.JarBuilder.<init>(JarBuilder.java:52) at org.nuxeo.runtime.osgi.util.jar.tests.TestClassLoaderInstrumentation.setupJarBuilder(TestClassLoaderInstrumentation.java:57)
After a first fix on OS specific path separator:
fix path separator
diff --git i/nuxeo-runtime/nuxeo-runtime-osgi/src/test/java/org/nuxeo/runtime/osgi/util/jar/tests/JarBuilder.java w/nuxeo-runtime/nuxeo-runtime-osgi/src/test/java/org/nuxeo/runtime/osgi/util/jar/tests/JarBuilder.java index 0e527be..ad3a83f 100644 --- i/nuxeo-runtime/nuxeo-runtime-osgi/src/test/java/org/nuxeo/runtime/osgi/util/jar/tests/JarBuilder.java +++ w/nuxeo-runtime/nuxeo-runtime-osgi/src/test/java/org/nuxeo/runtime/osgi/util/jar/tests/JarBuilder.java @@ -56,7 +56,7 @@ public class JarBuilder { String classpath = System.getProperty("java.class.path"); - StringTokenizer tokenizer = new StringTokenizer(classpath, ":"); + StringTokenizer tokenizer = new StringTokenizer(classpath, File.pathSeparator); while (tokenizer.hasMoreElements()) { File bindir = new File(tokenizer.nextToken());
There are still issues:
Running org.nuxeo.runtime.osgi.util.jar.tests.TestClassLoaderInstrumentation
Tests run: 3, Failures: 0, Errors: 1, Skipped: 2, Time elapsed: 0.125 sec <<< FAILURE! - in org.nuxeo.runtime.osgi.util. jar.tests.TestClassLoaderInstrumentation canDeleteJar(org.nuxeo.runtime.osgi.util.jar.tests.TestClassLoaderInstrumentation) Time elapsed: 0.125 sec <<< ERROR! java.lang.ClassNotFoundException: org.nuxeo.runtime.osgi.util.jar.tests.JarBuilder$First at java.net.URLClassLoader$1.run(URLClassLoader.java:372) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.nuxeo.runtime.osgi.util.jar.tests.TestClassLoaderInstrumentation.canDeleteJar(TestClassLoaderInstrumentat ion.java:104)
- is required by
-
NXP-20490 Fix Windows test canDeleteJar
- Resolved