OSDN Git Service

original
[gb-231r1-is01/Gingerbread_2.3.3_r1_IS01.git] / libcore / dom / src / test / java / tests / api / org / w3c / dom / AllTests_Level1.java
1 /*
2  * Copyright (C) 2008 Google Inc.
3  * 
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License. You may obtain a copy of
6  * the License at
7  * 
8  * http://www.apache.org/licenses/LICENSE-2.0
9  * 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  * License for the specific language governing permissions and limitations under
14  * the License.
15  */
16
17 package tests.api.org.w3c.dom;
18
19 import junit.framework.Test;
20 import junit.framework.TestSuite;
21
22 import org.w3c.domts.DOMTestDocumentBuilderFactory;
23 import org.w3c.domts.DOMTestSuite;
24 import org.w3c.domts.JAXPDOMTestDocumentBuilderFactory;
25 import org.w3c.domts.JUnitTestSuiteAdapter;
26
27 /**
28  * Listing of all the tests that are to be run.
29  */
30 public class AllTests_Level1 {
31     /*public static void run() {
32         TestRunner.main(new String[] {Main_AllTests.class.getName()});
33     }*/
34
35     public static final Test suite() {
36         // from http://www.w3.org/DOM/Test/
37         // Level 1 Core tests
38         DOMTestSuite domSuite;
39         try {
40             DOMTestDocumentBuilderFactory factory1 =
41                 new JAXPDOMTestDocumentBuilderFactory(null,
42                 JAXPDOMTestDocumentBuilderFactory.getConfiguration1());
43             
44                 // android: coalescing, epand, ignorewhitespace, namespace, NOT validation
45
46             domSuite = new org.w3c.domts.level1.core.alltests(factory1);
47         } catch (Exception e) {
48             throw new RuntimeException("problem creating dom test suite, "+e.getClass().getName()+", "+e.getMessage(), e);
49         }
50         TestSuite suite = new JUnitTestSuiteAdapter(domSuite);
51         return suite;
52     }
53 }