tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gw...@apache.org
Subject svn commit: r501803 [5/5] - in /incubator/tuscany/java/cts/sdo2.1/src/main: java/test/sdo21/ java/test/sdo21/framework/ java/test/sdo21/paramatizedTests/ java/test/sdo21/paramatizedTests/api/ java/test/sdo21/paramatizedTests/conversion/ java/test/sdo21...
Date Wed, 31 Jan 2007 11:18:48 GMT
Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/conversion/TypeConversionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/conversion/TypeConversionTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/conversion/package.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/conversion/package.html?view=auto&rev=501803
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/conversion/package.html
(added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/conversion/package.html
Wed Jan 31 03:18:45 2007
@@ -0,0 +1,25 @@
+<html>
+<!--
+  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$
+-->
+<body>
+Contains test cases for conversion test.
+</body>
+</html>

Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/conversion/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/conversion/package.html
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/conversion/package.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/general/XSDSerializationTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/general/XSDSerializationTest.java?view=auto&rev=501803
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/general/XSDSerializationTest.java
(added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/general/XSDSerializationTest.java
Wed Jan 31 03:18:45 2007
@@ -0,0 +1,169 @@
+/*
+ *  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.general;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.net.URL;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Vector;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import test.sdo21.CTSSuite;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * Junit 4.1 test case. Tests XSD serialization/deserialization.
+ * 
+ */
+
+public class XSDSerializationTest {
+    private static final String TEST_MODEL = "/simple.xsd";
+
+    private static URL modelURL;
+
+    /**
+     * Obtains test model resource.
+     * Runs once before any of the test methods.
+     */
+    @BeforeClass
+    public static void obtainResource() {
+        modelURL = XSDSerializationTest.class.getResource(TEST_MODEL);
+    }
+
+    /**
+     * Verifies the performance of XSDHelper.define()
+     * when a SchemaLocation is provided.
+     */
+    @Test
+    public void testDefineWithLocation() {
+        try {
+            
+            XSDHelper xsdHelper = test.sdo21.CTSSuite.getTestHelper().getXSDHelper();
+            List types = xsdHelper.define(modelURL.openStream(), modelURL.toString());
+            assertEquals("XSDHelper.define() did not create the expected number of Types",
2, types.size());
+        } catch (Exception e) {
+            e.printStackTrace();
+            fail("Exception calling xsdHelper.define" + e.toString());
+        }
+    }
+
+    /**
+     * Verifies the performance of XSDHelper.define()
+     * when a SchemaLocation is not provided.
+     */
+    @Test
+    public void testDefineWithNoLocation() {
+        try {
+            XSDHelper xsdHelper = test.sdo21.CTSSuite.getTestHelper().getXSDHelper();
+            List types = xsdHelper.define(XSDSerializationTest.class.getResourceAsStream(TEST_MODEL),
null);
+            assertEquals("XSDHelper.define() did not create the expected number of Types",
2, types.size());
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            fail("Exception caught" + e.toString());
+        }
+    }
+
+    /**
+     * Verifies that duplicate Types are not redefined.
+     */
+    @Test
+    public void testDuplicateDefineWithLocation() {
+        try {
+            XSDHelper xsdHelper = test.sdo21.CTSSuite.getTestHelper().getXSDHelper();   
       
+            List types = xsdHelper.define(modelURL.openStream(), modelURL.toString());
+            assertEquals("XSDHelper.define() did not create the expected number of Types",
2, types.size());
+            // redefine type
+            List duplicateTypes = xsdHelper.define(modelURL.openStream(), modelURL.toString());
+            assertEquals("XSDHelper.define() did not create the expected number of Types",
0, duplicateTypes.size());
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            fail("Exception caught" + e.toString());
+        }
+    }
+
+
+    /**
+     * Verifies the performance of XSDHelper.generate for dynamic SDOs with no XSD model.
+     */
+    @Test
+    public void testXSDGeneration_DynamicSDOType() {
+        try {
+            boolean exceptionCaught = false;
+
+            // test for dynamic SDOs that have no XSD model. Here the testcase
+            // succeeds only if the
+            // xsd is generated by XSDHelper in which case xsd must not be null
+            XSDHelper xsdHelper = test.sdo21.CTSSuite.getTestHelper().getXSDHelper();
+            DataObject quoteType = CTSSuite.getTestHelper().getDataFactory().create("commonj.sdo",
"Type");
+            quoteType.set("uri", "http://www.example.com/dynamic");
+            quoteType.set("name", "DynamicQuote");
+
+            TypeHelper th = CTSSuite.getTestHelper().getTypeHelper();
+            DataObject aProperty = quoteType.createDataObject("property");
+            aProperty.set("name", "symbol");
+            aProperty.set("type", th.getType("commonj.sdo", "String"));
+
+            aProperty = quoteType.createDataObject("property");
+            aProperty.set("name", "price");
+            aProperty.set("type", th.getType("commonj.sdo", "Decimal"));
+
+            aProperty = quoteType.createDataObject("property");
+            aProperty.set("name", "volume");
+            aProperty.set("type", th.getType("commonj.sdo", "Double"));
+
+            th.define(quoteType);
+
+            Type dynamicQuoteType = th.getType("http://www.example.com/dynamic", "DynamicQuote");
+
+            Vector types = new Vector();
+            types.add(dynamicQuoteType);
+            String xsd = null;
+
+            try {
+                xsd = xsdHelper.generate(types);
+                // System.out.println(xsd);
+            } catch (IllegalArgumentException e) {
+                fail("XSDHelper.generate() did not complete as expected for dynamic SDOs
with no XSD model.  Exception was thrown : " + e
+                    .toString());
+            }
+            assertNotNull("XSDHelper.generate() did not complete as expected for dynamic
SDOs with no XSD model.  Exception was thrown",
+                          xsd);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            fail("Exception caught" + e.toString());
+        }
+    }
+}

Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/general/XSDSerializationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/general/XSDSerializationTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/general/package.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/general/package.html?view=auto&rev=501803
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/general/package.html
(added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/general/package.html
Wed Jan 31 03:18:45 2007
@@ -0,0 +1,25 @@
+<html>
+<!--
+  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$
+-->
+<body>
+Contains test cases for other general test.
+</body>
+</html>

Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/general/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/general/package.html
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/general/package.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/package.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/package.html?view=auto&rev=501803
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/package.html (added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/package.html Wed Jan
31 03:18:45 2007
@@ -0,0 +1,25 @@
+<html>
+<!--
+  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$
+-->
+<body>
+Contains base class of non-paramatized test cases.
+</body>
+</html>

Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/package.html
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/package.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Modified: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/scenarios/DataObjectListTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/scenarios/DataObjectListTest.java?view=diff&rev=501803&r1=501802&r2=501803
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/scenarios/DataObjectListTest.java
(original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/scenarios/DataObjectListTest.java
Wed Jan 31 03:18:45 2007
@@ -1,5 +1,4 @@
-/**
- *
+/*
  *  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
@@ -16,6 +15,8 @@
  *  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.scenarios;

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=501803&r1=501802&r2=501803
==============================================================================
--- 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 Wed Jan 31 03:18:45
2007
@@ -49,7 +49,7 @@
        <xsd:element name="lastName" type="sdo:String"/>
      </xsd:sequence>
    </xsd:complexType>
-   <xsd:complexType name="Sequenced" sdo:aliasName="Seq2" sdo:sequence="true">
+   <xsd:complexType name="Sequenced" sdo:aliasName="Seq2" sdo:sequence="true" mixed="true">
      <xsd:complexContent>
       <xsd:extension base="simple:Abstract">
          <xsd:sequence>



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message