alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
 * DTDParserTest.java
 * NetBeans JUnit based test
 *
 * Created on April 10, 2002, 9:06 AM
 */

package org.netbeans.modules.xml.core.wizard;

import java.io.*;
import java.net.URL;
import java.util.*;
import junit.framework.*;
import org.netbeans.junit.*;
import org.xml.sax.*;
import org.xml.sax.ext.*;
import org.xml.sax.helpers.*;
import org.openide.xml.*;
import org.openide.util.Lookup;
import org.netbeans.modules.xml.core.tree.ModuleEntityResolver;

/**
 * Must be executed in IDE with mounted NetBEans XML Catalog.
 *
 * @author Petr Kuzel
 */
public class DTDParserTest extends NbTestCase {
    
    public DTDParserTest(java.lang.String testName) {
        super(testName);
    }
    
    public static void main(java.lang.String[] args) {
        junit.textui.TestRunner.run(suite());
    }
    
    public static Test suite() {
        TestSuite suite = new NbTestSuite(DTDParserTest.class);
        
        return suite;
    }
    
    /** Test of parse method, of class org.netbeans.modules.xml.core.wizard.DTDParser. */
    public void testParse() {        
        URL dtd = getClass().getResource("data/dtd.dtd");
        InputSource in = new InputSource(dtd.toExternalForm());
        Set roots = new DTDParser().parse(in);        
        assertTrue("Expected decl not found!", roots.contains("root"));
    }    
    
}
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.