1/* 2 * Copyright (c) 2001-2004 World Wide Web Consortium, 3 * (Massachusetts Institute of Technology, Institut National de 4 * Recherche en Informatique et en Automatique, Keio University). All 5 * Rights Reserved. This program is distributed under the W3C's Software 6 * Intellectual Property License. This program is distributed in the 7 * hope that it will be useful, but WITHOUT ANY WARRANTY; without even 8 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 9 * PURPOSE. 10 * See W3C License http://www.w3.org/Consortium/Legal/ for more details. 11 */ 12 13 14package org.w3c.domts.level3.ls; 15 16import java.lang.reflect.Constructor; 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 using the default JAXP parser in the default configuration 27 * 28 * 29 */ 30public class TestDefaultParser extends TestSuite { 31 32 /** 33 * Create a new instance of the test suite 34 * @return new test suite 35 * @exception Exception if tests or implementation can be created. 36 */ 37 public static TestSuite suite() throws Exception 38 { 39 Class testClass = ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level3.ls.alltests"); 40 Constructor testConstructor = testClass.getConstructor(new Class[] { DOMTestDocumentBuilderFactory.class }); 41 42 DOMTestDocumentBuilderFactory factory = 43 new JAXPDOMTestDocumentBuilderFactory(null, 44 JAXPDOMTestDocumentBuilderFactory.getConfiguration1()); 45 46 Object test = testConstructor.newInstance(new Object[] { factory }); 47 48 return new JUnitTestSuiteAdapter((DOMTestSuite) test); 49 } 50 51 52} 53 54