diff -Nru jtreg-4.2-b13/debian/changelog jtreg-4.2-b14/debian/changelog --- jtreg-4.2-b13/debian/changelog 2018-11-21 04:49:59.000000000 +0000 +++ jtreg-4.2-b14/debian/changelog 2019-02-25 11:44:58.000000000 +0000 @@ -1,3 +1,12 @@ +jtreg (4.2-b14-1) unstable; urgency=medium + + * Team upload. + * New upstream release + - Refreshed the patches + * Standards-Version updated to 4.3.0 + + -- Emmanuel Bourg Mon, 25 Feb 2019 12:44:58 +0100 + jtreg (4.2-b13-2) unstable; urgency=medium * Team upload. diff -Nru jtreg-4.2-b13/debian/control jtreg-4.2-b14/debian/control --- jtreg-4.2-b13/debian/control 2018-11-21 04:49:59.000000000 +0000 +++ jtreg-4.2-b14/debian/control 2019-02-25 11:44:25.000000000 +0000 @@ -3,25 +3,29 @@ Priority: optional Maintainer: Debian Java Maintainers Uploaders: Guillaume Mazoyer -Build-Depends: debhelper (>= 11~), javahelper, help2man -Build-Depends-Indep: default-jdk, - libjtharness-java, - ant, - javahelp2, - libxalan2-java, - testng -Standards-Version: 4.2.1 +Build-Depends: + ant, + debhelper (>= 11~), + default-jdk, + help2man, + javahelp2, + javahelper, + libjtharness-java, + libxalan2-java, + testng +Standards-Version: 4.3.0 Vcs-Git: https://salsa.debian.org/java-team/jtreg.git Vcs-Browser: https://salsa.debian.org/java-team/jtreg Homepage: http://openjdk.java.net/jtreg Package: jtreg Architecture: all -Depends: ${java:Depends}, - ${misc:Depends}, - libjtharness-java, - javahelp2, - libxalan2-java +Depends: + ${java:Depends}, + ${misc:Depends}, + javahelp2, + libjtharness-java, + libxalan2-java Recommends: testng Description: Regression Test Harness for the OpenJDK platform jtreg is the test harness used by the OpenJDK test framework. diff -Nru jtreg-4.2-b13/debian/patches/add-jcommander-to-classpath.patch jtreg-4.2-b14/debian/patches/add-jcommander-to-classpath.patch --- jtreg-4.2-b13/debian/patches/add-jcommander-to-classpath.patch 2018-11-21 04:49:59.000000000 +0000 +++ jtreg-4.2-b14/debian/patches/add-jcommander-to-classpath.patch 2019-02-25 11:42:32.000000000 +0000 @@ -4,7 +4,7 @@ Forwarded: no --- a/src/share/classes/com/sun/javatest/regtest/exec/MainAction.java +++ b/src/share/classes/com/sun/javatest/regtest/exec/MainAction.java -@@ -558,6 +558,7 @@ +@@ -556,6 +556,7 @@ .append(jdk.getJDKClassPath()) .append(script.getJUnitPath()) .append(script.getTestNGPath()) @@ -14,7 +14,7 @@ SearchPath classpath = paths.get(PathKind.CLASSPATH); --- a/src/share/classes/com/sun/javatest/regtest/exec/RegressionScript.java +++ b/src/share/classes/com/sun/javatest/regtest/exec/RegressionScript.java -@@ -732,16 +732,20 @@ +@@ -771,16 +771,20 @@ File md = workDir.getFile("modules"); if (needJUnit) install(params.getJUnitPath(), md); @@ -37,7 +37,7 @@ } // Extras: -@@ -833,8 +837,10 @@ +@@ -872,8 +876,10 @@ File md = workDir.getFile("modules"); if (needJUnit) install(params.getJUnitPath(), md); @@ -49,7 +49,7 @@ mp.append(md); } } else { -@@ -842,8 +848,10 @@ +@@ -881,8 +887,10 @@ if (needJUnit) fp.append(params.getJUnitPath()); diff -Nru jtreg-4.2-b13/debian/patches/launchers.patch jtreg-4.2-b14/debian/patches/launchers.patch --- jtreg-4.2-b13/debian/patches/launchers.patch 2018-11-21 04:49:59.000000000 +0000 +++ jtreg-4.2-b14/debian/patches/launchers.patch 2019-02-25 11:41:36.000000000 +0000 @@ -93,9 +93,9 @@ $jtdiffOpts --- a/src/share/bin/jtreg.sh +++ b/src/share/bin/jtreg.sh -@@ -47,40 +47,6 @@ - # - # jtreg also provides Ant tasks; see the documentation for details. +@@ -68,36 +68,6 @@ + esac + -# Determine jtreg/JavaTest installation directory -if [ -n "$JT_HOME" ]; then @@ -106,7 +106,8 @@ -else - # Deduce where script is installed - # - should work on most derivatives of Bourne shell, like ash, bash, ksh, -- # sh, zsh, etc, including on Windows, MKS (ksh) and Cygwin (ash or bash) +- # sh, zsh, etc, including on Windows, MKS (ksh), Cygwin (ash or bash) +- # and Windows Subsystem for Linux (WSL) - if type -p type 1>/dev/null 2>&1 && test -z "`type -p type`" ; then - myname=`type -p "$0"` - elif type type 1>/dev/null 2>&1 ; then @@ -125,16 +126,11 @@ - fi -fi - --# Normalize JT_HOME if using Cygwin --case "`uname -s`" in -- CYGWIN* ) cygwin=1 ; JT_HOME=`cygpath -a -m "$JT_HOME"` ;; --esac -- - - # Separate out -J* options for the JVM - # Note jdk as possible default to run jtreg + # Look for -jdk option as possible default to run jtreg # Unset IFS and use newline as arg separator to preserve spaces in args -@@ -101,37 +67,24 @@ + DUALCASE=1 # for MKS: make case statement case-sensitive (6709498) +@@ -113,17 +83,9 @@ done unset DUALCASE @@ -154,6 +150,11 @@ + JT_JAVA="/usr/lib/jvm/default-java" fi + # Fixup JT_JAVA, JTHOME as needed, if using Cygwin or WSL +@@ -134,16 +96,8 @@ + JT_HOME=`wslpath -a -m "$JT_HOME"` + fi + -# Verify java version (1.)7 or newer used to run jtreg -version=`"$JT_JAVA" -classpath "${JT_HOME}/lib/jtreg.jar" com.sun.javatest.regtest.agent.GetSystemProperty java.version 2>&1 | - grep 'java.version=' | sed -e 's/^.*=//' -e 's/^1\.//' -e 's/\([1-9][0-9]*\).*/\1/'` @@ -168,6 +169,9 @@ + JT_HOME="/usr/share/java" fi + # Separate out -J* options for the JVM +@@ -170,10 +124,13 @@ + # And finally ... +JT_CLASSPATH="${JT_HOME}/jtreg.jar:/usr/share/java/javatest.jar:/usr/share/java/jh.jar:/usr/share/java/junit4.jar" diff -Nru jtreg-4.2-b13/.hg_archival.txt jtreg-4.2-b14/.hg_archival.txt --- jtreg-4.2-b13/.hg_archival.txt 2018-07-27 20:57:45.000000000 +0000 +++ jtreg-4.2-b14/.hg_archival.txt 2019-02-07 19:19:28.000000000 +0000 @@ -1,4 +1,4 @@ repo: 9f51ef22f00a3d5b681472cacf3ce15868073103 -node: 7a38f21e077821a5015792e85b3793c90c81b866 +node: ec37d2900cd42987270f98423a60eb6297bdc37b branch: default -tag: jtreg4.2-b13 +tag: jtreg4.2-b14 diff -Nru jtreg-4.2-b13/.hgtags jtreg-4.2-b14/.hgtags --- jtreg-4.2-b13/.hgtags 2018-07-27 20:57:45.000000000 +0000 +++ jtreg-4.2-b14/.hgtags 2019-02-07 19:19:28.000000000 +0000 @@ -26,3 +26,4 @@ 746c6d1328721541d3b16154c25a0179fbf53f7c jtreg4.2-b10 a13ec77e7adcc4c9ed434e664abc350abaacc045 jtreg4.2-b11 652902f7fb0ed0b4f307d61a799caf50a6e609be jtreg4.2-b12 +7a38f21e077821a5015792e85b3793c90c81b866 jtreg4.2-b13 diff -Nru jtreg-4.2-b13/make/build-all.sh jtreg-4.2-b14/make/build-all.sh --- jtreg-4.2-b13/make/build-all.sh 2018-07-27 20:57:45.000000000 +0000 +++ jtreg-4.2-b14/make/build-all.sh 2019-02-07 19:19:28.000000000 +0000 @@ -93,8 +93,8 @@ CODE_TOOLS_URL=http://hg.openjdk.java.net/code-tools # The following are Mercurial tags for the corresponding OpenJDK Code Tools repo -ASMTOOLS_VERSION=${ASMTOOLS_VERSION:-7.0-b04} # early access for 7.0 -JTHARNESS_VERSION=${JTHARNESS_VERSION:-jt6.0-b02} # early access for 6.0 +ASMTOOLS_VERSION=${ASMTOOLS_VERSION:-7.0-b06} # early access for 7.0 +JTHARNESS_VERSION=${JTHARNESS_VERSION:-jt6.0-b04} # early access for 6.0 JCOV_VERSION=${JCOV_VERSION:-jcov3.0-b05} # jcov3.0, ASM 6.2 # ANT diff -Nru jtreg-4.2-b13/make/Defs.gmk jtreg-4.2-b14/make/Defs.gmk --- jtreg-4.2-b13/make/Defs.gmk 2018-07-27 20:57:45.000000000 +0000 +++ jtreg-4.2-b14/make/Defs.gmk 2019-02-07 19:19:28.000000000 +0000 @@ -141,6 +141,15 @@ JDKJAVAC = $(JDKHOME)/bin/javac JAR = $(JDKHOME)/bin/jar +# Only use -source -target, to support legacy platforms, when building with JDK 7 or 8 +# Otherwise, use default values for $JDKHOME/bin/javac +SUPPORT_OLD_SOURCE_TARGET = $(shell $(JDKJAVAC) -version 2>&1 | grep '[78]' > /dev/null && echo true ) +ifneq ($(SUPPORT_OLD_SOURCE_TARGET),) + OLD_JAVAC_SOURCE_TARGET = -source 1.2 -target 1.1 + AGENT_JAVAC_SOURCE_TARGET = -source 5 -target 5 + TOOL_JAVAC_SOURCE_TARGET = -source 7 -target 7 +endif + ifdef JDK15HOME JDK15_BOOTCLASSPATH = -bootclasspath $(JDK15HOME)/jre/lib/rt.jar endif @@ -151,17 +160,17 @@ # for files needed to run othervm tests on oldest supported platforms REGTEST_OLD_JAVAC = $(JDKHOME)/bin/javac REGTEST_OLD_JAVAC_OPTIONS = \ - -source 1.2 -target 1.1 $(JDK15_BOOTCLASSPATH) -Xlint:all,-options -Werror + $(OLD_JAVAC_SOURCE_TARGET) $(JDK15_BOOTCLASSPATH) -Xlint:all,-options -Werror # for files needed to run agentvm tests (on platforms back to JDK 1.5) REGTEST_AGENT_JAVAC = $(JDKHOME)/bin/javac REGTEST_AGENT_JAVAC_OPTIONS = \ - -source 5 -target 5 $(JDK15_BOOTCLASSPATH) -Xlint:all,-options -Werror + $(AGENT_JAVAC_SOURCE_TARGET) $(JDK15_BOOTCLASSPATH) -Xlint:all,-options -Werror # for files needed for jtreg tool REGTEST_TOOL_JAVAC = $(JDKHOME)/bin/javac REGTEST_TOOL_JAVAC_OPTIONS = \ - -source 7 -target 7 $(JDK17_BOOTCLASSPATH) -Xlint:all,-options -Werror + $(TOOL_JAVAC_SOURCE_TARGET) $(JDK17_BOOTCLASSPATH) -Xlint:all,-options -Werror #----- JavaHelp # @@ -408,6 +417,13 @@ LN = /bin/ln MKDIR = /bin/mkdir MV = /bin/mv +PANDOC = $(shell if [ -r /usr/bin/pandoc ]; then \ + echo /usr/bin/pandoc ; \ + elif [ -r /usr/local/bin/pandoc ]; then \ + echo /usr/local/bin/pandoc ; \ + else \ + echo /bin/echo "pandoc not available" ; \ + fi ) PERL = /usr/bin/perl RM = /bin/rm -rf SED := $(shell if [ -r /bin/sed ]; then echo /bin/sed ; else echo /usr/bin/sed ; fi ) diff -Nru jtreg-4.2-b13/make/jtreg.gmk jtreg-4.2-b14/make/jtreg.gmk --- jtreg-4.2-b13/make/jtreg.gmk 2018-07-27 20:57:45.000000000 +0000 +++ jtreg-4.2-b14/make/jtreg.gmk 2019-02-07 19:19:28.000000000 +0000 @@ -99,11 +99,13 @@ JTREG_COPYRIGHT = $(JTREG_IMAGEDIR)/COPYRIGHT JTREG_LICENSE = $(JTREG_IMAGEDIR)/LICENSE JTREG_README = $(JTREG_IMAGEDIR)/README +JTREG_FAQ = $(JTREG_IMAGEDIR)/doc/jtreg/faq.html JTREG_TAGSPEC = $(JTREG_IMAGEDIR)/doc/jtreg/tag-spec.html JTREG_USAGE = $(JTREG_IMAGEDIR)/doc/jtreg/usage.txt JTREG_DOCS = \ $(JTREG_COPYRIGHT) \ + $(JTREG_FAQ) \ $(JTREG_LICENSE) \ $(JTREG_README) \ $(JTREG_TAGSPEC) \ @@ -114,6 +116,28 @@ $(RM) $@ $(CP) $< $@ +$(JTREG_FAQ): $(SRCJTREGDOCDIR)/faq.md \ + $(SRCJTREGDOCDIR)/faq-local-style.html \ + $(SRCJTREGDOCDIR)/faq-intro.html + $(MKDIR) -p $(@D) + $(ECHO) '/
/{;:a;N;/<\/header>/!ba;};/

