< prev index next >

test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserTest03.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1999, 2015, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 1999, 2016, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 21,49 **** * questions. */ package javax.xml.parsers.ptests; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; import java.io.File; ! import java.io.FilePermission; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; ! import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR; ! import jaxp.library.JAXPFileReadOnlyBaseTest; ! import static org.testng.Assert.fail; ! import org.testng.annotations.AfterGroups; ! import org.testng.annotations.BeforeGroups; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import org.xml.sax.SAXException; /** * Class contains the test cases for SAXParser API */ ! public class SAXParserTest03 extends JAXPFileReadOnlyBaseTest { /** * Provide SAXParserFactory. * * @return a dimensional contains. --- 21,50 ---- * questions. */ package javax.xml.parsers.ptests; + import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; + import static org.testng.Assert.fail; + import java.io.File; ! import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; ! import org.testng.annotations.DataProvider; + import org.testng.annotations.Listeners; import org.testng.annotations.Test; import org.xml.sax.SAXException; /** * Class contains the test cases for SAXParser API */ ! @Listeners({jaxp.library.FilePolicy.class}) ! public class SAXParserTest03 { /** * Provide SAXParserFactory. * * @return a dimensional contains.
*** 61,71 **** * * @param spf a Parser factory. * @param handler an error handler for capturing events. * @throws Exception If any errors occur. */ ! @Test(groups = {"readLocalFiles"}, dataProvider = "input-provider") public void testParseValidate01(SAXParserFactory spf, MyErrorHandler handler) throws Exception { spf.newSAXParser().parse(new File(XML_DIR, "parsertest.xml"), handler); assertFalse(handler.isErrorOccured()); } --- 62,72 ---- * * @param spf a Parser factory. * @param handler an error handler for capturing events. * @throws Exception If any errors occur. */ ! @Test(dataProvider = "input-provider") public void testParseValidate01(SAXParserFactory spf, MyErrorHandler handler) throws Exception { spf.newSAXParser().parse(new File(XML_DIR, "parsertest.xml"), handler); assertFalse(handler.isErrorOccured()); }
*** 76,86 **** * * @param spf a Parser factory. * @param handler an error handler for capturing events. * @throws Exception If any errors occur. */ ! @Test(groups = {"readLocalFiles"}, dataProvider = "input-provider") public void testParseValidate02(SAXParserFactory spf, MyErrorHandler handler) throws Exception { spf.setNamespaceAware(true); spf.newSAXParser().parse(new File(XML_DIR, "validns.xml"), handler); assertFalse(handler.isErrorOccured()); --- 77,87 ---- * * @param spf a Parser factory. * @param handler an error handler for capturing events. * @throws Exception If any errors occur. */ ! @Test(dataProvider = "input-provider") public void testParseValidate02(SAXParserFactory spf, MyErrorHandler handler) throws Exception { spf.setNamespaceAware(true); spf.newSAXParser().parse(new File(XML_DIR, "validns.xml"), handler); assertFalse(handler.isErrorOccured());
*** 93,103 **** * * @param spf a Parser factory. * @param handler an error handler for capturing events. * @throws Exception If any errors occur. */ ! @Test(groups = {"readLocalFiles"}, dataProvider = "input-provider") public void testParseValidate03(SAXParserFactory spf, MyErrorHandler handler) throws Exception { try { spf.setNamespaceAware(true); SAXParser saxparser = spf.newSAXParser(); --- 94,104 ---- * * @param spf a Parser factory. * @param handler an error handler for capturing events. * @throws Exception If any errors occur. */ ! @Test(dataProvider = "input-provider") public void testParseValidate03(SAXParserFactory spf, MyErrorHandler handler) throws Exception { try { spf.setNamespaceAware(true); SAXParser saxparser = spf.newSAXParser();
< prev index next >