1 19 25 26 package org.netbeans.modules.xml.core.wizard; 27 28 import java.io.IOException ; 29 import java.net.URL ; 30 import java.util.Set ; 31 import java.util.TreeSet ; 32 import junit.framework.*; 33 import org.netbeans.api.xml.services.UserCatalog; 34 import org.netbeans.junit.*; 35 import org.openide.util.Lookup; 36 import org.openide.xml.XMLUtil; 37 import org.xml.sax.*; 38 import org.xml.sax.helpers.*; 39 40 44 public class SchemaParserTest extends NbTestCase { 45 46 public SchemaParserTest(java.lang.String testName) { 47 super(testName); 48 } 49 50 public static void main(java.lang.String [] args) { 51 junit.textui.TestRunner.run(suite()); 52 } 53 54 public static Test suite() { 55 TestSuite suite = new NbTestSuite(SchemaParserTest.class); 56 57 return suite; 58 } 59 60 61 public void testParse() { 62 System.out.println("testParse"); 63 64 URL ns = getClass().getResource("data/schemaWithNS.xsd"); 65 SchemaParser parser = new SchemaParser(); 66 67 SchemaParser.SchemaInfo info = parser.parse(ns.toExternalForm()); 68 assertTrue("root expected",info.roots.contains("root")); 69 assertTrue("ns expected", "test:schemaWithNS".equals(info.namespace)); 70 assertTrue("unexpected root", info.roots.contains("seq1") == false); 71 } 72 73 } 74 | Popular Tags |