KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > digester > TestEntityResolution


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

16  
17 package org.apache.commons.digester;
18
19
20
21 import java.io.File JavaDoc;
22
23 import javax.xml.parsers.SAXParser JavaDoc;
24 import javax.xml.parsers.SAXParserFactory JavaDoc;
25
26 import org.xml.sax.helpers.DefaultHandler JavaDoc;
27
28 import junit.framework.TestCase;
29
30 /**
31  * Tests for entity resolution.
32  * @author <a HREF='http://jakarta.apache.org/'>Jakarta Commons Team</a>
33  * @version $Revision$
34  */

35 public class TestEntityResolution extends TestCase {
36     
37     public void testParserResolveRelative() throws Exception JavaDoc {
38         SAXParserFactory JavaDoc factory = SAXParserFactory.newInstance();
39         factory.setValidating(true);
40         factory.setNamespaceAware(true);
41         SAXParser JavaDoc parser = factory.newSAXParser();
42         
43         parser.parse(
44                     new File JavaDoc("src/test/org/apache/commons/digester/document-with-relative-dtd.xml"),
45                     new DefaultHandler JavaDoc());
46     }
47     
48     public void testDigesterResolveRelative() throws Exception JavaDoc {
49         Digester digester = new Digester();
50         digester.setValidating(true);
51         digester.parse(
52                     new File JavaDoc("src/test/org/apache/commons/digester/document-with-relative-dtd.xml"));
53     }
54 }
55
Popular Tags