TestOracle.java revision adc854b798c1cfe3bfd4c27d68d5cee38ca617da
1/*
2 * Copyright (c) 2001-2004 World Wide Web Consortium, (Massachusetts Institute of
3 * 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
12package org.w3c.domts.level3.validation;
13
14import java.lang.reflect.Constructor;
15
16import javax.xml.parsers.DocumentBuilderFactory;
17
18import junit.framework.TestSuite;
19
20import org.w3c.domts.DOMTestDocumentBuilderFactory;
21import org.w3c.domts.DOMTestSuite;
22import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
23import org.w3c.domts.JUnitTestSuiteAdapter;
24
25/**
26 * Test suite that runs all DOM L3 Validation tests using the
27 * Oracle Parser for Java in default configuration.
28 *
29 * @author Curt Arnold
30 *
31 */
32public class TestOracle extends TestSuite {
33
34	/**
35	 * Constructor
36	 * @return test suite
37	 * @throws Exception
38	 */
39	public static TestSuite suite() throws Exception {
40		Class testClass =
41			ClassLoader.getSystemClassLoader().loadClass(
42				"org.w3c.domts.level3.validation.alltests");
43		Constructor testConstructor =
44			testClass.getConstructor(
45				new Class[] { DOMTestDocumentBuilderFactory.class });
46
47		DocumentBuilderFactory oracleFactory =
48			(DocumentBuilderFactory) ClassLoader
49				.getSystemClassLoader()
50				.loadClass("oracle.xml.jaxp.JXDocumentBuilderFactory")
51				.newInstance();
52
53		DOMTestDocumentBuilderFactory factory =
54			new JAXPDOMTestDocumentBuilderFactory(
55				oracleFactory,
56				JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
57
58		Object test = testConstructor.newInstance(new Object[] { factory });
59
60		return new JUnitTestSuiteAdapter((DOMTestSuite) test);
61	}
62
63}
64