javax/xml/jaxp/module/ServiceProviderTest/BasicModularXMLParserTest.java
javax/xml/jaxp/module/ServiceProviderTest/LayerModularXMLParserTest.java
Fails if jdk/lib/stax.properties exist. This file seems created and left over by
javax/xml/jaxp/unittest/stream/FactoryFindTest.java:
@Test
public void testFactoryFindUsingStaxProperties() {
...
String configFile = System.getProperty("java.home") + File.separator + "lib" + File.separator + "stax.properties";
File f = new File(configFile);
if (f.exists()) {
try {
FileInputStream fis = new FileInputStream(f);
props.load(fis);
fis.close();
} catch (FileNotFoundException e) {
return;
} catch (IOException e) {
return;
}
} else {
props.setProperty(FACTORY_KEY, "com.sun.xml.internal.stream.XMLInputFactoryImpl");
try {
FileOutputStream fos = new FileOutputStream(f);
props.store(fos, null);
fos.close();
f.deleteOnExit();
} catch (FileNotFoundException e) {
return;
} catch (IOException e) {
return;
}
}
In case FactoryFindTest.java failed to delete it's created file jdk/lib/stax.properties, BasicModularXMLParserTest.java and LayerModularXMLParserTest.java then will fail:
Expect javax.xml.stream.XMLInputFactory is provided by module xmlprovider1, but actual implementation class com.sun.xml.internal.stream.XMLInputFactoryImpl is provided by module java.xml
Exception in thread "main" java.lang.AssertionError: 1 services are not provided by expected module
at Main.main(Main.java:63)
test BasicModularXMLParserTest.testWithTwoProvider(): failure
Need to move FactoryFindTest.java to isolatedjdk to fix this issue.
javax/xml/jaxp/module/ServiceProviderTest/LayerModularXMLParserTest.java
Fails if jdk/lib/stax.properties exist. This file seems created and left over by
javax/xml/jaxp/unittest/stream/FactoryFindTest.java:
@Test
public void testFactoryFindUsingStaxProperties() {
...
String configFile = System.getProperty("java.home") + File.separator + "lib" + File.separator + "stax.properties";
File f = new File(configFile);
if (f.exists()) {
try {
FileInputStream fis = new FileInputStream(f);
props.load(fis);
fis.close();
} catch (FileNotFoundException e) {
return;
} catch (IOException e) {
return;
}
} else {
props.setProperty(FACTORY_KEY, "com.sun.xml.internal.stream.XMLInputFactoryImpl");
try {
FileOutputStream fos = new FileOutputStream(f);
props.store(fos, null);
fos.close();
f.deleteOnExit();
} catch (FileNotFoundException e) {
return;
} catch (IOException e) {
return;
}
}
In case FactoryFindTest.java failed to delete it's created file jdk/lib/stax.properties, BasicModularXMLParserTest.java and LayerModularXMLParserTest.java then will fail:
Expect javax.xml.stream.XMLInputFactory is provided by module xmlprovider1, but actual implementation class com.sun.xml.internal.stream.XMLInputFactoryImpl is provided by module java.xml
Exception in thread "main" java.lang.AssertionError: 1 services are not provided by expected module
at Main.main(Main.java:63)
test BasicModularXMLParserTest.testWithTwoProvider(): failure
Need to move FactoryFindTest.java to isolatedjdk to fix this issue.
- relates to
-
JDK-8156513 Problem list javax/xml/jaxp/unittest/stream/FactoryFindTest.java
- Closed