The error message is clear because testng is not found from the module path.

Error occurred during initialization of boot layer
java.lang.module.FindException: Module testng not found, required by test

If you edit the rerun command from jtr file to add JTwork/modules to module path as follows:

--module-path /home/martin/ws/jdk10/jdk/
test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d/modules:/home/martin/ws/jdk10/jdk/
test/JTwork/modules

If it runs successfully, then the question is why jtreg includes JTwork/modules in javac --module-path but not at run time in your local run but my local jtreg works fine.  Jon may have jtreg debugging tip.

Mandy

On 8/22/17 6:18 PM, Martin Buchholz wrote:
I also tried upgrading jcommander.jar to 1.72 from 1.48, but get the same error.
Debugging hints?


On Tue, Aug 22, 2017 at 4:28 PM, mandy chung <mandy.ch...@oracle.com <mailto:mandy.ch...@oracle.com>> wrote:


    On 8/22/17 3:52 PM, Martin Buchholz wrote:
    :


    ACTION: testng -- Failed. Unexpected exit from test [exit code: 1]
    REASON: User specified action: run testng/othervm test/test.Main
    TIME:   0.215 seconds
    messages:
    command: testng test/test.Main
    reason: User specified action: run testng/othervm test/test.Main
    Mode: othervm [/othervm specified]
    elapsed time (seconds): 0.215
    configuration:
    Boot Layer
      add modules: test m4 m2 m3 m1
      module path:
    
/home/martin/ws/jdk10/jdk/test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d/modules

    STDOUT:
    Error occurred during initialization of boot layer
    java.lang.module.FindException: Module testng not found, required
    by test
    STDERR:
    rerun:
    DISPLAY=localhost:10.0 \
    HOME=/home/martin \
    LANG=en_US.UTF-8 \
    PATH=/bin:/usr/bin \
    
CLASSPATH=/home/martin/ws/jdk10/jdk/test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d:/home/martin/ws/jdk10/jdk/test/java/lang/ModuleTests/addXXX:/home/martin/jtreg-binaries/4.2-b08/lib/testng.jar:/home/martin/jtreg-binaries/4.2-b08/lib/jcommander.jar:/home/martin/jtreg-binaries/4.2-b08/lib/javatest.jar:/home/martin/jtreg-binaries/4.2-b08/lib/jtreg.jar
    \
    
/home/martin/ws/jdk10/build/linux-x86_64-normal-server-release/images/jdk/bin/java
    \
    
-Dtest.class.path.prefix=/home/martin/ws/jdk10/jdk/test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d:/home/martin/ws/jdk10/jdk/test/java/lang/ModuleTests/addXXX
    \
    -Dtest.src=/home/martin/ws/jdk10/jdk/test/java/lang/ModuleTests/addXXX
    \
    -Dtest.src.path=/home/martin/ws/jdk10/jdk/test/java/lang/ModuleTests/addXXX
    \
    
-Dtest.classes=/home/martin/ws/jdk10/jdk/test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d
    \
    
-Dtest.class.path=/home/martin/ws/jdk10/jdk/test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d
    \
    -Dtest.vm.opts=-enablesystemassertions \
    -Dtest.tool.vm.opts=-J-enablesystemassertions \
    -Dtest.compiler.opts= \
    -Dtest.java.opts= \
    
-Dtest.jdk=/home/martin/ws/jdk10/build/linux-x86_64-normal-server-release/images/jdk
    \
    
-Dcompile.jdk=/home/martin/ws/jdk10/build/linux-x86_64-normal-server-release/images/jdk
    \
    -Dtest.timeout.factor=1.0 \
            --module-path
    
/home/martin/ws/jdk10/jdk/test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d/modules
    \

    ====> /home/martin/ws/jdk10/jdk/test/JTwork/modules is not in the
    module path.  Therefore testng is not found.

    I can't reproduce this error.  I downloaded testng 6.9.9 and it
    works for me.  This is the jtreg version I used.

    $ jtreg -version
    jtreg, version 4.2 fcs b08
    Installed in /java/devtools/jtreg/jtreg-4.2/lib/jtreg.jar
    Running on platform version 9 from /java/re/jdk-9.jdk/Contents/Home.
    Built with Java(TM) 2 SDK, Version 1.7.0-b147 on July 21, 2017.
    Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights
    reserved.
    Use is subject to license terms.
    JCov 2.0-b18 beta
    TestNG (testng.jar): version 6.9.9
    TestNG (jcommander.jar): version 1.72


    Mandy
            --add-modules test,m4,m2,m3,m1 \
    -enablesystemassertions \
    com.sun.javatest.regtest.agent.MainWrapper
    
/home/martin/ws/jdk10/jdk/test/JTwork/java/lang/ModuleTests/addXXX/Driver.d/testng.0.jta
    java/lang/ModuleTests/addXXX/Driver.java false test/test.Main

    TEST RESULT: Failed. Unexpected exit from test [exit code: 1]



Reply via email to