OSDN Git Service

original
[gb-231r1-is01/Gingerbread_2.3.3_r1_IS01.git] / libcore / dom / src / test / java / org / w3c / domts / level3 / core / TestXerces.java
1 /*
2  * Copyright (c) 2001-2003 World Wide Web Consortium, (Massachusetts Institute
3  * of Technology, Institut National de Recherche en Informatique et en
4  * Automatique, Keio University). All Rights Reserved. This program is
5  * distributed under the W3C's Software Intellectual Property License. This
6  * program is distributed in the hope that it will be useful, but WITHOUT ANY
7  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
8  * FOR A PARTICULAR PURPOSE. See W3C License
9  * http://www.w3.org/Consortium/Legal/ for more details.
10  */
11
12 package org.w3c.domts.level3.core;
13
14 import java.lang.reflect.Constructor;
15
16 import junit.framework.TestSuite;
17
18 import javax.xml.parsers.DocumentBuilderFactory;
19
20 import org.w3c.domts.DOMTestDocumentBuilderFactory;
21 import org.w3c.domts.DOMTestSuite;
22 import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
23 import org.w3c.domts.JUnitTestSuiteAdapter;
24
25 /**
26  * Test suite that runs all DOM L3 Core tests using the
27  * Xerces-J in default configuration.
28  * 
29  * @author Curt Arnold
30  * 
31  */
32 public class TestXerces extends TestSuite {
33
34         public static TestSuite suite() throws Exception {
35                 Class testClass =
36                         ClassLoader.getSystemClassLoader().loadClass(
37                                 "org.w3c.domts.level3.core.alltests");
38                 Constructor testConstructor =
39                         testClass.getConstructor(
40                                 new Class[] { DOMTestDocumentBuilderFactory.class });
41
42                 DocumentBuilderFactory xercesFactory =
43                         (DocumentBuilderFactory) ClassLoader
44                                 .getSystemClassLoader()
45                                 .loadClass("org.apache.xerces.jaxp.DocumentBuilderFactoryImpl")
46                                 .newInstance();
47
48                 DOMTestDocumentBuilderFactory factory =
49                         new JAXPDOMTestDocumentBuilderFactory(
50                                 xercesFactory,
51                                 JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
52
53                 Object test = testConstructor.newInstance(new Object[] { factory });
54
55                 return new JUnitTestSuiteAdapter((DOMTestSuite) test);
56         }
57
58 }