Home | History | Annotate | Download | only in validation
      1 /*
      2  * Copyright (c) 2001-2004 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.validation;
     13 
     14 import java.lang.reflect.Constructor;
     15 
     16 import junit.framework.TestSuite;
     17 
     18 
     19 import org.w3c.domts.DOMTestDocumentBuilderFactory;
     20 import org.w3c.domts.DOMTestSuite;
     21 import org.w3c.domts.LSDocumentBuilderFactory;
     22 import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
     23 import org.w3c.domts.JUnitTestSuiteAdapter;
     24 
     25 /**
     26  * Test suite that runs all DOM L3 Validation tests using a
     27  * parser provided by DOM L3 Core bootstrapping
     28  * in alternative configuration
     29  *
     30  * @author Curt Arnold
     31  *
     32  */
     33 public class TestDefaultLSAltConfig extends TestSuite {
     34 
     35     /**
     36      * Create a new instance of the test suite
     37      * @return test suite
     38      * @throws Exception if tests or implementation not loaded
     39      */
     40 	public static TestSuite suite() throws Exception {
     41 		Class testClass =
     42 			ClassLoader.getSystemClassLoader().loadClass(
     43 				"org.w3c.domts.level3.validation.alltests");
     44 		Constructor testConstructor =
     45 			testClass.getConstructor(
     46 				new Class[] { DOMTestDocumentBuilderFactory.class });
     47 
     48 		DOMTestDocumentBuilderFactory factory =
     49 			new LSDocumentBuilderFactory(
     50 				JAXPDOMTestDocumentBuilderFactory.getConfiguration2());
     51 
     52 		Object test = testConstructor.newInstance(new Object[] { factory });
     53 
     54 		return new JUnitTestSuiteAdapter((DOMTestSuite) test);
     55 	}
     56 
     57 }
     58