You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-cvs@xml.apache.org by da...@apache.org on 2004/01/23 23:35:05 UTC

cvs commit: xml-xmlbeans/v1/test/src/drt/drtcases ValidationTests.java

daveremy    2004/01/23 14:35:05

  Modified:    v1/src/typeimpl/org/apache/xmlbeans/impl/schema Tag:
                        xmlbeans-1-0-1_branch StscJavaizer.java
               v1/test/src/drt/drtcases Tag: xmlbeans-1-0-1_branch
                        ValidationTests.java
  Log:
  PR: bugzilla 26105
  Submitted by:	Kevin Krouse
  Reviewed by:	David Bau
  
  When compiling a schema in-memory, we weren't ensuring the base types were
  completely finished before compiling a type.
  
  DRT: passed
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.2.2.1   +5 -0      xml-xmlbeans/v1/src/typeimpl/org/apache/xmlbeans/impl/schema/StscJavaizer.java
  
  Index: StscJavaizer.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v1/src/typeimpl/org/apache/xmlbeans/impl/schema/StscJavaizer.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- StscJavaizer.java	24 Sep 2003 23:31:07 -0000	1.2
  +++ StscJavaizer.java	23 Jan 2004 22:35:05 -0000	1.2.2.1
  @@ -164,6 +164,11 @@
       {
           if (sImpl.isJavaized())
               return;
  +        
  +        SchemaTypeImpl baseType = (SchemaTypeImpl)sImpl.getBaseType();
  +        if (baseType != null)
  +            skipJavaizingType(baseType);
  +        
           sImpl.startJavaizing();
           secondPassProcessType(sImpl);
           sImpl.finishJavaizing();
  
  
  
  No                   revision
  No                   revision
  1.2.2.1   +31 -0     xml-xmlbeans/v1/test/src/drt/drtcases/ValidationTests.java
  
  Index: ValidationTests.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v1/test/src/drt/drtcases/ValidationTests.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- ValidationTests.java	24 Sep 2003 23:31:17 -0000	1.2
  +++ ValidationTests.java	23 Jan 2004 22:35:05 -0000	1.2.2.1
  @@ -1609,4 +1609,35 @@
   
       }
   
  +    // Bugzilla bug #26105: validate derived type from base type enumeration
  +    public void testValidate11() throws Exception {
  +        String schemas[] = {
  +            "<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema'>\n" +
  +
  +            "<xsd:element name='enumDef' type='enumDefType'/>\n" +
  +            "<xsd:complexType name='enumDefType'>\n" +
  +            "  <xsd:simpleContent>\n" +
  +            "    <xsd:extension base='enumType'/>\n" +
  +            "  </xsd:simpleContent>\n" +
  +            "</xsd:complexType>\n" +
  +
  +            "<xsd:simpleType name='enumType'>\n" +
  +            "  <xsd:restriction base='xsd:token'>\n" +
  +            "    <xsd:enumeration value='enum1'/>\n" +
  +            "  </xsd:restriction>\n" +
  +            "</xsd:simpleType>\n" +
  +            "</xsd:schema>\n",
  +        };
  +
  +        String[] valid = {
  +            "<enumDef>enum1</enumDef>",
  +        };
  +
  +        String[] invalid = {
  +            "<enumDef>enum2/enumDef>",
  +        };
  +
  +        doTest(schemas, null, valid, invalid);
  +    }
  +
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-cvs-help@xml.apache.org