KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > dom4j > TestValidation


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  * $Id: TestValidation.java,v 1.1 2003/07/07 10:30:29 per_nyfelt Exp $
8  */

9
10 package test.dom4j;
11
12 import junit.framework.Test;
13 import junit.framework.TestSuite;
14 import junit.textui.TestRunner;
15 import org.dom4j.Document;
16 import org.dom4j.io.SAXReader;
17
18 /** A test harness for validation when using SAXReader
19   *
20   * @author <a HREF="mailto:jstrachan@apache.org">James Strachan</a>
21   * @version $Revision: 1.1 $
22   */

23 public class TestValidation extends AbstractTestCase {
24
25     public static void main( String JavaDoc[] args ) {
26         TestRunner.run( suite() );
27     }
28
29     public static Test suite() {
30         return new TestSuite( TestValidation.class );
31     }
32
33     public TestValidation(String JavaDoc name) {
34         super(name);
35     }
36
37     // Test case(s)
38
//-------------------------------------------------------------------------
39
public void testValidation() throws Exception JavaDoc {
40         SAXReader reader = new SAXReader( true );
41         Document document = reader.read( "xml/nitf/valid.xml" );
42         assertTrue( "Found valid document", document != null );
43
44         log( "Validated document: " + document );
45     }
46 }
47
48
49
50
51 /*
52  * Redistribution and use of this software and associated documentation
53  * ("Software"), with or without modification, are permitted provided
54  * that the following conditions are met:
55  *
56  * 1. Redistributions of source code must retain copyright
57  * statements and notices. Redistributions must also contain a
58  * copy of this document.
59  *
60  * 2. Redistributions in binary form must reproduce the
61  * above copyright notice, this list of conditions and the
62  * following disclaimer in the documentation and/or other
63  * materials provided with the distribution.
64  *
65  * 3. The name "DOM4J" must not be used to endorse or promote
66  * products derived from this Software without prior written
67  * permission of MetaStuff, Ltd. For written permission,
68  * please contact dom4j-info@metastuff.com.
69  *
70  * 4. Products derived from this Software may not be called "DOM4J"
71  * nor may "DOM4J" appear in their names without prior written
72  * permission of MetaStuff, Ltd. DOM4J is a registered
73  * trademark of MetaStuff, Ltd.
74  *
75  * 5. Due credit should be given to the DOM4J Project
76  * (http://dom4j.org/).
77  *
78  * THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS
79  * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
80  * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
81  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
82  * METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
83  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
84  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
85  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
86  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
87  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
88  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
89  * OF THE POSSIBILITY OF SUCH DAMAGE.
90  *
91  * Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved.
92  *
93  * $Id: TestValidation.java,v 1.1 2003/07/07 10:30:29 per_nyfelt Exp $
94  */

95
Popular Tags