/d' | tr ';' '\n' > $(BUILDDIR)/fixupheader + $(PANDOC) \ + --standalone \ + --include-in-header $(SRCJTREGDOCDIR)/faq-local-style.html \ + --include-before $(SRCJTREGDOCDIR)/faq-intro.html \ + --toc \ + --to html5 \ + --number-sections \ + $(SRCJTREGDOCDIR)/faq.md | \ + $(SED) \ + -e 's/^code > span\.\([a-z][a-z] .*\)/code span.\1/' \ + -e 's/-section-number">0./-section-number">/' \ + -e 's/…/\…/g' \ + -e 's/™/\™/g' \ + -f $(BUILDDIR)/fixupheader \ + > $(JTREG_FAQ) + + $(JTREG_README): $(SRCJTREGDOCDIR)/README $(MKDIR) -p $(@D) $(RM) $@ diff -Nru jtreg-4.2-b13/plugins/idea/resources/META-INF/plugin.xml jtreg-4.2-b14/plugins/idea/resources/META-INF/plugin.xml --- jtreg-4.2-b13/plugins/idea/resources/META-INF/plugin.xml 2018-07-27 20:57:45.000000000 +0000 +++ jtreg-4.2-b14/plugins/idea/resources/META-INF/plugin.xml 2019-02-07 19:19:28.000000000 +0000 @@ -1,5 +1,5 @@ + + Select the "pick me" check box. + + + +The sample test code. + + import java.applet.Applet; + import java.awt.Checkbox; + import java.awt.FlowLayout; + import java.awt.Panel; + import java.awt.event.ItemEvent; + import java.awt.event.ItemListener; + + // WARNING! The AWT event thread does not propagate exceptions! + // It is recommended that all exceptions indicating failure + // of the test be thrown from one of the methods called by the harness. + // (i.e. init(), start(), stop(), destroy()) + + public class SampleTest extends Applet { + public void init() { + setLayout(new FlowLayout()); + add(new TestPanel(this)); + } + + public void destroy() { + if (myEvent == null) + throw new RuntimeException("no events"); + else { + Checkbox cb = (Checkbox)(myEvent.getItemSelectable()); + if (!(cb.getLabel().equals("pick me!") && cb.getState())) + throw new RuntimeException("unexpected last event"); + } + } + + class TestPanel extends Panel { + Checkbox pickMe, notMe; + Listener listener = new Listener(); + Applet applet; + + public TestPanel(Applet myApplet) { + applet = myApplet; + pickMe = new Checkbox("pick me!"); + notMe = new Checkbox("not me"); + + pickMe.addItemListener(listener); + notMe.addItemListener(listener); + + add(pickMe); + add(notMe); + } + + class Listener implements ItemListener { + // Don't throw an exception here. The awt event thread + // will NOT propagate your exception! + public void itemStateChanged(ItemEvent event) { + System.out.println("event: " + event); + myEvent = event; + } + } + } + + private ItemEvent myEvent; + } + +### I threw an exception, the output was sent to `System.err`, but my test still passed. What happened? + +Verify that the exception was not thrown by the event thread. The event +thread does not propagate exceptions. Furthermore, the event thread is in a +separate thread group and the harness cannot catch exceptions thrown from there. +It is _strongly_ recommended that all exceptions indicating failure of +the test be thrown from one of the methods called by the harness. +(i.e. `init()`, `start()`, `stop()`, +`destroy()`) + +### My `applet` action test didn't run my `main` method! + +`applet` action tests do not call `main`. A test +which uses the `applet` action is run by invoking its +`init`, `start`, and `setVisible(true)` +methods. Depending on the value of `manual`, the harness will pause +either for a few seconds or until the user clicks on the `pass`, +`fail`, or `done` buttons. Finally, the harness will invoke +the `stop` and `destroy` methods. + +The `main` method of an `applet` action will only be +used if the test was run outside of the harness. + +### If I have an applet test, do I put the test description in the `.html` file or the `.java` file? + +It doesn't matter. When `jtreg` is run on a test suite or +directory, the test description will be found regardless of the file +particulars. When running a single test, `jtreg` must be invoked on +the file which contains the test description. + +### For my `/manual` tests, how do I provide the user instructions to run the test? + +User instructions should be provided in the applet's HTML file. The +uninterpreted HTML file will be displayed by the `applet` action in +a TextArea labelled `html file instructions:`. + +### For `/manual` tests, how is the initial size of the running applet determined? + +The size of the applet is statically determined by the +`height` and `width` attributes provided to the HTML +`applet` tag. The applet interface provides a way to dynamically +change the size of the applet by setting the `applet size:` to +"`variable`". + +-------- + +## Deciphering Common Harness Errors + +### `Failed. Unexpected exit from test` + +**Answer:** The test has completed in an unexpected manner. +This could be caused by some sort of fault (e.g. a segmentation fault) +or because the harness has detected a call to `System.exit` +from the test. + +Tests are not allowed to call `System.exit` because the +test must have the ability to run in the same JVM as the harness. +Calling `System.exit` while the test is running in this +manner whould cause the harness itself to exit! Instead of calling +`System.exit()`, throw an exception. + +Be warned that the AWT event thread does not propagate exceptions, +so if the test was exiting from the event thread, it is not sufficient +to simply throw an exception. The test must set some variable which +can be used to throw an exception from one of the methods called by +the harness. (i.e. `init()`, `start()`, +`stop()`, or `destroy()`) + +### `Error. Can't find 'main' method` + +**More symptoms**: In `System.err`, you get a stack trace +for an `java.lang.NoSuchMethodException` and some harness messages. + + java.lang.NoSuchMethodException + at java.lang.Class.getMethod(Class.java) + at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:89) + at java.lang.Thread.run(Thread.java) + + JavaTest Message: main() method must be in a public class named + JavaTest Message: ClassNotPublic in file ClassNotPublic.java + +**Answer**: The class defining the test must be declared +`public` and the class name must be the basename of the +`.java` file; otherwise the harness will not be able to use reflection +to invoke the test. + +### `Error. Parse Exception: No class provided for 'main'` + +**Answer**: An `@run main` tag was provided +without the required class name. Either provide the name of the class +or remove the line entirely if appropriate. + +The line may be removed without impacting the test if all of the following +criteria are met: + +* The file containing the test description has the `.java` extension. +* This is the only `@run` tag in the test description. +* No options to `main` are required + +In removing the line, we take advantage of the default action for `.java` files. + +### `Error. Parse Exception: 'applet' requires exactly one file argument` + +**Answer**: The applet action requires a single argument which should +be the name of the `.html` file which contains (at minimum) the HTML +`applet` tag. + +### `Error. Parse Exception: 'archive' not supported in file:` … + +**More Symptoms**: The test is an `applet` action test. +The HTML `applet` tag includes the `archive` attribute. + +**Answer**: The regression extensions to the harness do not support the +`archive` attribute. + +### `test results: no tests selected` + +**More Symptoms**: At a terminal window, you get: + + test results: no tests selected + Report written to /home/iag/work/doc/JTreport/report.html + Results written to /home/iag/work/doc/JTwork + +**Answer**: No test descriptions were found by +`jtreg` in the file or directory specified. If the +`-automatic` option to `jtreg` was provided, +then there were no tests which did not include the +`/manual` tag option. + +Verify that the first tag of each test description is `@test`. + +### `Test does not have unique name within work directory` + +**More Symptoms**: At a terminal window, you get: + + Error: + -- Test does not have unique name within work directory + -- Test name: Duplicate + -- Used by test: Duplicate.java + -- And by test: Duplicate.html + -- Overwriting results of first test + +A single directory contains more than one file with the same basename. + +**Answer**: The two files contain descriptions of tests and the harness is +unable to determine a unique [`.jtr`](#jtr-file) filename so +the harness will overwrite the results of the first test. It is possible to have +a single directory with more than one file with the same basename; however, +only one of those files may have a test description (`@test` is the +first token of the comment). + +If both files contain identical test descriptions, select one file to +contain the primary test description. Disable the other test description by +either removal of the entire comment or simply the `@test` tag. + +If the files contain unique test descriptions, one of the basefile names must +be changed. + +### `Error. JUnit not available` + +To run JUnit tests within jtreg, you must have a copy of junit.jar +available. To do this, you should do one of the following: + +* Put junit.jar on the classpath used to run jtreg. +* You can specify the location by setting the system property `junit.jar` +* Install a copy in the *jtreg*`/lib` directory if it is not already present. + +If you do not have a copy of junit.jar on your system, you can download +it from the [JUnit home page](http://junit.org/). + +_Note:_ recent builds of jtreg automatically include a copy of JUnit to run tests. + +### `JavaTest Message: Problem cleaning up the following threads:` + +**More symptoms**: After the message, jtreg lists the stacktrace for +one or more threads started by the test code. + +**Answer**: When you run tests in agentVM mode, jtreg will try to +ensure that any threads started by the test have terminated, so that +they don't affect any code that might run subsequently in the same JVM. +It does this by checking for the presence of any threads in the +thread group that was created to run the main test code. If there +are any such threads, jtreg will periodically interrupt them, until +a timeout has been reached, at which point the message in question +will be reported and the test will be reported as having an error. + +### Incompatible kind of JDK used to compile or run tests (...) with that used to run jtreg (...) + +**Answer**: When using Windows Subsystem for Linux (WSL) to run jtreg, +or to run shell tests within jtreg, it is possible to run tests on either +a Windows JDK or a Linux JDK. However, there is a restriction that to run +tests on a Linux JDK, you must also use a Linux JDK to run jtreg itself. +(It need not be the same instance or same version of JDK). +Likewise, to run tests on a Windows JDK, you must also use a Windows +JDK to run jtreg itself. (Again, it need not be the same instance or +the same version.) + +If you see this message, you are trying to run jtreg on one kind of JDK, +and use a different kind of JDK to compile or run the tests. diff -Nru jtreg-4.2-b13/src/share/doc/javatest/regtest/tag-spec.html jtreg-4.2-b14/src/share/doc/javatest/regtest/tag-spec.html --- jtreg-4.2-b13/src/share/doc/javatest/regtest/tag-spec.html 2018-07-27 20:57:45.000000000 +0000 +++ jtreg-4.2-b14/src/share/doc/javatest/regtest/tag-spec.html 2019-02-07 19:19:28.000000000 +0000 @@ -24,7 +24,6 @@ - The JDK Test Framework: Tag Language Specification