You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by gw...@apache.org on 2007/02/15 17:39:27 UTC
svn commit: r507995 - in /incubator/tuscany/java/cts:
sdo2.1-tuscany/src/main/java/test/sdo21/vendor/tuscany/testHelper/
sdo2.1-tuscany/src/test/java/test/sdo21/vendor/tuscany/tests/
sdo2.1/src/main/java/test/sdo21/framework/ sdo2.1/src/main/java/test/...
Author: gwinn
Date: Thu Feb 15 08:39:27 2007
New Revision: 507995
URL: http://svn.apache.org/viewvc?view=rev&rev=507995
Log:
TUSCANY-1100
Added:
incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/DynamicTypesFromSchemaTestCase.java (with props)
incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema.xsd (with props)
incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema0.xml (with props)
incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema1.xml (with props)
incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema2.xml (with props)
Modified:
incubator/tuscany/java/cts/sdo2.1-tuscany/src/main/java/test/sdo21/vendor/tuscany/testHelper/TuscanyTestHelper.java
incubator/tuscany/java/cts/sdo2.1-tuscany/src/test/java/test/sdo21/vendor/tuscany/tests/SniffTest.java
incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/framework/TestHelper.java
incubator/tuscany/java/cts/sdo2.1/src/main/resources/api_test.xsd
Modified: incubator/tuscany/java/cts/sdo2.1-tuscany/src/main/java/test/sdo21/vendor/tuscany/testHelper/TuscanyTestHelper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1-tuscany/src/main/java/test/sdo21/vendor/tuscany/testHelper/TuscanyTestHelper.java?view=diff&rev=507995&r1=507994&r2=507995
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1-tuscany/src/main/java/test/sdo21/vendor/tuscany/testHelper/TuscanyTestHelper.java (original)
+++ incubator/tuscany/java/cts/sdo2.1-tuscany/src/main/java/test/sdo21/vendor/tuscany/testHelper/TuscanyTestHelper.java Thu Feb 15 08:39:27 2007
@@ -156,6 +156,14 @@
return SDOUtil.createDataGraph();
}
+ /**
+ * Create a new HelperContext, a new scope
+ * @return the new HelperContext instance.
+ */
+ public HelperContext createHelperContext() {
+ return SDOUtil.createHelperContext();
+ }
+
/*
* (non-Javadoc)
*
Modified: incubator/tuscany/java/cts/sdo2.1-tuscany/src/test/java/test/sdo21/vendor/tuscany/tests/SniffTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1-tuscany/src/test/java/test/sdo21/vendor/tuscany/tests/SniffTest.java?view=diff&rev=507995&r1=507994&r2=507995
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1-tuscany/src/test/java/test/sdo21/vendor/tuscany/tests/SniffTest.java (original)
+++ incubator/tuscany/java/cts/sdo2.1-tuscany/src/test/java/test/sdo21/vendor/tuscany/tests/SniffTest.java Thu Feb 15 08:39:27 2007
@@ -25,6 +25,7 @@
import org.junit.runners.Suite;
import test.sdo21.tests.api.DataObjectTest;
+import test.sdo21.tests.api.DynamicTypesFromSchemaTestCase;
import test.sdo21.tests.conversion.DateConversionTest;
import test.sdo21.tests.conversion.TypeConversionTest;
import test.sdo21.tests.general.XSDSerializationTest;
@@ -34,7 +35,7 @@
*
*/
@RunWith(Suite.class)
-@Suite.SuiteClasses( {DateConversionTest.class, XSDSerializationTest.class, DataObjectTest.class, TypeConversionTest.class})
+@Suite.SuiteClasses( {DateConversionTest.class, XSDSerializationTest.class, DataObjectTest.class, TypeConversionTest.class, DynamicTypesFromSchemaTestCase.class})
public class SniffTest {
Modified: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/framework/TestHelper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/framework/TestHelper.java?view=diff&rev=507995&r1=507994&r2=507995
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/framework/TestHelper.java (original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/framework/TestHelper.java Thu Feb 15 08:39:27 2007
@@ -29,6 +29,7 @@
import commonj.sdo.helper.DataFactory;
import commonj.sdo.helper.DataHelper;
import commonj.sdo.helper.EqualityHelper;
+import commonj.sdo.helper.HelperContext;
import commonj.sdo.helper.TypeHelper;
import commonj.sdo.helper.XMLHelper;
import commonj.sdo.helper.XSDHelper;
@@ -160,6 +161,11 @@
*/
public DataGraph createDataGraph();
+ /**
+ * Create a new HelperContext, a new scope
+ * @return the new HelperContext instance.
+ */
+ public HelperContext createHelperContext();
/**
* Register and initialize the SDO types supported by the specified generated factory class.
Added: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/DynamicTypesFromSchemaTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/DynamicTypesFromSchemaTestCase.java?view=auto&rev=507995
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/DynamicTypesFromSchemaTestCase.java (added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/DynamicTypesFromSchemaTestCase.java Thu Feb 15 08:39:27 2007
@@ -0,0 +1,301 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ * $Rev$ $Date$
+ */
+package test.sdo21.tests.api;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import junit.framework.TestCase;
+
+import test.sdo21.CTSSuite;
+import test.sdo21.framework.TestHelper;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLDocument;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * Tests methods of DataGraph except for change summary which is tested elsewhere.
+ */
+public class DynamicTypesFromSchemaTestCase extends TestCase {
+ private final String DYNAMIC_ROOT_TYPE_0 = "TestType0";
+
+ private final String DYNAMIC_ROOT_TYPE_1 = "TestType1";
+
+ private final String DYNAMIC_ROOT_TYPE_2 = "TestType2";
+
+ private final String DYNAMIC_TYPES_SCHEMA = "/dynamicTypesFromSchema.xsd";
+
+ private final String DYNAMIC_TYPES_URI = "http://www.example.com/dynamicTypesFromSchema";
+
+ private HelperContext hc;
+
+ private final String TEST_XML_DOC_0 = "/dynamicTypesFromSchema0.xml";
+
+ private final String TEST_XML_DOC_1 = "/dynamicTypesFromSchema1.xml";
+
+ private final String TEST_XML_DOC_2 = "/dynamicTypesFromSchema2.xml";
+
+ private List typeList;
+
+ /**
+ * Set of tests for dynamic types.
+ */
+ public DynamicTypesFromSchemaTestCase(String string) throws Exception {
+ super(string);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ TestHelper testHelper = CTSSuite.getTestHelper();
+ hc = testHelper.createHelperContext();
+
+ // Populate the meta data for the types defined in schema
+ URL url = getClass().getResource(DYNAMIC_TYPES_SCHEMA);
+ InputStream inputStream = url.openStream();
+ XSDHelper xsdHelper = hc.getXSDHelper();
+ typeList = xsdHelper.define(inputStream, url.toString());
+ inputStream.close();
+ }
+
+ /**
+ * test of Schema complex types
+ */
+ public void testDynamicTypeList() throws IOException {
+ if (typeList == null) {
+ fail("typeList unexpectedly null");
+ }
+
+ ListIterator li = typeList.listIterator();
+ SortedSet<String> typeNameSet = new TreeSet<String>();
+ while (li.hasNext()) {
+ Object obj = li.next();
+ if (obj instanceof Type) {
+ typeNameSet.add(((Type)obj).getName());
+ } else {
+ fail("a type list entry was not a type: "+obj.toString());
+ }
+ }
+ assertTrue(typeNameSet.contains("Address"));
+ assertTrue(typeNameSet.contains("Component"));
+ assertTrue(typeNameSet.contains("DocumentRoot"));
+ assertTrue(typeNameSet.contains("TestType0"));
+ assertTrue(typeNameSet.contains("TestType1"));
+ assertTrue(typeNameSet.contains("TestType2"));
+ assertTrue(typeNameSet.contains("evenNumberOfOddOrEvenDigits"));
+ assertTrue(typeNameSet.contains("evenNumberOfOddOrEvenDigitsObject"));
+ assertTrue(typeNameSet.contains("month"));
+ assertTrue(typeNameSet.contains("monthList"));
+ assertTrue(typeNameSet.contains("monthObject"));
+ assertTrue(typeNameSet.contains("oddOrEvenDigits"));
+ assertTrue(typeNameSet.contains("oddOrEvenDigitsObject"));
+ assertTrue(typeNameSet.contains("smallBigDecimal"));
+ assertTrue(typeNameSet.contains("smallBigInteger"));
+ assertTrue(typeNameSet.contains("smallInt"));
+ assertTrue(typeNameSet.contains("smallIntObject"));
+ assertTrue(typeNameSet.contains("smallOddNumber"));
+ assertTrue(typeNameSet.contains("smallOddNumberObject"));
+ assertTrue(typeNameSet.contains("status"));
+ assertTrue(typeNameSet.contains("statusOrMonthList"));
+ }
+
+ /**
+ * test #0 of Schema primitive datatypes
+ */
+ public void testDynamicTypesGroup0() throws IOException {
+ if (hc == null) {
+ fail("the HelperContext unexpectedly null");
+ }
+
+ TypeHelper th = hc.getTypeHelper();
+ Type rootType0 = th.getType(DYNAMIC_TYPES_URI, DYNAMIC_ROOT_TYPE_0);
+
+ assertNotNull(rootType0);
+
+ DataFactory df = hc.getDataFactory();
+ DataObject rootObject = df.create(rootType0);
+
+ assertNotNull(rootObject);
+
+ XMLHelper xh = hc.getXMLHelper();
+ XMLDocument doc = xh.load(getClass().getResourceAsStream(TEST_XML_DOC_0));
+ DataObject rootObject0 = doc.getRootObject();
+
+ assertNotNull(rootObject0);
+ List propList = rootObject0.getInstanceProperties();
+ SortedSet<String> propNameSet = new TreeSet<String>();
+ ListIterator li1 = propList.listIterator();
+ while (li1.hasNext()) {
+ Object obj = li1.next();
+ if (obj instanceof Property) {
+ propNameSet.add(((Property)obj).getName());
+ } else {
+ fail("getInstanceProperties list contained: "+obj.toString());
+ }
+ }
+ assertTrue(propNameSet.contains("anyURI"));
+ assertTrue(propNameSet.contains("base64Binary"));
+ assertTrue(propNameSet.contains("boolean"));
+ assertTrue(propNameSet.contains("date"));
+ assertTrue(propNameSet.contains("dateTime"));
+ assertTrue(propNameSet.contains("decimal"));
+ assertTrue(propNameSet.contains("double"));
+ assertTrue(propNameSet.contains("duration"));
+ assertTrue(propNameSet.contains("float"));
+ assertTrue(propNameSet.contains("gDay"));
+ assertTrue(propNameSet.contains("gMonth"));
+ assertTrue(propNameSet.contains("gMonthDay"));
+ assertTrue(propNameSet.contains("gYear"));
+ assertTrue(propNameSet.contains("gYearMonth"));
+ assertTrue(propNameSet.contains("hexBinary"));
+ assertTrue(propNameSet.contains("mixed"));
+ assertTrue(propNameSet.contains("string"));
+ assertTrue(propNameSet.contains("text"));
+ assertTrue(propNameSet.contains("time"));
+ }
+
+ /**
+ * test #1 of Schema derived datatypes
+ */
+ public void testDynamicTypesGroup1() throws IOException {
+ if (hc == null) {
+ fail("the HelperContext unexpectedly null");
+ }
+
+ TypeHelper th = hc.getTypeHelper();
+ Type rootType = th.getType(DYNAMIC_TYPES_URI, DYNAMIC_ROOT_TYPE_1);
+
+ assertNotNull(rootType);
+
+ DataFactory df = hc.getDataFactory();
+ DataObject rootObject = df.create(rootType);
+
+ assertNotNull(rootObject);
+
+ XMLHelper xh = hc.getXMLHelper();
+ XMLDocument doc = xh.load(getClass().getResourceAsStream(TEST_XML_DOC_1));
+ DataObject rootObject1 = doc.getRootObject();
+
+ assertNotNull(rootObject1);
+ List propList = rootObject1.getInstanceProperties();
+ SortedSet<String> propNameSet = new TreeSet<String>();
+ ListIterator li1 = propList.listIterator();
+ while (li1.hasNext()) {
+ Object obj = li1.next();
+ if (obj instanceof Property) {
+ propNameSet.add(((Property)obj).getName());
+ } else {
+ fail("getInstanceProperties list contained: "+obj.toString());
+ }
+ }
+ assertTrue(propNameSet.contains("ID"));
+ assertTrue(propNameSet.contains("IDREF"));
+ assertTrue(propNameSet.contains("IDREFS"));
+ assertTrue(propNameSet.contains("NCName"));
+ assertTrue(propNameSet.contains("NMTOKEN"));
+ assertTrue(propNameSet.contains("NMTOKENS"));
+ assertTrue(propNameSet.contains("Name"));
+ assertTrue(propNameSet.contains("byte"));
+ assertTrue(propNameSet.contains("int"));
+ assertTrue(propNameSet.contains("integer"));
+ assertTrue(propNameSet.contains("language"));
+ assertTrue(propNameSet.contains("long"));
+ assertTrue(propNameSet.contains("mixed"));
+ assertTrue(propNameSet.contains("negativeInteger"));
+ assertTrue(propNameSet.contains("nonNegativeInteger"));
+ assertTrue(propNameSet.contains("nonPositiveInteger"));
+ assertTrue(propNameSet.contains("normalizedString"));
+ assertTrue(propNameSet.contains("positiveInteger"));
+ assertTrue(propNameSet.contains("short"));
+ assertTrue(propNameSet.contains("text"));
+ assertTrue(propNameSet.contains("token"));
+ assertTrue(propNameSet.contains("unsignedByte"));
+ assertTrue(propNameSet.contains("unsignedInt"));
+ assertTrue(propNameSet.contains("unsignedLong"));
+ assertTrue(propNameSet.contains("unsignedShort"));
+ }
+
+ /**
+ * test #2 of more Schema derived datatypes
+ */
+ public void testDynamicTypesGroup2() throws IOException {
+ if (hc == null) {
+ fail("the HelperContext unexpectedly null");
+ }
+
+ TypeHelper th = hc.getTypeHelper();
+ Type rootType = th.getType(DYNAMIC_TYPES_URI, DYNAMIC_ROOT_TYPE_2);
+
+ assertNotNull(rootType);
+
+ DataFactory df = hc.getDataFactory();
+ DataObject rootObject = df.create(rootType);
+
+ assertNotNull(rootObject);
+
+ XMLHelper xh = hc.getXMLHelper();
+ XMLDocument doc = xh.load(getClass().getResourceAsStream(TEST_XML_DOC_2));
+ DataObject rootObject2 = doc.getRootObject();
+
+ assertNotNull(rootObject2);
+ List propList = rootObject2.getInstanceProperties();
+ SortedSet<String> propNameSet = new TreeSet<String>();
+ ListIterator li1 = propList.listIterator();
+ while (li1.hasNext()) {
+ Object obj = li1.next();
+ if (obj instanceof Property) {
+ propNameSet.add(((Property)obj).getName());
+ } else {
+ fail("getInstanceProperties list contained: "+obj.toString());
+ }
+ }
+ assertTrue(propNameSet.contains("addresses"));
+ assertTrue(propNameSet.contains("any"));
+ assertTrue(propNameSet.contains("cluster"));
+ assertTrue(propNameSet.contains("clusters"));
+ assertTrue(propNameSet.contains("components"));
+ assertTrue(propNameSet.contains("headerValue"));
+ assertTrue(propNameSet.contains("item"));
+ assertTrue(propNameSet.contains("items"));
+ assertTrue(propNameSet.contains("mixed"));
+ assertTrue(propNameSet.contains("nCName"));
+ assertTrue(propNameSet.contains("otherTag"));
+ assertTrue(propNameSet.contains("overallStatus"));
+ assertTrue(propNameSet.contains("smallBigDecimal"));
+ assertTrue(propNameSet.contains("smallBigInteger"));
+ assertTrue(propNameSet.contains("smallInt"));
+ assertTrue(propNameSet.contains("smallOddNumber"));
+ assertTrue(propNameSet.contains("statusOrMonthList"));
+ assertTrue(propNameSet.contains("text"));
+ assertTrue(propNameSet.contains("wierdNumber"));
+ }
+}
Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/DynamicTypesFromSchemaTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/DynamicTypesFromSchemaTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/java/cts/sdo2.1/src/main/resources/api_test.xsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/resources/api_test.xsd?view=diff&rev=507995&r1=507994&r2=507995
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/resources/api_test.xsd (original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/resources/api_test.xsd Thu Feb 15 08:39:27 2007
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- * Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as
-
-applicable.
+ * Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Added: incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema.xsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema.xsd?view=auto&rev=507995
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema.xsd (added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema.xsd Thu Feb 15 08:39:27 2007
@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<xsd:schema
+ targetNamespace="http://www.example.com/dynamicTypesFromSchema"
+ xmlns:dtfs="http://www.example.com/dynamicTypesFromSchema"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <!--
+ elements and types for testElement0
+ provides examples of using XML Schema primitive datatypes (see 3.2 of XML Schema Part 2)
+ (QName and NOTATION omitted as they are not appropriate as types for element content.)
+ -->
+
+ <xsd:complexType name="TestType0" mixed="true">
+ <xsd:sequence>
+ <xsd:element name="string" minOccurs="0" maxOccurs="unbounded" type="xsd:string"/>
+ <xsd:element name="boolean" minOccurs="0" maxOccurs="unbounded" type="xsd:boolean"/>
+ <xsd:element name="decimal" minOccurs="0" maxOccurs="unbounded" type="xsd:decimal"/>
+ <xsd:element name="float" minOccurs="0" maxOccurs="unbounded" type="xsd:float"/>
+ <xsd:element name="double" minOccurs="0" maxOccurs="unbounded" type="xsd:double"/>
+ <xsd:element name="duration" minOccurs="0" maxOccurs="unbounded" type="xsd:duration"/>
+ <xsd:element name="dateTime" minOccurs="0" maxOccurs="unbounded" type="xsd:dateTime"/>
+ <xsd:element name="time" minOccurs="0" maxOccurs="unbounded" type="xsd:time"/>
+ <xsd:element name="date" minOccurs="0" maxOccurs="unbounded" type="xsd:date"/>
+ <xsd:element name="gYearMonth" minOccurs="0" maxOccurs="unbounded" type="xsd:gYearMonth"/>
+ <xsd:element name="gYear" minOccurs="0" maxOccurs="unbounded" type="xsd:gYear"/>
+ <xsd:element name="gMonthDay" minOccurs="0" maxOccurs="unbounded" type="xsd:gMonthDay"/>
+ <xsd:element name="gDay" minOccurs="0" maxOccurs="unbounded" type="xsd:gDay"/>
+ <xsd:element name="gMonth" minOccurs="0" maxOccurs="unbounded" type="xsd:gMonth"/>
+ <xsd:element name="hexBinary" minOccurs="0" maxOccurs="unbounded" type="xsd:hexBinary"/>
+ <xsd:element name="base64Binary" minOccurs="0" maxOccurs="unbounded" type="xsd:base64Binary"/>
+ <xsd:element name="anyURI" minOccurs="0" maxOccurs="unbounded" type="xsd:anyURI"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:element name="testElement0" type="dtfs:TestType0"/>
+
+ <!--
+ elements and types for testElement1
+ provides examples of using XML Schema derived datatypes (see 3.3 of XML Schema Part 2)
+ (ENTITY and ENTITIES omitted as they are not appropriate as types for element content.)
+ -->
+
+ <xsd:complexType name="TestType1" mixed="true">
+ <xsd:sequence>
+ <xsd:element name="normalizedString" minOccurs="0" maxOccurs="unbounded" type="xsd:normalizedString"/>
+ <xsd:element name="token" minOccurs="0" maxOccurs="unbounded" type="xsd:token"/>
+ <xsd:element name="language" minOccurs="0" maxOccurs="unbounded" type="xsd:language"/>
+ <xsd:element name="NMTOKEN" minOccurs="0" maxOccurs="unbounded" type="xsd:NMTOKEN"/>
+ <xsd:element name="NMTOKENS" minOccurs="0" maxOccurs="unbounded" type="xsd:NMTOKENS"/>
+ <xsd:element name="Name" minOccurs="0" maxOccurs="unbounded" type="xsd:Name"/>
+ <xsd:element name="NCName" minOccurs="0" maxOccurs="unbounded" type="xsd:NCName"/>
+ <xsd:element name="ID" minOccurs="0" maxOccurs="unbounded" type="xsd:ID"/>
+ <xsd:element name="IDREF" minOccurs="0" maxOccurs="unbounded" type="xsd:IDREF"/>
+ <xsd:element name="IDREFS" minOccurs="0" maxOccurs="unbounded" type="xsd:IDREFS"/>
+ <xsd:element name="integer" minOccurs="0" maxOccurs="unbounded" type="xsd:integer"/>
+ <xsd:element name="nonPositiveInteger" minOccurs="0" maxOccurs="unbounded" type="xsd:nonPositiveInteger"/>
+ <xsd:element name="negativeInteger" minOccurs="0" maxOccurs="unbounded" type="xsd:negativeInteger"/>
+ <xsd:element name="long" minOccurs="0" maxOccurs="unbounded" type="xsd:long"/>
+ <xsd:element name="int" minOccurs="0" maxOccurs="unbounded" type="xsd:int"/>
+ <xsd:element name="short" minOccurs="0" maxOccurs="unbounded" type="xsd:short"/>
+ <xsd:element name="byte" minOccurs="0" maxOccurs="unbounded" type="xsd:byte"/>
+ <xsd:element name="nonNegativeInteger" minOccurs="0" maxOccurs="unbounded" type="xsd:nonNegativeInteger"/>
+ <xsd:element name="unsignedLong" minOccurs="0" maxOccurs="unbounded" type="xsd:unsignedLong"/>
+ <xsd:element name="unsignedInt" minOccurs="0" maxOccurs="unbounded" type="xsd:unsignedInt"/>
+ <xsd:element name="unsignedShort" minOccurs="0" maxOccurs="unbounded" type="xsd:unsignedShort"/>
+ <xsd:element name="unsignedByte" minOccurs="0" maxOccurs="unbounded" type="xsd:unsignedByte"/>
+ <xsd:element name="positiveInteger" minOccurs="0" maxOccurs="unbounded" type="xsd:positiveInteger"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:element name="testElement1" type="dtfs:TestType1"/>
+
+ <!--
+ elements and types for testElement2
+ provides examples of deriving new types by restriction
+ -->
+
+ <xsd:simpleType name="month">
+ <xsd:restriction base="xsd:int">
+ <xsd:minInclusive value="1"/>
+ <xsd:maxInclusive value="12"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:simpleType name="status">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="unspecified"/>
+ <xsd:enumeration value="Good"/>
+ <xsd:enumeration value="Indifferent"/>
+ <xsd:enumeration value="Bad"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:simpleType name="smallOddNumber">
+ <xsd:restriction base="xsd:int">
+ <xsd:enumeration value="1"/>
+ <xsd:enumeration value="3"/>
+ <xsd:enumeration value="5"/>
+ <xsd:enumeration value="7"/>
+ <xsd:enumeration value="9"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:simpleType name="oddOrEvenDigits">
+ <xsd:restriction base="xsd:int">
+ <xsd:pattern value="[13579]*"/>
+ <xsd:pattern value="[02468]*"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:simpleType name="evenNumberOfOddOrEvenDigits">
+ <xsd:restriction base="dtfs:oddOrEvenDigits">
+ <xsd:pattern value="(..)*"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:simpleType name="smallBigDecimal">
+ <xsd:restriction base="xsd:decimal">
+ <xsd:totalDigits value="10"/>
+ <xsd:fractionDigits value="2"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:simpleType name="smallBigInteger">
+ <xsd:restriction base="xsd:integer">
+ <xsd:totalDigits value="10"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:simpleType name="smallInt">
+ <xsd:restriction base="xsd:int">
+ <xsd:totalDigits value="2"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:simpleType name="monthList">
+ <xsd:list itemType="dtfs:month"/>
+ </xsd:simpleType>
+
+ <xsd:simpleType name="statusOrMonthList">
+ <xsd:union memberTypes="dtfs:status dtfs:monthList"/>
+ </xsd:simpleType>
+
+ <xsd:complexType name="Address">
+ <xsd:attribute name="ip" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="Component">
+ <xsd:sequence>
+ <xsd:any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="from" use="required" type="xsd:IDREF"/>
+ <xsd:attribute name="to" use="required" type="xsd:IDREFS"/>
+ <xsd:attribute name="cc" type="xsd:IDREFS"/>
+ <xsd:attribute name="bcc" type="xsd:IDREFS"/>
+ <xsd:attribute name="status" type="dtfs:status"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="TestType2" mixed="true">
+ <xsd:sequence>
+ <xsd:element name="smallBigDecimal" minOccurs="0" type="dtfs:smallBigDecimal"/>
+ <xsd:element name="smallBigInteger" minOccurs="0" type="dtfs:smallBigInteger"/>
+ <xsd:element name="smallInt" minOccurs="0" type="dtfs:smallInt"/>
+ <xsd:element name="wierdNumber" minOccurs="0" type="dtfs:evenNumberOfOddOrEvenDigits" default="11"/>
+ <xsd:element name="smallOddNumber" minOccurs="0" type="dtfs:smallOddNumber"/>
+ <xsd:element name="headerValue" nillable="true" minOccurs="0" type="xsd:int"/>
+ <xsd:element name="overallStatus" nillable="true" minOccurs="0" type="dtfs:status"/>
+ <xsd:element name="addresses" minOccurs="1" maxOccurs="unbounded" type="dtfs:Address"/>
+ <xsd:element name="components" minOccurs="1" maxOccurs="unbounded" type="dtfs:Component"/>
+ <xsd:element name="item" type="xsd:IDREF"/>
+ <xsd:element name="items" maxOccurs="unbounded" type="xsd:IDREF"/>
+ <xsd:element name="cluster" type="xsd:IDREFS"/>
+ <xsd:element name="clusters" maxOccurs="unbounded" type="xsd:IDREFS"/>
+ <xsd:element name="statusOrMonthList" minOccurs="0" maxOccurs="unbounded" type="dtfs:statusOrMonthList"/>
+ <xsd:element ref="dtfs:nCName" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:element name="nCName" type="xsd:NCName"/>
+
+ <xsd:element name="testElement2" type="dtfs:TestType2"/>
+
+</xsd:schema>
Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema.xsd
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema0.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema0.xml?view=auto&rev=507995
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema0.xml (added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema0.xml Thu Feb 15 08:39:27 2007
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<dtfs:testElement0 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:dtfs="http://www.example.com/dynamicTypesFromSchema"
+ xsi:schemaLocation="http://www.example.com/dynamicTypesFromSchema dynamicTypesFromSchema.xsd">
+ <string>This is a string. Multiple spaces are preserved.</string>
+ <boolean>true</boolean>
+ <boolean>false</boolean>
+ <boolean>true</boolean>
+ <boolean>1</boolean>
+ <boolean>0</boolean>
+ <decimal>-1.23</decimal>
+ <decimal>12678967.543233</decimal>
+ <decimal>+100000.00</decimal>
+ <decimal>210</decimal>
+ <float>0</float>
+ <float>-0</float>
+<!-- <float>INF</float> -->
+ <float>NaN</float>
+<!-- <float>-INF</float> -->
+ <float>-1E4</float>
+ <float>1267.43233E12</float>
+ <float>12.78e-2</float>
+ <float>12</float>
+ <double>0</double>
+ <double>-0</double>
+<!-- <double>INF</double> -->
+ <double>NaN</double>
+<!-- <double>-INF</double> -->
+ <double>-1E4</double>
+ <double>1267.43233E200</double>
+ <double>12.78e-150</double>
+ <double>12</double>
+ <duration>P1Y2M3DT10H30M5S</duration>
+ <duration>-P120D</duration>
+ <dateTime>1999-05-31T13:20:00-05:00</dateTime>
+ <dateTime>2000-01-20T12:00:00</dateTime>
+ <dateTime>2000-01-20T12:00:00Z</dateTime>
+ <time>13:20:00-05:00</time>
+ <time>12:00:00</time>
+ <time>12:00:00Z</time>
+ <date>2007-02-01</date>
+ <date>1990-12-31</date>
+ <date>1990-12-31-05:00</date>
+ <date>1990-12-31Z</date>
+ <gYearMonth>1990-12</gYearMonth>
+ <gYearMonth>1990-12-05:00</gYearMonth>
+ <gYearMonth>1990-12Z</gYearMonth>
+ <gYear>1990</gYear>
+ <gYear>1990-05:00</gYear>
+ <gYear>1990Z</gYear>
+ <gMonthDay>--12-31</gMonthDay>
+ <gMonthDay>--12-31-05:00</gMonthDay>
+ <gMonthDay>--12-31Z</gMonthDay>
+ <gDay>---31</gDay>
+ <gDay>---31-05:00</gDay>
+ <gDay>---31Z</gDay>
+ <gMonth>--12--</gMonth>
+ <gMonth>--12---05:00</gMonth>
+ <gMonth>--12--Z</gMonth>
+ <hexBinary>0FB7</hexBinary>
+ <base64Binary>GpM7</base64Binary>
+ <anyURI>http://www.example.com/dynamicTypesFromSchema</anyURI>
+</dtfs:testElement0>
Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema0.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema0.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema0.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema1.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema1.xml?view=auto&rev=507995
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema1.xml (added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema1.xml Thu Feb 15 08:39:27 2007
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<dtfs:testElement1
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:dtfs="http://www.example.com/dynamicTypesFromSchema"
+ xsi:schemaLocation="http://www.example.com/dynamicTypesFromSchema dynamicTypesFromSchema.xsd">
+ <normalizedString>a string without CR or TAB characters</normalizedString>
+ <token>a normalizedString without leading or trailing or multiple internal blanks</token>
+ <language>en-US</language>
+ <NMTOKEN>a-sequeunce:of.XML_NameChar_characters</NMTOKEN>
+ <NMTOKENS>one or more NMTOKEN items separated with single spaces</NMTOKENS>
+ <Name>A_letter_underscore_or_colon_optionally_followed_by_NameChar_characters</Name>
+ <NCName>a_Name_without_colons</NCName>
+ <ID>an_NCName_for_ID_attribute</ID>
+ <IDREF>an_NCName_for_ID_attribute</IDREF>
+ <IDREFS>an_NCName_for_ID_attribute an_NCName_for_ID_attribute</IDREFS>
+ <integer>92233720368547758079223372036854775807</integer>
+ <integer>0</integer>
+ <integer>-92233720368547758089223372036854775808</integer>
+ <nonPositiveInteger>0</nonPositiveInteger>
+ <nonPositiveInteger>-92233720368547758089223372036854775808</nonPositiveInteger>
+ <negativeInteger>-1</negativeInteger>
+ <negativeInteger>-92233720368547758089223372036854775808</negativeInteger>
+ <long>9223372036854775807</long>
+ <long>0</long>
+ <long>-9223372036854775808</long>
+ <int>2147483647</int>
+ <int>1</int>
+ <int>-2147483648</int>
+ <short>32767</short>
+ <short>0</short>
+ <short>-32768</short>
+ <byte>127</byte>
+ <byte>0</byte>
+ <byte>-128</byte>
+ <nonNegativeInteger>92233720368547758079223372036854775807</nonNegativeInteger>
+ <nonNegativeInteger>0</nonNegativeInteger>
+ <unsignedLong>18446744073709551615</unsignedLong>
+ <unsignedLong>0</unsignedLong>
+ <unsignedInt>4294967295</unsignedInt>
+ <unsignedInt>0</unsignedInt>
+ <unsignedShort>65535</unsignedShort>
+ <unsignedShort>0</unsignedShort>
+ <unsignedByte>255</unsignedByte>
+ <unsignedByte>0</unsignedByte>
+ <positiveInteger>92233720368547758079223372036854775807</positiveInteger>
+ <positiveInteger>1</positiveInteger>
+</dtfs:testElement1>
Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema1.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema1.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema1.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema2.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema2.xml?view=auto&rev=507995
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema2.xml (added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema2.xml Thu Feb 15 08:39:27 2007
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<dtfs:testElement2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:dtfs="http://www.example.com/dynamicTypesFromSchema"
+ xmlns:notest="http://www.example.com/notChecked"
+ xsi:schemaLocation="http://www.example.com/dynamicTypesFromSchema dynamicTypesFromSchema.xsd">
+ <smallBigDecimal>99999999.88</smallBigDecimal>
+ <smallBigInteger>8888888888</smallBigInteger>
+ <smallInt>77</smallInt>
+ <wierdNumber>1111</wierdNumber>
+ <smallOddNumber>3</smallOddNumber>
+ <headerValue xsi:nil="true"/>
+ <overallStatus xsi:nil="true"/>
+ <addresses ip="IP.255.255.255.0"/>
+ <addresses ip="IP.255.255.255.1"/>
+ <addresses ip="IP.255.255.255.255"/>
+ <components from="IP.255.255.255.255" status="Good" to="IP.255.255.255.255"/>
+ <components from="IP.255.255.255.255" status="Indifferent" to="IP.255.255.255.0"/>
+ <components cc="IP.255.255.255.1" from="IP.255.255.255.255" status="Bad"
+ to="IP.255.255.255.255"/>
+ <components bcc="IP.255.255.255.1" from="IP.255.255.255.255" status="unspecified"
+ to="IP.255.255.255.255"/>
+ <item>IP.255.255.255.0</item>
+ <items>IP.255.255.255.1</items>
+ <items>IP.255.255.255.255</items>
+ <cluster>IP.255.255.255.0 IP.255.255.255.1</cluster>
+ <clusters>IP.255.255.255.0 IP.255.255.255.1</clusters>
+ <clusters>IP.255.255.255.0 IP.255.255.255.1</clusters>
+ <statusOrMonthList>1 5 12</statusOrMonthList>
+ <statusOrMonthList>Indifferent</statusOrMonthList>
+ <dtfs:nCName>A_Non_Colon_Name</dtfs:nCName>
+ <notest:otherTag statusOrMonthList="1 7 25">The testing of this element is lax.</notest:otherTag>
+</dtfs:testElement2>
Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema2.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema2.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/resources/dynamicTypesFromSchema2.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org