KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > dom4j > io > TestSAXReader


1 /*
2  * Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved.
3  *
4  * This software is open source.
5  * See the bottom of this file for the licence.
6  *
7  */

8
9 package test.dom4j.io;
10
11 import junit.framework.Test;
12 import junit.framework.TestSuite;
13 import junit.textui.TestRunner;
14 import org.ozoneDB.xml.dom4j.io.O3SAXReader;
15 import test.dom4j.AbstractTestCase;
16
17 import java.io.File JavaDoc;
18 import java.net.URL JavaDoc;
19
20 /** A test harness to test the content API in DOM4J
21   *
22   * @author <a HREF="mailto:maartenc@sourceforge.net">Maarten Coene</a>
23   */

24 public class TestSAXReader extends AbstractTestCase {
25
26     public static void main( String JavaDoc[] args ) {
27         TestRunner.run( suite() );
28     }
29
30     public static Test suite() {
31         return new TestSuite( TestSAXReader.class );
32     }
33
34     public TestSAXReader(String JavaDoc name) {
35         super(name);
36     }
37
38     // Test case(s)
39
//-------------------------------------------------------------------------
40
/**
41      * Test bug reported by Christian Oetterli
42      * http://sourceforge.net/tracker/index.php?func=detail&aid=681658&group_id=16035&atid=116035
43      */

44     public void testReadFile() {
45         try {
46             URL JavaDoc location = TestSAXReader.class.getResource("/#.xml");
47             File JavaDoc file = new File JavaDoc(location.getPath() + "/#.xml");
48             new O3SAXReader(db()).read(file);
49         } catch (Exception JavaDoc e) {
50             e.printStackTrace();
51             fail(e.getMessage());
52         }
53     }
54
55 }
56
57
58
59
60 /*
61  * Redistribution and use of this software and associated documentation
62  * ("Software"), with or without modification, are permitted provided
63  * that the following conditions are met:
64  *
65  * 1. Redistributions of source code must retain copyright
66  * statements and notices. Redistributions must also contain a
67  * copy of this document.
68  *
69  * 2. Redistributions in binary form must reproduce the
70  * above copyright notice, this list of conditions and the
71  * following disclaimer in the documentation and/or other
72  * materials provided with the distribution.
73  *
74  * 3. The name "DOM4J" must not be used to endorse or promote
75  * products derived from this Software without prior written
76  * permission of MetaStuff, Ltd. For written permission,
77  * please contact dom4j-info@metastuff.com.
78  *
79  * 4. Products derived from this Software may not be called "DOM4J"
80  * nor may "DOM4J" appear in their names without prior written
81  * permission of MetaStuff, Ltd. DOM4J is a registered
82  * trademark of MetaStuff, Ltd.
83  *
84  * 5. Due credit should be given to the DOM4J Project
85  * (http://dom4j.org/).
86  *
87  * THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS
88  * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
89  * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
90  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
91  * METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
92  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
93  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
94  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
95  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
96  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
97  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
98  * OF THE POSSIBILITY OF SUCH DAMAGE.
99  *
100  * Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved.
101  *
102  * $Id: TestSAXReader.java,v 1.2 2003/07/12 12:13:06 per_nyfelt Exp $
103  */

104
Popular Tags