# HG changeset patch # User duke # Date 1499285103 -7200 # Node ID 0137b0d9934afeccb330561cf645344714edc80e # Parent c75a04d91fda76395822b9ce799bc855c523ee4d# Parent 5202b5dddee0767941b69d848c29d2ddc51e0475 Merge diff -r 5202b5dddee0 -r 0137b0d9934a jaxp/.hgtags --- a/jaxp/.hgtags Wed Jul 05 22:04:55 2017 +0200 +++ b/jaxp/.hgtags Wed Jul 05 22:05:03 2017 +0200 @@ -373,3 +373,4 @@ 8a7681a9d70640ac7fbf05c28f53c1d51d8d00a1 jdk-9+128 74241304e87b0d463391a8ecab40979b5af86dc2 jdk-9+129 e66cdc2de6b02443911d386fc9217b0d824d0686 jdk-9+130 +874082a9b565a7092a40bfa934a6e3e3c3455a60 jdk-9+131 diff -r 5202b5dddee0 -r 0137b0d9934a jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/message.properties --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/message.properties Wed Jul 05 22:04:55 2017 +0200 +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/message.properties Wed Jul 05 22:05:03 2017 +0200 @@ -37,5 +37,3 @@ parser.quantifier.3=Invalid quantifier. A digit or '}' is expected. parser.quantifier.4=Invalid quantifier. A min quantity must be <= a max quantity. parser.quantifier.5=Invalid quantifier. A quantity value overflow. -null -null diff -r 5202b5dddee0 -r 0137b0d9934a jaxp/test/TEST.ROOT --- a/jaxp/test/TEST.ROOT Wed Jul 05 22:04:55 2017 +0200 +++ b/jaxp/test/TEST.ROOT Wed Jul 05 22:05:03 2017 +0200 @@ -23,4 +23,7 @@ groups=TEST.groups # Minimum jtreg version -requiredVersion=4.2 b02 +requiredVersion=4.2 b03 + +# Use new module options +useNewOptions=true diff -r 5202b5dddee0 -r 0137b0d9934a jaxp/test/javax/xml/jaxp/libs/jaxp/library/BasePolicy.java --- a/jaxp/test/javax/xml/jaxp/libs/jaxp/library/BasePolicy.java Wed Jul 05 22:04:55 2017 +0200 +++ b/jaxp/test/javax/xml/jaxp/libs/jaxp/library/BasePolicy.java Wed Jul 05 22:05:03 2017 +0200 @@ -37,7 +37,7 @@ try { JAXPPolicyManager.teardownPolicyManager(); } catch (Exception e) { - throw new RuntimeException("Failed to teardonw the policy manager", e); + throw new RuntimeException("Failed to teardown the policy manager", e); } } diff -r 5202b5dddee0 -r 0137b0d9934a jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogSupport2.java --- a/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogSupport2.java Wed Jul 05 22:04:55 2017 +0200 +++ b/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogSupport2.java Wed Jul 05 22:05:03 2017 +0200 @@ -28,10 +28,8 @@ import static jaxp.library.JAXPTestUtilities.setSystemProperty; import java.io.File; -import java.io.FileNotFoundException; +import java.io.IOException; import java.io.StringReader; -import java.net.SocketTimeoutException; - import javax.xml.transform.Source; import javax.xml.transform.TransformerException; import javax.xml.transform.URIResolver; @@ -52,7 +50,7 @@ /* * @test - * @bug 8158084 8162438 8162442 + * @bug 8158084 8162438 8162442 8163535 * @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest * @run testng/othervm -DrunSecMngr=true catalog.CatalogSupport2 * @run testng/othervm catalog.CatalogSupport2 @@ -97,7 +95,7 @@ /* Verifies the Catalog support on SAXParser. */ - @Test(dataProvider = "data_SAXC", expectedExceptions = FileNotFoundException.class) + @Test(dataProvider = "data_SAXC", expectedExceptions = IOException.class) public void testSAXC(boolean setUseCatalog, boolean useCatalog, String catalog, String xml, MyHandler handler, String expected) throws Exception { testSAX(setUseCatalog, useCatalog, catalog, xml, handler, expected); @@ -106,7 +104,7 @@ /* Verifies the Catalog support on XMLReader. */ - @Test(dataProvider = "data_SAXC", expectedExceptions = FileNotFoundException.class) + @Test(dataProvider = "data_SAXC", expectedExceptions = IOException.class) public void testXMLReaderC(boolean setUseCatalog, boolean useCatalog, String catalog, String xml, MyHandler handler, String expected) throws Exception { testXMLReader(setUseCatalog, useCatalog, catalog, xml, handler, expected); @@ -124,7 +122,7 @@ /* Verifies the Catalog support on DOM parser. */ - @Test(dataProvider = "data_DOMC", expectedExceptions = {FileNotFoundException.class, SocketTimeoutException.class}) + @Test(dataProvider = "data_DOMC", expectedExceptions = IOException.class) public void testDOMC(boolean setUseCatalog, boolean useCatalog, String catalog, String xml, MyHandler handler, String expected) throws Exception { testDOM(setUseCatalog, useCatalog, catalog, xml, handler, expected); @@ -141,7 +139,7 @@ testValidation(setUseCatalog, useCatalog, catalog, xsd, resolver) ; } - @Test(dataProvider = "data_ValidatorC", expectedExceptions = {SAXException.class, FileNotFoundException.class}) + @Test(dataProvider = "data_ValidatorC", expectedExceptions = {SAXException.class, IOException.class}) public void testValidatorC(boolean setUseCatalog1, boolean setUseCatalog2, boolean useCatalog, Source source, LSResourceResolver resolver1, LSResourceResolver resolver2, String catalog1, String catalog2) diff -r 5202b5dddee0 -r 0137b0d9934a jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogSupport3.java --- a/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogSupport3.java Wed Jul 05 22:04:55 2017 +0200 +++ b/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogSupport3.java Wed Jul 05 22:05:03 2017 +0200 @@ -27,10 +27,8 @@ import static jaxp.library.JAXPTestUtilities.setSystemProperty; import java.io.File; -import java.io.FileNotFoundException; +import java.io.IOException; import java.io.StringReader; -import java.net.SocketTimeoutException; - import javax.xml.transform.Source; import javax.xml.transform.TransformerException; import javax.xml.transform.URIResolver; @@ -51,7 +49,7 @@ /* * @test - * @bug 8158084 8162438 8162442 + * @bug 8158084 8162438 8162442 8163535 * @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest * @run testng/othervm -DrunSecMngr=true catalog.CatalogSupport3 * @run testng/othervm catalog.CatalogSupport3 @@ -93,7 +91,7 @@ /* Verifies the Catalog support on SAXParser. */ - @Test(dataProvider = "data_SAXC", expectedExceptions = FileNotFoundException.class) + @Test(dataProvider = "data_SAXC", expectedExceptions = IOException.class) public void testSAXC(boolean setUseCatalog, boolean useCatalog, String catalog, String xml, MyHandler handler, String expected) throws Exception { testSAX(setUseCatalog, useCatalog, catalog, xml, handler, expected); @@ -102,7 +100,7 @@ /* Verifies the Catalog support on XMLReader. */ - @Test(dataProvider = "data_SAXC", expectedExceptions = FileNotFoundException.class) + @Test(dataProvider = "data_SAXC", expectedExceptions = IOException.class) public void testXMLReaderC(boolean setUseCatalog, boolean useCatalog, String catalog, String xml, MyHandler handler, String expected) throws Exception { testXMLReader(setUseCatalog, useCatalog, catalog, xml, handler, expected); @@ -120,7 +118,7 @@ /* Verifies the Catalog support on DOM parser. */ - @Test(dataProvider = "data_DOMC", expectedExceptions = {FileNotFoundException.class, SocketTimeoutException.class}) + @Test(dataProvider = "data_DOMC", expectedExceptions = IOException.class) public void testDOMC(boolean setUseCatalog, boolean useCatalog, String catalog, String xml, MyHandler handler, String expected) throws Exception { testDOM(setUseCatalog, useCatalog, catalog, xml, handler, expected); @@ -141,7 +139,7 @@ @bug 8158084 8162438 these tests also verifies the fix for 8162438 Verifies the Catalog support on the Schema Validator. */ - @Test(dataProvider = "data_ValidatorC", expectedExceptions = {SAXException.class, FileNotFoundException.class}) + @Test(dataProvider = "data_ValidatorC", expectedExceptions = {SAXException.class, IOException.class}) public void testValidatorC(boolean setUseCatalog1, boolean setUseCatalog2, boolean useCatalog, Source source, LSResourceResolver resolver1, LSResourceResolver resolver2, String catalog1, String catalog2) diff -r 5202b5dddee0 -r 0137b0d9934a jaxp/test/javax/xml/jaxp/unittest/validation/Bug6773084Test.java --- a/jaxp/test/javax/xml/jaxp/unittest/validation/Bug6773084Test.java Wed Jul 05 22:04:55 2017 +0200 +++ b/jaxp/test/javax/xml/jaxp/unittest/validation/Bug6773084Test.java Wed Jul 05 22:05:03 2017 +0200 @@ -32,11 +32,10 @@ import java.util.concurrent.CyclicBarrier; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import javax.xml.XMLConstants; -import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Source; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamSource; @@ -69,6 +68,7 @@ private static final ExecutorService EXEC = Executors.newCachedThreadPool(); private static final CyclicBarrier BARRIER = new CyclicBarrier(NTHREADS); + private static final int TIMEOUT = 110; public static final String IN_FOLDER = Bug6773084Test.class.getResource("Bug6773084In").getPath(); public static final String XSD_PATH = Bug6773084Test.class.getResource("Bug6773084.xsd").getPath(); @@ -93,20 +93,23 @@ } }); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + for (int i = 0; i < files.length; i++) { - EXEC.execute(new XMLValiddator(files[i], i)); + EXEC.execute(new XMLValiddator(dbf.newDocumentBuilder().parse(files[i]), i)); } runWithAllPerm(() -> EXEC.shutdown()); - + EXEC.awaitTermination(TIMEOUT, TimeUnit.SECONDS); } private static class XMLValiddator implements Runnable { - private File file; + private Document document; private int index; - public XMLValiddator(File file, int index) { - this.file = file; + public XMLValiddator(Document document, int index) { + this.document = document; this.index = index; } @@ -117,23 +120,14 @@ BARRIER.await(); System.out.println("Validating...."); - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setNamespaceAware(true); - - DocumentBuilder builder = factory.newDocumentBuilder(); - Document document = builder.parse(file); - Validator validator = schema.newValidator(); validator.setErrorHandler(new ErrorHandlerImpl()); validator.validate(new DOMSource(document)); - } catch (IOException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); Assert.fail("Test failed."); - } catch (ParserConfigurationException e) { - e.printStackTrace(); } catch (BrokenBarrierException e) { e.printStackTrace(); } catch (InterruptedException e) {