< prev index next >

test/javax/xml/jaxp/unittest/validation/tck/ParticleTest.java

Print this page




  46 @Listeners({jaxp.library.FilePolicy.class})
  47 public class ParticleTest {
  48     static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
  49     static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
  50 
  51     /*
  52        @bug 8142463
  53        This test verifies the fix for a missing flag that indicates the DFA
  54        is compacted for UPA. Without the fix, the 2nd foo:foo element was
  55        rejected.
  56     */
  57     @Test
  58     public void test() throws SAXException, IOException {
  59         SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
  60         Schema schema = schemaFactory.newSchema(new StreamSource(ParticleTest.class.getResourceAsStream("upa01.xsd")));
  61         Validator validator = schema.newValidator();
  62 
  63         validator.validate(new StreamSource(ParticleTest.class.getResourceAsStream("upa01.xml")));
  64     }
  65 }
  66 


  46 @Listeners({jaxp.library.FilePolicy.class})
  47 public class ParticleTest {
  48     static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
  49     static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
  50 
  51     /*
  52        @bug 8142463
  53        This test verifies the fix for a missing flag that indicates the DFA
  54        is compacted for UPA. Without the fix, the 2nd foo:foo element was
  55        rejected.
  56     */
  57     @Test
  58     public void test() throws SAXException, IOException {
  59         SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
  60         Schema schema = schemaFactory.newSchema(new StreamSource(ParticleTest.class.getResourceAsStream("upa01.xsd")));
  61         Validator validator = schema.newValidator();
  62 
  63         validator.validate(new StreamSource(ParticleTest.class.getResourceAsStream("upa01.xml")));
  64     }
  65 }

< prev index next >