Author: mukulg
Date: Tue Apr 19 06:14:42 2022
New Revision: 1900013

URL: http://svn.apache.org/viewvc?rev=1900013&view=rev
Log:
adding few test cases, for jira issue XERCESJ-1743

Added:
    xerces/java/branches/xml-schema-1.1-tests/data/jira_bugs/1743_7.xsd
    xerces/java/branches/xml-schema-1.1-tests/data/jira_bugs/1743_8.xsd
Modified:
    
xerces/java/branches/xml-schema-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java

Added: xerces/java/branches/xml-schema-1.1-tests/data/jira_bugs/1743_7.xsd
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-tests/data/jira_bugs/1743_7.xsd?rev=1900013&view=auto
==============================================================================
--- xerces/java/branches/xml-schema-1.1-tests/data/jira_bugs/1743_7.xsd (added)
+++ xerces/java/branches/xml-schema-1.1-tests/data/jira_bugs/1743_7.xsd Tue Apr 
19 06:14:42 2022
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>
+    
+    <xs:element name="X">
+       <xs:simpleType>
+          <xs:restriction base="INT_AND_DATE">
+             <xs:enumeration value="10 2005-10-07"/>
+             <xs:enumeration value="3 2007-10-07"/>
+          </xs:restriction>
+       </xs:simpleType>
+    </xs:element>
+    
+    <xs:element name="Y">
+       <xs:simpleType>
+          <xs:restriction base="INT_AND_DATE">
+            <xs:enumeration value="10 2005-10-07"/>
+            <xs:enumeration value="7 2007-10-07"/>
+          </xs:restriction>
+       </xs:simpleType>
+    </xs:element>
+    
+    <xs:simpleType name="INT_AND_DATE">
+       <xs:list itemType="TYPE1"/>
+    </xs:simpleType>
+    
+    <xs:simpleType name="TYPE1">
+       <xs:union memberTypes="INT_TYPE xs:date"/>
+    </xs:simpleType>
+    
+    <xs:simpleType name="INT_TYPE">
+       <xs:restriction base="xs:integer">
+          <xs:assertion test="$value mod 2 = 0"/>
+       </xs:restriction>
+    </xs:simpleType>
+
+</xs:schema>
\ No newline at end of file

Added: xerces/java/branches/xml-schema-1.1-tests/data/jira_bugs/1743_8.xsd
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-tests/data/jira_bugs/1743_8.xsd?rev=1900013&view=auto
==============================================================================
--- xerces/java/branches/xml-schema-1.1-tests/data/jira_bugs/1743_8.xsd (added)
+++ xerces/java/branches/xml-schema-1.1-tests/data/jira_bugs/1743_8.xsd Tue Apr 
19 06:14:42 2022
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>
+    
+    <xs:element name="X">
+       <xs:simpleType>
+          <xs:restriction base="DATE_TYPE">
+             <xs:enumeration value="8767-10-17 2005-10-07"/>
+             <xs:enumeration value="8767-10-17 2007-10-07"/>
+          </xs:restriction>
+       </xs:simpleType>
+    </xs:element>
+    
+    <xs:element name="Y">
+       <xs:simpleType>
+          <xs:restriction base="DATE_TYPE">
+            <xs:enumeration value="8767-10-17 2005-10-07"/>
+            <xs:enumeration value="8767-10-17 2007-10-07"/>
+          </xs:restriction>
+       </xs:simpleType>
+    </xs:element>
+    
+    <xs:simpleType name="DATE_TYPE">
+       <xs:list itemType="TYPE1"/>
+    </xs:simpleType>
+    
+    <xs:simpleType name="TYPE1">
+       <xs:union memberTypes="DATE_TYPE1 DATE_TYPE2"/>
+    </xs:simpleType>
+    
+    <xs:simpleType name="DATE_TYPE1">
+       <xs:restriction base="xs:date">
+          <xs:assertion test="$value lt current-date()"/>
+       </xs:restriction>
+    </xs:simpleType>
+    
+    <xs:simpleType name="DATE_TYPE2">
+       <xs:restriction base="xs:date">
+          <xs:assertion test="$value lt current-date()"/>
+       </xs:restriction>
+    </xs:simpleType>
+
+</xs:schema>
\ No newline at end of file

Modified: 
xerces/java/branches/xml-schema-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java?rev=1900013&r1=1900012&r2=1900013&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java
 (original)
+++ 
xerces/java/branches/xml-schema-1.1-tests/src/org/apache/xerces/tests/JiraBugsTests.java
 Tue Apr 19 06:14:42 2022
@@ -742,6 +742,32 @@ public class JiraBugsTests extends Xerce
                }
        }
        
+       public void testJira_1743_7() {
+               String schemapath = fDataDir+"/jira_bugs/1743_7.xsd";   
+               try {
+                       fSchemaFactory.setErrorHandler(this);
+                   Schema s = fSchemaFactory.newSchema(new 
StreamSource(schemapath));              
+                   assertTrue(failureList.size() == 2);                    
+            fErrSysId.endsWith("1743_7.xsd");
+               } catch(Exception ex) {
+                       ex.printStackTrace();
+                       assertTrue(false);                                      
                       
+               }
+       }
+       
+       public void testJira_1743_8() {
+               String schemapath = fDataDir+"/jira_bugs/1743_8.xsd";   
+               try {
+                       fSchemaFactory.setErrorHandler(this);
+                   Schema s = fSchemaFactory.newSchema(new 
StreamSource(schemapath));              
+                   assertTrue(failureList.size() == 2);                    
+            fErrSysId.endsWith("1743_8.xsd");
+               } catch(Exception ex) {
+                       ex.printStackTrace();
+                       assertTrue(false);                                      
                       
+               }
+       }
+       
        public void testJira_1744_1() {
                String xmlfile = fDataDir+"/jira_bugs/1744_1.xml";
                String schemapath = fDataDir+"/jira_bugs/1744_1.xsd";           



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to