This test generates files in the test source directory, which is generally a bad thing to do.
Test:
jdk/test/javax/xml/bind/xjc/8032884/XjcOptionalPropertyTest.java
Files:
$ hg status -R jdk
? test/javax/xml/bind/xjc/8032884/generated/Foo.java
? test/javax/xml/bind/xjc/8032884/generated/ObjectFactory.java
? test/javax/xml/bind/xjc/8032884/generated/package-info.java
In particular, as shown, they show up as unknown files for Mercurial. Yes, they could be .hgignore'd, but it would be better to follow the normal rules and write temporary files to the scratch directory.
The problem is in this script:
jdk/test/javax/xml/bind/xjc/8032884/compile-schema.sh
which contains these lines:
echo "compiling [optional-property-schema.xsd] schema ..."
$TESTJAVA/bin/xjc -p generated -d ${TESTSRC} ${TESTSRC}/optional-property-schema.xsd
It may be writing the files to the ${TESTSRC} directory in order to leverage jtreg's ability to compile the classes and run them with the test. The easiest workaround is to compile the generated classes, and compile and run the test classes from the script. A better solution would be to eliminate the script and do everything in a test class written in Java.
Test:
jdk/test/javax/xml/bind/xjc/8032884/XjcOptionalPropertyTest.java
Files:
$ hg status -R jdk
? test/javax/xml/bind/xjc/8032884/generated/Foo.java
? test/javax/xml/bind/xjc/8032884/generated/ObjectFactory.java
? test/javax/xml/bind/xjc/8032884/generated/package-info.java
In particular, as shown, they show up as unknown files for Mercurial. Yes, they could be .hgignore'd, but it would be better to follow the normal rules and write temporary files to the scratch directory.
The problem is in this script:
jdk/test/javax/xml/bind/xjc/8032884/compile-schema.sh
which contains these lines:
echo "compiling [optional-property-schema.xsd] schema ..."
$TESTJAVA/bin/xjc -p generated -d ${TESTSRC} ${TESTSRC}/optional-property-schema.xsd
It may be writing the files to the ${TESTSRC} directory in order to leverage jtreg's ability to compile the classes and run them with the test. The easiest workaround is to compile the generated classes, and compile and run the test classes from the script. A better solution would be to eliminate the script and do everything in a test class written in Java.
- duplicates
-
JDK-8072579 XjcOptionalPropertyTest.java creates files in test.src
-
- Resolved
-