< prev index next >

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

Print this page


   1 /*
   2  * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 package javax.xml.parsers.ptests;
  25 


  26 import static jaxp.library.JAXPTestUtilities.USER_DIR;
  27 import static jaxp.library.JAXPTestUtilities.compareWithGold;
  28 import static org.testng.Assert.assertTrue;

  29 import java.io.File;

  30 import javax.xml.parsers.DocumentBuilderFactory;
  31 import static javax.xml.parsers.ptests.ParserTestConst.GOLDEN_DIR;
  32 import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
  33 import javax.xml.transform.TransformerFactory;
  34 import javax.xml.transform.dom.DOMSource;
  35 import javax.xml.transform.sax.SAXResult;
  36 import jaxp.library.JAXPFileBaseTest;
  37 import org.testng.annotations.DataProvider;

  38 import org.testng.annotations.Test;
  39 import org.w3c.dom.Document;
  40 
  41 /**
  42  * This tests DocumentBuilderFactory for namespace processing and no-namespace
  43  * processing.
  44  */
  45 public class DBFNamespaceTest extends JAXPFileBaseTest {

  46 
  47     /**
  48      * Provide input for the cases that supporting namespace or not.
  49      * @return a two-dimensional array contains factory, output file name and
  50      *         golden validate file name.
  51      */
  52     @DataProvider(name = "input-provider")
  53     public Object[][] getInput() {
  54         DocumentBuilderFactory dbf1 = DocumentBuilderFactory.newInstance();
  55         String outputfile1 = USER_DIR + "dbfnstest01.out";
  56         String goldfile1 = GOLDEN_DIR + "dbfnstest01GF.out";
  57 
  58         DocumentBuilderFactory dbf2 = DocumentBuilderFactory.newInstance();
  59         dbf2.setNamespaceAware(true);
  60         String outputfile2 = USER_DIR + "dbfnstest02.out";
  61         String goldfile2 = GOLDEN_DIR + "dbfnstest02GF.out";
  62         return new Object[][] { { dbf1, outputfile1, goldfile1 }, { dbf2, outputfile2, goldfile2 } };
  63     }
  64 
  65     /**


   1 /*
   2  * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 package javax.xml.parsers.ptests;
  25 
  26 import static javax.xml.parsers.ptests.ParserTestConst.GOLDEN_DIR;
  27 import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
  28 import static jaxp.library.JAXPTestUtilities.USER_DIR;
  29 import static jaxp.library.JAXPTestUtilities.compareWithGold;
  30 import static org.testng.Assert.assertTrue;
  31 
  32 import java.io.File;
  33 
  34 import javax.xml.parsers.DocumentBuilderFactory;


  35 import javax.xml.transform.TransformerFactory;
  36 import javax.xml.transform.dom.DOMSource;
  37 import javax.xml.transform.sax.SAXResult;
  38 
  39 import org.testng.annotations.DataProvider;
  40 import org.testng.annotations.Listeners;
  41 import org.testng.annotations.Test;
  42 import org.w3c.dom.Document;
  43 
  44 /**
  45  * This tests DocumentBuilderFactory for namespace processing and no-namespace
  46  * processing.
  47  */
  48 @Listeners({jaxp.library.FilePolicy.class})
  49 public class DBFNamespaceTest {
  50 
  51     /**
  52      * Provide input for the cases that supporting namespace or not.
  53      * @return a two-dimensional array contains factory, output file name and
  54      *         golden validate file name.
  55      */
  56     @DataProvider(name = "input-provider")
  57     public Object[][] getInput() {
  58         DocumentBuilderFactory dbf1 = DocumentBuilderFactory.newInstance();
  59         String outputfile1 = USER_DIR + "dbfnstest01.out";
  60         String goldfile1 = GOLDEN_DIR + "dbfnstest01GF.out";
  61 
  62         DocumentBuilderFactory dbf2 = DocumentBuilderFactory.newInstance();
  63         dbf2.setNamespaceAware(true);
  64         String outputfile2 = USER_DIR + "dbfnstest02.out";
  65         String goldfile2 = GOLDEN_DIR + "dbfnstest02GF.out";
  66         return new Object[][] { { dbf1, outputfile1, goldfile1 }, { dbf2, outputfile2, goldfile2 } };
  67     }
  68 
  69     /**


< prev index next >