KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > openxml > OpenXmlTestSuite


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Library License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-2001 by SMB GmbH. All rights reserved.
6
//
7
// $Id: OpenXmlTestSuite.java,v 1.1 2003/11/02 17:29:30 per_nyfelt Exp $
8

9 package test.openxml;
10
11 import java.net.URL JavaDoc;
12
13 import junit.framework.Test;
14 import junit.framework.TestCase;
15 import junit.framework.TestSuite;
16 import junit.textui.TestRunner;
17
18 public class OpenXmlTestSuite extends TestCase {
19
20     public static String JavaDoc propertiesFileName;
21     public static String JavaDoc xmlTestDataFileName;
22
23     static {
24         propertiesFileName = Thread.currentThread().getContextClassLoader()
25                                     .getResource("OpenXmlTestSuite.properties").getFile();
26         xmlTestDataFileName = Thread.currentThread().getContextClassLoader()
27                                     .getResource("testData.xml").getFile();
28     }
29
30     public OpenXmlTestSuite(String JavaDoc name) {
31         super(name);
32     }
33
34     /**
35      * @return test suite of all tests
36      */

37     public static Test suite() {
38         TestSuite suite = new TestSuite("All OpenXML Tests");
39         suite.addTest(Obj2XMLTest.suite());
40         suite.addTest(XML2ObjTest.suite());
41         return suite;
42     }
43
44     public static void main(String JavaDoc args[]) throws Exception JavaDoc {
45         // allow to overrride the location of the files if desired
46
if (args.length > 0) {
47             propertiesFileName = args[0];
48         }
49         if (args.length > 1) {
50             xmlTestDataFileName = args[1];
51         }
52         TestRunner.run(suite());
53     }
54 }
55
56
Popular Tags