< prev index next >

test/javax/xml/jaxp/unittest/catalog/CatalogSupport3.java

Print this page

        

*** 27,36 **** --- 27,38 ---- import static jaxp.library.JAXPTestUtilities.setSystemProperty; import java.io.File; import java.io.IOException; import java.io.StringReader; + import javax.xml.stream.XMLResolver; + import javax.xml.stream.XMLStreamException; import javax.xml.transform.Source; import javax.xml.transform.TransformerException; import javax.xml.transform.URIResolver; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.sax.SAXSource;
*** 47,57 **** import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; /* * @test ! * @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 * @summary extends CatalogSupport tests, verifies that the use of the Catalog may * be disabled through the API property. --- 49,59 ---- import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; /* * @test ! * @bug 8158084 8162438 8162442 8163535 8166220 * @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest * @run testng/othervm -DrunSecMngr=true catalog.CatalogSupport3 * @run testng/othervm catalog.CatalogSupport3 * @summary extends CatalogSupport tests, verifies that the use of the Catalog may * be disabled through the API property.
*** 123,132 **** --- 125,143 ---- String xml, MyHandler handler, String expected) throws Exception { testDOM(setUseCatalog, useCatalog, catalog, xml, handler, expected); } /* + Verifies the Catalog support on XMLStreamReader. + */ + @Test(dataProvider = "data_StAXC") + public void testStAXC(boolean setUseCatalog, boolean useCatalog, String catalog, + String xml, XMLResolver resolver, String expected) throws Exception { + testStAXNegative(setUseCatalog, useCatalog, catalog, xml, resolver, expected); + } + + /* Verifies the Catalog support on resolving DTD, xsd import and include in Schema files. */ @Test(dataProvider = "data_SchemaC", expectedExceptions = SAXParseException.class) public void testValidationC(boolean setUseCatalog, boolean useCatalog, String catalog,
*** 204,213 **** --- 215,235 ---- {true, false, xml_catalog, xml_system, new MyHandler(elementInSystem), expectedWCatalog} }; } /* + DataProvider: for testing the StAX parser + Data: set use_catalog, use_catalog, catalog file, xml file, handler, expected result string + */ + @DataProvider(name = "data_StAXC") + public Object[][] getDataStAX() { + return new Object[][]{ + {true, false, xml_catalog, xml_system, null, "null"}, + }; + } + + /* DataProvider: for testing Schema validation Data: set use_catalog, use_catalog, catalog file, xsd file, a LSResourceResolver */ @DataProvider(name = "data_SchemaC") public Object[][] getDataSchemaC() {
*** 232,243 **** DOMSource ds = getDOMSource(xml_val_test, xml_val_test_id, false, true, xml_catalog); SAXSource ss = new SAXSource(new InputSource(xml_val_test)); ss.setSystemId(xml_val_test_id); ! StAXSource stax = getStaxSource(xml_val_test, xml_val_test_id); ! StAXSource stax1 = getStaxSource(xml_val_test, xml_val_test_id); StreamSource source = new StreamSource(new File(xml_val_test)); return new Object[][]{ // use catalog disabled through factory --- 254,265 ---- DOMSource ds = getDOMSource(xml_val_test, xml_val_test_id, false, true, xml_catalog); SAXSource ss = new SAXSource(new InputSource(xml_val_test)); ss.setSystemId(xml_val_test_id); ! StAXSource stax = getStaxSource(xml_val_test, xml_val_test_id, false, true, xml_catalog); ! StAXSource stax1 = getStaxSource(xml_val_test, xml_val_test_id, false, true, xml_catalog); StreamSource source = new StreamSource(new File(xml_val_test)); return new Object[][]{ // use catalog disabled through factory
< prev index next >