KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > intermediate > IntermediateFormatTestSuite


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 /* $Id$ */
19
20 package org.apache.fop.intermediate;
21
22 import java.io.File JavaDoc;
23 import java.io.IOException JavaDoc;
24 import java.util.Collection JavaDoc;
25 import java.util.Iterator JavaDoc;
26
27 import junit.framework.Test;
28 import junit.framework.TestSuite;
29
30 import org.apache.fop.layoutengine.LayoutEngineTestSuite;
31
32 /**
33  * JUnit test suite for the intermediate format
34  */

35 public class IntermediateFormatTestSuite {
36
37     /**
38      * @return the test suite with all the tests (one for each XML file)
39      * @throws IOException in case of an I/O problem
40      */

41     public static Test suite() throws IOException JavaDoc {
42         TestSuite suite = new TestSuite();
43
44         Collection JavaDoc files = LayoutEngineTestSuite.getTestFiles();
45
46         Iterator JavaDoc i = files.iterator();
47         while (i.hasNext()) {
48             File JavaDoc f = (File JavaDoc)i.next();
49             addTestCase(suite, f);
50         }
51         
52         return suite;
53     }
54     
55     private static void addTestCase(TestSuite suite,
56             final File JavaDoc f) {
57         suite.addTest(new AreaTreeParserTestCase(f) {
58             public void runTest() throws Exception JavaDoc {
59                 org.apache.commons.logging.LogFactory.getLog(
60                         this.getClass()).info("Starting " + f.getName());
61                 testParserToAT();
62                 testParserToPDF();
63             }
64         });
65     }
66     
67 }
68
Popular Tags