diff --git a/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupport.xml b/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupport.xml index 63432cb50e..0c3d5990bb 100644 --- a/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupport.xml +++ b/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupport.xml @@ -1,7 +1,7 @@ - + @@ -35,8 +35,8 @@ - - + + diff --git a/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupport2.java b/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupport2.java index 79e8809f32..fc3908461f 100644 --- a/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupport2.java +++ b/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupport2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,6 +81,7 @@ public class CatalogSupport2 extends CatalogSupportBase { public void setUpClass() throws Exception { setUp(); setSystemProperty(SP_USE_CATALOG, "false"); + setSystemProperty(SP_ACCESS_EXTERNAL_DTD, "file"); timeoutRead = getSystemProperty(TTIMEOUTREAD); timeoutConnect = getSystemProperty(TIMEOUTCONNECT); setSystemProperty(TTIMEOUTREAD, "1000"); @@ -90,6 +91,7 @@ public class CatalogSupport2 extends CatalogSupportBase { @AfterClass public void tearDownClass() throws Exception { clearSystemProperty(SP_USE_CATALOG); + clearSystemProperty(SP_ACCESS_EXTERNAL_DTD); setSystemProperty(TIMEOUTCONNECT, "-1"); setSystemProperty(TTIMEOUTREAD, "-1"); } @@ -97,7 +99,7 @@ public class CatalogSupport2 extends CatalogSupportBase { /* Verifies the Catalog support on SAXParser. */ - @Test(dataProvider = "data_SAXC", expectedExceptions = IOException.class) + @Test(dataProvider = "data_SAXC", expectedExceptions = SAXParseException.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 +108,7 @@ public class CatalogSupport2 extends CatalogSupportBase { /* Verifies the Catalog support on XMLReader. */ - @Test(dataProvider = "data_SAXC", expectedExceptions = IOException.class) + @Test(dataProvider = "data_SAXC", expectedExceptions = SAXParseException.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 +126,7 @@ public class CatalogSupport2 extends CatalogSupportBase { /* Verifies the Catalog support on DOM parser. */ - @Test(dataProvider = "data_DOMC", expectedExceptions = IOException.class) + @Test(dataProvider = "data_DOMC", expectedExceptions = SAXParseException.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); @@ -133,7 +135,7 @@ public class CatalogSupport2 extends CatalogSupportBase { /* Verifies the Catalog support on XMLStreamReader. */ - @Test(dataProvider = "data_StAXC") + @Test(dataProvider = "data_StAXC", expectedExceptions = XMLStreamException.class) public void testStAXC(boolean setUseCatalog, boolean useCatalog, String catalog, String xml, XMLResolver resolver, String expected) throws Exception { testStAXNegative(setUseCatalog, useCatalog, catalog, xml, resolver, expected); diff --git a/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupport3.java b/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupport3.java index 8868b50b05..83083a418f 100644 --- a/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupport3.java +++ b/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupport3.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,7 @@ package catalog; +import static jaxp.library.JAXPTestUtilities.clearSystemProperty; import static jaxp.library.JAXPTestUtilities.getSystemProperty; import static jaxp.library.JAXPTestUtilities.setSystemProperty; @@ -82,18 +83,20 @@ public class CatalogSupport3 extends CatalogSupportBase { timeoutConnect = getSystemProperty(TIMEOUTCONNECT); setSystemProperty(TTIMEOUTREAD, "1000"); setSystemProperty(TIMEOUTCONNECT, "1000"); + setSystemProperty(SP_ACCESS_EXTERNAL_DTD, "file"); } @AfterClass public void tearDownClass() throws Exception { setSystemProperty(TIMEOUTCONNECT, "-1"); setSystemProperty(TTIMEOUTREAD, "-1"); + clearSystemProperty(SP_ACCESS_EXTERNAL_DTD); } /* Verifies the Catalog support on SAXParser. */ - @Test(dataProvider = "data_SAXC", expectedExceptions = IOException.class) + @Test(dataProvider = "data_SAXC", expectedExceptions = SAXParseException.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 +105,7 @@ public class CatalogSupport3 extends CatalogSupportBase { /* Verifies the Catalog support on XMLReader. */ - @Test(dataProvider = "data_SAXC", expectedExceptions = IOException.class) + @Test(dataProvider = "data_SAXC", expectedExceptions = SAXParseException.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 +123,7 @@ public class CatalogSupport3 extends CatalogSupportBase { /* Verifies the Catalog support on DOM parser. */ - @Test(dataProvider = "data_DOMC", expectedExceptions = IOException.class) + @Test(dataProvider = "data_DOMC", expectedExceptions = SAXParseException.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); @@ -129,7 +132,7 @@ public class CatalogSupport3 extends CatalogSupportBase { /* Verifies the Catalog support on XMLStreamReader. */ - @Test(dataProvider = "data_StAXC") + @Test(dataProvider = "data_StAXC", expectedExceptions = XMLStreamException.class) public void testStAXC(boolean setUseCatalog, boolean useCatalog, String catalog, String xml, XMLResolver resolver, String expected) throws Exception { testStAXNegative(setUseCatalog, useCatalog, catalog, xml, resolver, expected); diff --git a/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupportBase.java b/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupportBase.java index 0f603014c8..12520f6418 100644 --- a/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupportBase.java +++ b/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupportBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -90,6 +90,7 @@ import org.xml.sax.ext.DefaultHandler2; public class CatalogSupportBase { // the System Property for the USE_CATALOG feature final static String SP_USE_CATALOG = "javax.xml.useCatalog"; + final static String SP_ACCESS_EXTERNAL_DTD = "javax.xml.accessExternalDTD"; boolean debug = false; @@ -232,7 +233,7 @@ public class CatalogSupportBase { + "" + ""; xsl_includeDTD = "" - + "" + + "" + "" + " " + " " @@ -262,7 +263,7 @@ public class CatalogSupportBase { ""; xml_xslDTD = "\n" + - "" + + "" + "\n" + "
This is the header
\n" + " Some content\n" + diff --git a/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupport_uri.xml b/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupport_uri.xml index 8a4b0dbf29..9145ad9a3f 100644 --- a/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupport_uri.xml +++ b/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogSupport_uri.xml @@ -1,7 +1,7 @@ - + @@ -34,8 +34,8 @@ - - + + diff --git a/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogTest.java b/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogTest.java index 9972328e10..cd491ac8a1 100644 --- a/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogTest.java +++ b/test/jaxp/javax/xml/jaxp/unittest/catalog/CatalogTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -654,7 +654,7 @@ public class CatalogTest extends CatalogSupportBase { }; } - static String id = "http://openjdk.java.net/xml/catalog/dtd/system.dtd"; + static String id = "http://openjdk_java_net/xml/catalog/dtd/system.dtd"; /* DataProvider: used to verify how prefer settings affect the result of the Catalog's matching operation. diff --git a/test/jaxp/javax/xml/jaxp/unittest/catalog/catalog.xml b/test/jaxp/javax/xml/jaxp/unittest/catalog/catalog.xml index 0c25770bf3..86459cabc0 100644 --- a/test/jaxp/javax/xml/jaxp/unittest/catalog/catalog.xml +++ b/test/jaxp/javax/xml/jaxp/unittest/catalog/catalog.xml @@ -9,12 +9,12 @@ uri="file:///share/mirrors/w3c/xhtml1/xhtml1-strict.dtd"/> - + - - diff --git a/test/jaxp/javax/xml/jaxp/unittest/catalog/catalog_uri.xml b/test/jaxp/javax/xml/jaxp/unittest/catalog/catalog_uri.xml index 26adf0f3f0..59593748b3 100644 --- a/test/jaxp/javax/xml/jaxp/unittest/catalog/catalog_uri.xml +++ b/test/jaxp/javax/xml/jaxp/unittest/catalog/catalog_uri.xml @@ -3,11 +3,11 @@ xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> - - + - diff --git a/test/jaxp/javax/xml/jaxp/unittest/catalog/pubOnly.xml b/test/jaxp/javax/xml/jaxp/unittest/catalog/pubOnly.xml index 3ff20afff2..ce4a904369 100644 --- a/test/jaxp/javax/xml/jaxp/unittest/catalog/pubOnly.xml +++ b/test/jaxp/javax/xml/jaxp/unittest/catalog/pubOnly.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/test/jaxp/javax/xml/jaxp/unittest/catalog/rewritesystem.xml b/test/jaxp/javax/xml/jaxp/unittest/catalog/rewritesystem.xml index 44a4ed4267..fd0cd24cb6 100644 --- a/test/jaxp/javax/xml/jaxp/unittest/catalog/rewritesystem.xml +++ b/test/jaxp/javax/xml/jaxp/unittest/catalog/rewritesystem.xml @@ -1,5 +1,5 @@ + "http://openjdk_java_net/xml/catalog/dtd/rewritesystem.dtd"> Test &rewritesystem; entry \ No newline at end of file diff --git a/test/jaxp/javax/xml/jaxp/unittest/catalog/rewritesystem1.xml b/test/jaxp/javax/xml/jaxp/unittest/catalog/rewritesystem1.xml index de5cd0c60f..709a034b77 100644 --- a/test/jaxp/javax/xml/jaxp/unittest/catalog/rewritesystem1.xml +++ b/test/jaxp/javax/xml/jaxp/unittest/catalog/rewritesystem1.xml @@ -1,5 +1,5 @@ + "http://openjdk_java_net/rewritesystem.dtd"> Test &rewritesystem; entry \ No newline at end of file diff --git a/test/jaxp/javax/xml/jaxp/unittest/catalog/sysAndPub.xml b/test/jaxp/javax/xml/jaxp/unittest/catalog/sysAndPub.xml index fd896c654b..bae399209b 100644 --- a/test/jaxp/javax/xml/jaxp/unittest/catalog/sysAndPub.xml +++ b/test/jaxp/javax/xml/jaxp/unittest/catalog/sysAndPub.xml @@ -1,7 +1,7 @@ - - + + \ No newline at end of file diff --git a/test/jaxp/javax/xml/jaxp/unittest/catalog/sysOnly.xml b/test/jaxp/javax/xml/jaxp/unittest/catalog/sysOnly.xml index 8c6206bae7..1d4daa2d00 100644 --- a/test/jaxp/javax/xml/jaxp/unittest/catalog/sysOnly.xml +++ b/test/jaxp/javax/xml/jaxp/unittest/catalog/sysOnly.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/test/jaxp/javax/xml/jaxp/unittest/catalog/system.xml b/test/jaxp/javax/xml/jaxp/unittest/catalog/system.xml index 0ceb2c633d..63e039c6c4 100644 --- a/test/jaxp/javax/xml/jaxp/unittest/catalog/system.xml +++ b/test/jaxp/javax/xml/jaxp/unittest/catalog/system.xml @@ -1,5 +1,5 @@ + "http://openjdk_java_net/xml/catalog/dtd/system.dtd"> Test &system; entry diff --git a/test/jaxp/javax/xml/jaxp/unittest/catalog/systemsuffix.xml b/test/jaxp/javax/xml/jaxp/unittest/catalog/systemsuffix.xml index dc4f6abf60..c8b526c238 100644 --- a/test/jaxp/javax/xml/jaxp/unittest/catalog/systemsuffix.xml +++ b/test/jaxp/javax/xml/jaxp/unittest/catalog/systemsuffix.xml @@ -1,5 +1,5 @@ + "http://openjdk_java_net/xml/catalog/dtd/systemsuffix.dtd"> Test &systemsuffix; entry \ No newline at end of file diff --git a/test/jaxp/javax/xml/jaxp/unittest/catalog/val_test.xml b/test/jaxp/javax/xml/jaxp/unittest/catalog/val_test.xml index b428752656..e29fc94fc1 100644 --- a/test/jaxp/javax/xml/jaxp/unittest/catalog/val_test.xml +++ b/test/jaxp/javax/xml/jaxp/unittest/catalog/val_test.xml @@ -1,6 +1,6 @@ + "http://openjdk_java_net/xml/catalog/dtd/system.dtd">