You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mu...@apache.org on 2013/01/05 11:46:28 UTC
svn commit: r1429251 - in /xerces/java/branches/xs-1.1-tests:
data/assertions/list_union/ src/org/apache/xerces/tests/
Author: mukulg
Date: Sat Jan 5 10:46:27 2013
New Revision: 1429251
URL: http://svn.apache.org/viewvc?rev=1429251&view=rev
Log:
schema 1.1 commit: adding few new test cases, for implementation improvements committed few minutes ago.
Added:
xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion16.xml
xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion16.xsd
xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion17.xml
xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion17.xsd
Modified:
xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AssertionTests.java
Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion16.xml
URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion16.xml?rev=1429251&view=auto
==============================================================================
--- xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion16.xml (added)
+++ xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion16.xml Sat Jan 5 10:46:27 2013
@@ -0,0 +1,4 @@
+<Z>
+ <X val="2005-10-09 2007-05-07 2007-05-03"/>
+ <Y val="100"/>
+</Z>
\ No newline at end of file
Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion16.xsd
URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion16.xsd?rev=1429251&view=auto
==============================================================================
--- xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion16.xsd (added)
+++ xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion16.xsd Sat Jan 5 10:46:27 2013
@@ -0,0 +1,41 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:element name="Z">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X">
+ <xs:complexType>
+ <xs:attribute name="val">
+ <xs:simpleType>
+ <xs:restriction base="union_of_DtList_and_integer">
+ <xs:assertion test="$value instance of xs:date+"/>
+ <xs:assertion test="count($value) eq 3"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="Y">
+ <xs:complexType>
+ <xs:attribute name="val">
+ <xs:simpleType>
+ <xs:restriction base="union_of_DtList_and_integer">
+ <xs:assertion test="$value instance of xs:integer"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:simpleType name="union_of_DtList_and_integer">
+ <xs:union memberTypes="xs:integer">
+ <xs:simpleType>
+ <xs:list itemType="xs:date"/>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+
+</xs:schema>
\ No newline at end of file
Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion17.xml
URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion17.xml?rev=1429251&view=auto
==============================================================================
--- xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion17.xml (added)
+++ xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion17.xml Sat Jan 5 10:46:27 2013
@@ -0,0 +1,4 @@
+<Z>
+ <X val1="2005-10-09 2007-05-07 2007-05-03" val2="200"/>
+ <Y val="100"/>
+</Z>
\ No newline at end of file
Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion17.xsd
URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion17.xsd?rev=1429251&view=auto
==============================================================================
--- xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion17.xsd (added)
+++ xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion17.xsd Sat Jan 5 10:46:27 2013
@@ -0,0 +1,48 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:element name="Z">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X">
+ <xs:complexType>
+ <xs:attribute name="val1">
+ <xs:simpleType>
+ <xs:restriction base="union_of_DtList_and_integer">
+ <xs:assertion test="$value instance of xs:date+"/>
+ <xs:assertion test="count($value) eq 3"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="val2">
+ <xs:simpleType>
+ <xs:restriction base="union_of_DtList_and_integer">
+ <xs:assertion test="$value instance of xs:integer"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="Y">
+ <xs:complexType>
+ <xs:attribute name="val">
+ <xs:simpleType>
+ <xs:restriction base="union_of_DtList_and_integer">
+ <xs:assertion test="$value instance of xs:integer"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:simpleType name="union_of_DtList_and_integer">
+ <xs:union memberTypes="xs:integer">
+ <xs:simpleType>
+ <xs:list itemType="xs:date"/>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+
+</xs:schema>
\ No newline at end of file
Modified: xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AssertionTests.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AssertionTests.java?rev=1429251&r1=1429250&r2=1429251&view=diff
==============================================================================
--- xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AssertionTests.java (original)
+++ xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/AssertionTests.java Sat Jan 5 10:46:27 2013
@@ -2732,4 +2732,36 @@ public class AssertionTests extends Xerc
}
}
+ public void testAssert153() {
+ String xmlfile = fDataDir+"/assertions/list_union/listunion16.xml";
+ String schemapath = fDataDir+"/assertions/list_union/listunion16.xsd";
+ try {
+ Schema s = fSchemaFactory.newSchema(new StreamSource(schemapath));
+ Validator v = s.newValidator();
+ v.setErrorHandler(this);
+ v.validate(new StreamSource(xmlfile));
+ assertNull(fErrSysId);
+ assertNull(fFatErrSysId);
+ } catch(Exception ex) {
+ ex.printStackTrace();
+ assertTrue(false);
+ }
+ }
+
+ public void testAssert154() {
+ String xmlfile = fDataDir+"/assertions/list_union/listunion17.xml";
+ String schemapath = fDataDir+"/assertions/list_union/listunion17.xsd";
+ try {
+ Schema s = fSchemaFactory.newSchema(new StreamSource(schemapath));
+ Validator v = s.newValidator();
+ v.setErrorHandler(this);
+ v.validate(new StreamSource(xmlfile));
+ assertNull(fErrSysId);
+ assertNull(fFatErrSysId);
+ } catch(Exception ex) {
+ ex.printStackTrace();
+ assertTrue(false);
+ }
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org