KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > digester > plugins > TestAll


1 /* $Id: TestAll.java 155412 2005-02-26 12:58:36Z dirkv $
2  *
3  * Copyright 2001-2004 The Apache Software Foundation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * 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 package org.apache.commons.digester.plugins;
18
19 import junit.framework.Test;
20 import junit.framework.TestCase;
21 import junit.framework.TestSuite;
22
23 import java.io.InputStream JavaDoc;
24 import java.io.IOException JavaDoc;
25
26 /**
27  * Entry point for all plugins package tests.
28  *
29  * @author Simon Kitching
30  */

31 public class TestAll extends TestCase {
32     public TestAll(String JavaDoc testName) {
33         super(testName);
34     }
35
36     // MORE TESTS REQUIRED::
37
// test that problem is detected if rules object not PluginRules
38
// test that problem is detected if wildcard pattern used
39
// test that problem is detected if rule mounted with multiple patterns
40
// test that problem is detected if specified class doesn't descend
41
// from required base class.
42
// test scenario where bodytext of actual plugin element is accessed
43

44     // test rules in resource
45
// test rules in explicit file
46
// test autosetdefaults on/off
47

48
49     public static Test suite() {
50         TestSuite suite = new TestSuite();
51         suite.addTest(TestXmlRuleInfo.suite());
52         suite.addTest(TestInline.suite());
53         suite.addTest(TestDelegate.suite());
54         suite.addTest(TestDeclaration.suite());
55         suite.addTest(TestDefaultPlugin.suite());
56         suite.addTest(TestLocalRules.suite());
57         suite.addTest(TestRuleInfo.suite());
58         suite.addTest(TestRecursion.suite());
59         suite.addTest(TestConfigurablePluginAttributes.suite());
60         return suite;
61     }
62         
63     public static void main(String JavaDoc args[]) {
64         String JavaDoc[] testCaseName = { TestAll.class.getName() };
65         junit.textui.TestRunner.main(testCaseName);
66     }
67     
68     // ------------------------------------------------ Utility Support Methods
69

70     /**
71      * Return an appropriate InputStream for the specified test file (which
72      * must be inside our current package.
73      *
74      * @param caller is always "this" for the calling object.
75      * @param name is the test file we want
76      *
77      * @exception IOException if an input/output error occurs
78      */

79     public static InputStream JavaDoc getInputStream(Object JavaDoc caller, String JavaDoc name)
80     throws IOException JavaDoc {
81         return (caller.getClass().getResourceAsStream
82                 ("/org/apache/commons/digester/plugins/" + name));
83     }
84 }
85
Popular Tags