Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-16567

Fix TestClassLoaderInstrumentation under Windows

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.10-HF21, 8.10-HF01, 9.1
    • Component/s: Runtime
    • Environment:
      Windows 2012 server
    • Backlog priority:
      1,000
    • Sprint:
      DevOps Sprint 10, nxSL Sprint 9.1.4, nxSL Sprint 9.1.5
    • Story Points:
      5

      Description

      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)

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day
                  1d