< prev index next >

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

Print this page




  46 public class RegexWord {
  47     static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
  48     static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
  49 
  50     /*
  51     The original reZ003v.xml contains a full list of word characters that \w should accept.
  52     However, U+2308..U+230B were changed from Sm to either Ps or Pe in Unicode 7.0.
  53     They are therefore excluded from the test.
  54 
  55     The test throws an Exception (and fails) if it fails to recognize any of characters.
  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(RegexWord.class.getResourceAsStream("reZ003.xsd")));
  61         Validator validator = schema.newValidator();
  62 
  63         validator.validate(new StreamSource(RegexWord.class.getResourceAsStream("reZ003vExc23082309.xml")));
  64     }
  65 }
  66 


  46 public class RegexWord {
  47     static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
  48     static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
  49 
  50     /*
  51     The original reZ003v.xml contains a full list of word characters that \w should accept.
  52     However, U+2308..U+230B were changed from Sm to either Ps or Pe in Unicode 7.0.
  53     They are therefore excluded from the test.
  54 
  55     The test throws an Exception (and fails) if it fails to recognize any of characters.
  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(RegexWord.class.getResourceAsStream("reZ003.xsd")));
  61         Validator validator = schema.newValidator();
  62 
  63         validator.validate(new StreamSource(RegexWord.class.getResourceAsStream("reZ003vExc23082309.xml")));
  64     }
  65 }

< prev index next >