< prev index next >

test/javax/xml/jaxp/unittest/dom/Bug4966142.java

Print this page




  44 public class Bug4966142 {
  45 
  46     static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
  47     static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
  48 
  49     @Test
  50     public void test1() throws Exception {
  51         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
  52         dbf.setNamespaceAware(true);
  53         dbf.setValidating(true);
  54         dbf.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI);
  55         dbf.setAttribute(SCHEMA_SOURCE, Bug4966142.class.getResource("Bug4966142.xsd").toExternalForm());
  56 
  57         Document document = dbf.newDocumentBuilder().parse(Bug4966142.class.getResource("Bug4966142.xml").toExternalForm());
  58 
  59         TypeInfo type = document.getDocumentElement().getSchemaTypeInfo();
  60 
  61         Assert.assertFalse(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_UNION));
  62     }
  63 }
  64 


  44 public class Bug4966142 {
  45 
  46     static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
  47     static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
  48 
  49     @Test
  50     public void test1() throws Exception {
  51         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
  52         dbf.setNamespaceAware(true);
  53         dbf.setValidating(true);
  54         dbf.setAttribute(SCHEMA_LANGUAGE, XMLConstants.W3C_XML_SCHEMA_NS_URI);
  55         dbf.setAttribute(SCHEMA_SOURCE, Bug4966142.class.getResource("Bug4966142.xsd").toExternalForm());
  56 
  57         Document document = dbf.newDocumentBuilder().parse(Bug4966142.class.getResource("Bug4966142.xml").toExternalForm());
  58 
  59         TypeInfo type = document.getDocumentElement().getSchemaTypeInfo();
  60 
  61         Assert.assertFalse(type.isDerivedFrom("testNS", "Test", TypeInfo.DERIVATION_UNION));
  62     }
  63 }

< prev index next >