Author: mukulg
Date: Thu Mar 7 02:38:26 2013
New Revision: 1453665
URL: http://svn.apache.org/r1453665
Log:
committing fix for jira issue XERCESJ-1608, along with few test cases.
Added:
xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xml
xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xsd
xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_2.xml
Modified:
xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java
Added: xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xml
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xml?rev=1453665&view=auto
==============================================================================
--- xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xml (added)
+++ xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xml Thu Mar 7
02:38:26 2013
@@ -0,0 +1,5 @@
+<test xmlns="http://www.rackspace.com/test/duration">
+ <d>PT22H</d>
+ <d>PT1H</d>
+ <d>PT1H</d>
+</test>
\ No newline at end of file
Added: xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xsd
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xsd?rev=1453665&view=auto
==============================================================================
--- xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xsd (added)
+++ xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_1.xsd Thu Mar 7
02:38:26 2013
@@ -0,0 +1,16 @@
+<schema
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:tst="http://www.rackspace.com/test/duration"
+ targetNamespace="http://www.rackspace.com/test/duration">
+ <element name="test" type="tst:SumDuration24H"/>
+ <complexType name="SumDuration24H">
+ <sequence>
+ <element name="d" type="xsd:dayTimeDuration"
maxOccurs="unbounded"/>
+ </sequence>
+ <assert test="xsd:dayTimeDuration('PT24H') = sum(tst:d)"/>
+ <assert test="xsd:dayTimeDuration('PT24H') = sum(for $d in
element(tst:d) return $d)"/>
+ </complexType>
+</schema>
\ No newline at end of file
Added: xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_2.xml
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_2.xml?rev=1453665&view=auto
==============================================================================
--- xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_2.xml (added)
+++ xerces/java/branches/xs-1.1-tests/data/jira_bugs/1608_2.xml Thu Mar 7
02:38:26 2013
@@ -0,0 +1,5 @@
+<test xmlns="http://www.rackspace.com/test/duration">
+ <d>PT24H</d>
+ <d>PT1H</d>
+ <d>PT1H</d>
+</test>
\ No newline at end of file
Modified:
xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java?rev=1453665&r1=1453664&r2=1453665&view=diff
==============================================================================
---
xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java
(original)
+++
xerces/java/branches/xs-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java
Thu Mar 7 02:38:26 2013
@@ -370,5 +370,36 @@ public class JiraBugsTests extends Xerce
assertEquals("cos-nonambig: Element1 and Element1 (or elements
from their substitution group) violate \"Unique Particle Attribution\". During
validation against this schema, ambiguity would be created for those two
particles.", ex.getMessage());
}
}
+
+ public void testJira_1608_1() {
+ String xmlfile = fDataDir+"/jira_bugs/1608_1.xml";
+ String schemapath = fDataDir+"/jira_bugs/1608_1.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 testJira_1608_2() {
+ String xmlfile = fDataDir+"/jira_bugs/1608_2.xml";
+ String schemapath = fDataDir+"/jira_bugs/1608_1.xsd";
+ try {
+ Schema s = fSchemaFactory.newSchema(new
StreamSource(schemapath));
+ Validator v = s.newValidator();
+ v.setErrorHandler(this);
+ v.validate(new StreamSource(xmlfile));
+ assertTrue(failureList.size() == 2);
+ } catch(Exception ex) {
+ ex.printStackTrace();
+ assertTrue(false);
+ }
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]