Author: mukulg
Date: Mon Dec 23 11:30:27 2019
New Revision: 1871923

URL: http://svn.apache.org/viewvc?rev=1871923&view=rev
Log:
committing a test case, for jira issue XERCESJ-1698

Added:
    xerces/java/branches/xs-1.1-tests/data/jira_bugs/1698_1.xsd
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/1698_1.xsd
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xs-1.1-tests/data/jira_bugs/1698_1.xsd?rev=1871923&view=auto
==============================================================================
--- xerces/java/branches/xs-1.1-tests/data/jira_bugs/1698_1.xsd (added)
+++ xerces/java/branches/xs-1.1-tests/data/jira_bugs/1698_1.xsd Mon Dec 23 
11:30:27 2019
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>
+
+    <xs:element name="X">
+       <xs:complexType>
+          <xs:attribute name="att1" type="xs:integer" fixed="10" 
use="prohibited"/>
+       </xs:complexType>
+    </xs:element>
+           
+</xs:schema>           
\ 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=1871923&r1=1871922&r2=1871923&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
 Mon Dec 23 11:30:27 2019
@@ -500,5 +500,28 @@ public class JiraBugsTests extends Xerce
                   assertTrue(false);
                }
        }
+       
+       public void testJira_1698_1() {
+               // process the schema document in XSD 1.0 mode
+               fSchemaFactory = 
SchemaFactory.newInstance(DEFAULT_SCHEMA_LANGUAGE);
+               String schemapath = fDataDir+"/jira_bugs/1698_1.xsd";   
+               try {
+                       
fSchemaFactory.setFeature(SCHEMA_FULL_CHECKING_FEATURE_ID, true);
+                   Schema s = fSchemaFactory.newSchema(new 
StreamSource(schemapath));              
+               } catch(Exception ex) {            
+                  assertTrue(false);
+               }
+               
+               try {
+                       // process the same, schema document in XSD 1.1 mode
+                       
fSchemaFactory.setFeature(SCHEMA_FULL_CHECKING_FEATURE_ID, true);               
        
+            tearDown();
+            setUp();
+            Schema s = fSchemaFactory.newSchema(new StreamSource(schemapath));
+               } catch(Exception ex) {            
+                  // test expected error messages
+           assertEquals("src-attribute.5: The property 'fixed' is present in 
attribute 'att1', so the value of 'use' must not be 'prohibited'.", 
ex.getMessage());
+               }
+       }
                
 }



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

Reply via email to