Author: mukulg Date: Mon Jan 7 16:14:56 2013 New Revision: 1429874 URL: http://svn.apache.org/viewvc?rev=1429874&view=rev Log: schema 1.1 commit: adding few new test cases, for implementation improvements done few minutes ago and for earlier improvements as well.
Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18_1.xml - copied unchanged from r1429470, xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18.xml xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18_2.xml xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19.xsd xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_1.xml xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_2.xml Removed: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18.xml 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/listunion18_2.xml URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18_2.xml?rev=1429874&view=auto ============================================================================== --- xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18_2.xml (added) +++ xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion18_2.xml Mon Jan 7 16:14:56 2013 @@ -0,0 +1 @@ +<X>5</X> \ No newline at end of file Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19.xsd URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19.xsd?rev=1429874&view=auto ============================================================================== --- xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19.xsd (added) +++ xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19.xsd Mon Jan 7 16:14:56 2013 @@ -0,0 +1,21 @@ +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> + + <xs:element name="X"> + <xs:simpleType> + <xs:restriction base="ST1"> + <xs:assertion test="count($value) eq 2"/> + <xs:assertion test="$value[1] instance of xs:integer"/> + <xs:assertion test="$value[2] instance of xs:date"/> + </xs:restriction> + </xs:simpleType> + </xs:element> + + <xs:simpleType name="ST1"> + <xs:list> + <xs:simpleType> + <xs:union memberTypes="xs:integer xs:date"/> + </xs:simpleType> + </xs:list> + </xs:simpleType> + +</xs:schema> \ No newline at end of file Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_1.xml URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_1.xml?rev=1429874&view=auto ============================================================================== --- xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_1.xml (added) +++ xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_1.xml Mon Jan 7 16:14:56 2013 @@ -0,0 +1 @@ +<X>2 2005-10-05</X> \ No newline at end of file Added: xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_2.xml URL: http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_2.xml?rev=1429874&view=auto ============================================================================== --- xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_2.xml (added) +++ xerces/java/branches/xs-1.1-tests/data/assertions/list_union/listunion19_2.xml Mon Jan 7 16:14:56 2013 @@ -0,0 +1 @@ +<X>2005-10-05 2</X> \ 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=1429874&r1=1429873&r2=1429874&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 Mon Jan 7 16:14:56 2013 @@ -2765,7 +2765,7 @@ public class AssertionTests extends Xerc } public void testAssert155() { - String xmlfile = fDataDir+"/assertions/list_union/listunion18.xml"; + String xmlfile = fDataDir+"/assertions/list_union/listunion18_1.xml"; String schemapath = fDataDir+"/assertions/list_union/listunion18.xsd"; try { Schema s = fSchemaFactory.newSchema(new StreamSource(schemapath)); @@ -2780,4 +2780,50 @@ public class AssertionTests extends Xerc } } + public void testAssert156() { + String xmlfile = fDataDir+"/assertions/list_union/listunion18_2.xml"; + String schemapath = fDataDir+"/assertions/list_union/listunion18.xsd"; + try { + Schema s = fSchemaFactory.newSchema(new StreamSource(schemapath)); + Validator v = s.newValidator(); + v.setErrorHandler(this); + v.validate(new StreamSource(xmlfile)); + assertTrue(failureList.size() == 3); + } catch(Exception ex) { + ex.printStackTrace(); + assertTrue(false); + } + } + + public void testAssert157() { + String xmlfile = fDataDir+"/assertions/list_union/listunion19_1.xml"; + String schemapath = fDataDir+"/assertions/list_union/listunion19.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 testAssert158() { + String xmlfile = fDataDir+"/assertions/list_union/listunion19_2.xml"; + String schemapath = fDataDir+"/assertions/list_union/listunion19.xsd"; + try { + Schema s = fSchemaFactory.newSchema(new StreamSource(schemapath)); + Validator v = s.newValidator(); + v.setErrorHandler(this); + v.validate(new StreamSource(xmlfile)); + assertTrue(failureList.size() == 4); + } catch(Exception ex) { + ex.printStackTrace(); + assertTrue(false); + } + } + } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org