tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gw...@apache.org
Subject svn commit: r501803 [3/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
Added: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/general/ActiveUpdatingTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/general/ActiveUpdatingTest.java?view=auto&rev=501803
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/general/ActiveUpdatingTest.java (added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/general/ActiveUpdatingTest.java Wed Jan 31 03:18:45 2007
@@ -0,0 +1,311 @@
+/*
+ *  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.paramatizedTests.general;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import test.sdo21.CTSSuite;
+import test.sdo21.paramatizedTests.BaseSDOParamatizedTest;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+
+/**
+ * Tests for proper updates to DataObject and their value changes due to the updates.
+ */
+@RunWith(Parameterized.class)
+public class ActiveUpdatingTest extends BaseSDOParamatizedTest {
+    
+
+    /**
+     * Tests for proper updates to DataObject and their value changes due to the updates.
+     */
+    public ActiveUpdatingTest(DataObject testDO, String description) {
+        super(testDO, description);
+    }
+
+    /**
+     * testActiveUpdatingList verifies that updates made to a List returned from
+     * a DataObject are reflected in the DataObject and vice versa.
+     */
+    @Test
+    public void testActiveUpdatingList() {
+       
+        Type type = testDO.getType();
+        DataFactory df = CTSSuite.getTestHelper().getDataFactory();
+        DataObject root = df.create(type);
+        DataObject child1 = df.create(type);
+        DataObject child2 = df.create(type);
+        DataObject child3 = df.create(type);
+
+        List addList = new ArrayList();
+        List returnedList;
+
+        addList.add(child1);
+
+        root.setList("children", addList);
+
+        // Verify the pre-condition. The List initially has a size of 1.
+        assertEquals("The List returned by getList was not of the expected size.", root.getList("children").size(), 1);
+
+        returnedList = root.getList("children");
+
+        /**
+         * Add a member to the returned List and verify that it is reflected in
+         * the DataObject.
+         */
+
+        returnedList.add(child2);
+
+        assertEquals("Update to returned List did not affect DataObject correctly.  Size of children is not 2", root
+            .getList("children").size(), 2);
+        assertEquals("Update to returned List did not affect DataObject correctly.  child1 is equal to root", child1
+            .getContainer(), root);
+        assertEquals("Update to returned List did not affect DataObject correctly.  child2 is equal to root", child2
+            .getContainer(), root);
+
+        /**
+         * Delete a child and verify that the returned List is automatically
+         * affected.
+         */
+
+        child1.delete();
+        assertEquals("Deleting a DataObject did not affect the returned List.", returnedList.size(), 1);
+
+        /**
+         * Verify that the DataObject delete did not affect the original List
+         * used in the DataObject.setList().
+         */
+
+        assertEquals("Deleting a DataObject should not affect a List unassociated with the DataObject.",
+                     addList.size(),
+                     1);
+
+        /**
+         * Call DataObject.setList() and verify that the previously returned
+         * List reflects the new List.
+         */
+
+        addList.add(child2);
+        addList.add(child3);
+        root.setList("children", addList);
+
+        assertEquals("The List retruned by DataObject.getList() was not affected by a subsequent DataObject.setList().",
+                     returnedList.size(),
+                     3);
+        /**
+         * Call List.remove() on the returned List and verify that the
+         * DataObject is affected.
+         */
+
+        DataObject child = (DataObject)returnedList.get(1);
+
+        // Verify the precondition. The child should have root as its container.
+        assertEquals("List.setList() did not cause the expected containment relationship.", child.getContainer(), root);
+
+        returnedList.remove(1);
+
+        assertEquals("List.remove() did not have the expected effect on the DataObject.  There are more than 2 children",
+                     root.getList("children").size(),
+                     2);
+        assertNull("List.remove() did not have the expected effect on the DataObject. child container is not null",
+                   child.getContainer());
+
+        /**
+         * Call List.clear() and veirfy that the DataObject is affected.
+         */
+        returnedList.clear();
+
+        assertEquals("List.clear() on the returned List did not have the expected effect on the DataObject. The size of the list of children is not 0",
+                     root.getList("children").size(),
+                     0);
+        assertNull("List.clear() on the returned List did not have the expected effect on the DataObject.  child1.getContainer is not null",
+                   child1.getContainer());
+        assertNull("List.clear() on the returned List did not have the expected effect on the DataObject.  child2.getContainer is not null",
+                   child2.getContainer());
+
+    }
+
+    /**
+     * testActiveUpdatingSequence verifies that updates made to a Sequence
+     * returned from a DataObject are reflected in the DataObject and vice
+     * versa.
+     */
+    @Test
+    public void testActiveUpdatingSequence() {
+
+        
+        DataObject sequenceDO = testDO.getDataObject("sequencedElem");
+        Sequence sequence = sequenceDO.getSequence();
+        List letterList = sequenceDO.getList("Letters");
+        List numberList = sequenceDO.getList("Numbers");
+
+        assertTrue("The Type of sequencedElem is not sequenced.  testActiveUpdatingSequence may not proceed",
+                   sequenceDO.getType().isSequenced());
+
+        letterList.clear();
+        numberList.clear();
+
+        // Verify the precondition. The Sequence should be empty.
+        assertEquals("The Sequence should initially be empty.", sequence.size(), 0);
+
+        /**
+         * Add values to the DataObject and verify that the Sequence is
+         * affected.
+         */
+
+        letterList.add("A");
+        letterList.add("B");
+        numberList.add(Integer.valueOf(8));
+
+        // The expected arrangement of sequence is as follows
+        // {<Letters, "A">, <Letters, "B">, <Numbers, 8>}
+
+        assertEquals("Adding values to the DataObject did not affect the returned Sequence.  Sequence size is not 3",
+                     sequence.size(),
+                     3);
+        assertEquals("Adding values to the DataObject did not affect the returned Sequence.  getValue[0] is not A",
+                     sequence.getValue(0),
+                     "A");
+        assertEquals("Adding values to the DataObject did not affect the returned Sequence. getValue[1] is not B",
+                     sequence.getValue(1),
+                     "B");
+        assertEquals("Adding values to the DataObject did not affect the returned Sequence. getValue[2] is not equal to 8",
+                     sequence.getValue(2),
+                     Integer.valueOf(8));
+
+        /**
+         * Remove a value from the DataObject and verify that the Sequence is
+         * affected.
+         */
+
+        letterList.remove(1);
+
+        // The expected arrangement of sequence is as follows: {<Letters, "A">,
+        // <Numbers, 8>}
+        assertEquals("Removing a value from the DataObject did not affect the returned Sequence.", sequence.size(), 2);
+        assertEquals("Removing a value from the DataObject did not affect the returned Sequence.",
+                     sequence.getValue(0),
+                     "A");
+        assertEquals("Removing a value from the DataObject did not affect the returned Sequence.",
+                     sequence.getValue(1),
+                     Integer.valueOf(8));
+
+        /**
+         * Remove a value from the Sequence and verify that the DataObject is
+         * affected.
+         */
+
+        sequence.remove(1);
+
+        // The expected arrangement of sequence is as follows: {<Letters, "A">}
+
+        assertEquals("Removing a value from the Sequence did not affect the DataObject.  Size of List for numbers is not 0",
+                     sequenceDO.getList("Numbers").size(),
+                     0);
+
+        /**
+         * Add a value to the Sequence and verify that the DataObject is
+         * affected.
+         */
+        sequence.add("Numbers", Integer.valueOf(16));
+
+        // The expected arrangement of sequence is as follows: {<Letters, "A">,
+        // <Numbers, 16>}
+
+        assertEquals("Adding a value to the Sequence did not have the expected effect on the DataObject.", sequenceDO
+            .getList("Numbers").size(), 1);
+        assertEquals("Adding a value to the Sequence did not have the expected effect on the DataObject.", sequenceDO
+            .getList("Numbers").get(0), Integer.valueOf(16));
+
+        // Add several values to the Sequence (via the DataObject) to make
+        // Sequence.move() meaningful.
+
+        letterList.add("C");
+        numberList.add(Integer.valueOf(15));
+        numberList.add(Integer.valueOf(4));
+        letterList.add("K");
+        letterList.add("M");
+        numberList.add(Integer.valueOf(-10));
+
+        // The expected arrangement of sequence is as follows
+        // {<Letters, "A">, <Numbers, 16>, <Letters, "C">, <Numbers, 15>,
+        // <Numbers, 4>, <Letters, "K">, <Letters, "M">, <Numbers, -10>}
+
+        /**
+         * Use Sequence.move() and verify that the changes are reflected in the
+         * DataObject.
+         */
+
+        sequence.move(1, 5);
+        sequence.move(4, 2);
+
+        // The expected arrangement of sequence is as follows
+        // {<Letters, "A">, <Letters, "K">, <Letters, "C">, <Numbers, 15>,
+        // <Numbers, 16>, <Numbers, 4>, <Letters, "M">, <Numbers, -10>}
+
+        assertEquals("Sequence.move() did not have the expected effect on the DataObject represented by the Sequence.",
+                     letterList.size(),
+                     4);
+        assertEquals("Sequence.move() did not have the expected effect on the DataObject represented by the Sequence.",
+                     letterList.get(0),
+                     "A");
+        assertEquals("Sequence.move() did not have the expected effect on the DataObject represented by the Sequence.",
+                     letterList.get(1),
+                     "K");
+        assertEquals("Sequence.move() did not have the expected effect on the DataObject represented by the Sequence.",
+                     letterList.get(2),
+                     "C");
+        assertEquals("Sequence.move() did not have the expected effect on the DataObject represented by the Sequence.",
+                     letterList.get(3),
+                     "M");
+
+        assertEquals("Sequence.move() did not have the expected effect on the DataObject represented by the Sequence.",
+                     numberList.size(),
+                     4);
+        assertEquals("Sequence.move() did not have the expected effect on the DataObject represented by the Sequence.",
+                     numberList.get(0),
+                     Integer.valueOf(15));
+        assertEquals("Sequence.move() did not have the expected effect on the DataObject represented by the Sequence.",
+                     numberList.get(1),
+                     Integer.valueOf(16));
+        assertEquals("Sequence.move() did not have the expected effect on the DataObject represented by the Sequence.",
+                     numberList.get(2),
+                     Integer.valueOf(4));
+        assertEquals("Sequence.move() did not have the expected effect on the DataObject represented by the Sequence.",
+                     numberList.get(3),
+                     Integer.valueOf(-10));
+
+        // TODO: Add a value to a specific location within the Sequence and
+        // veirfy the effect on the DataObject. Awaiting Tuscany-931
+    }
+}

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

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

Added: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/general/ContainmentTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/general/ContainmentTest.java?view=auto&rev=501803
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/general/ContainmentTest.java (added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/general/ContainmentTest.java Wed Jan 31 03:18:45 2007
@@ -0,0 +1,341 @@
+/*
+ *  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.paramatizedTests.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 java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import test.sdo21.CTSSuite;
+import test.sdo21.paramatizedTests.BaseSDOParamatizedTest;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+/**
+ * Junit 4.1 test case. Tests containment alterations:
+ * <ul>
+ *   <li>container/contained relationship</li>
+ *   <li>containment cycle</li>
+ * </ul>
+ */
+@RunWith(Parameterized.class)
+public class ContainmentTest extends BaseSDOParamatizedTest {
+
+    public ContainmentTest(DataObject testDO, String description) {
+        super(testDO, description);
+    }
+
+    /**
+     * testContainmentIntegrity insures that containment alterations are
+     * reflected on both sides of the container/contained relationship.
+     * Additionally, containment eclusivity is checked following several
+     * scenarios.
+     */
+    @Test
+    public void testContainmentIntegrity() {
+        Type type = testDO.getType();
+        List returnedList;
+        List addList = new ArrayList();
+        DataObject dataObj1 = CTSSuite.getTestHelper().getDataFactory().create(type);
+        DataObject dataObj2 = CTSSuite.getTestHelper().getDataFactory().create(type);
+        Property containmentProp = testDO.getProperty("children");
+
+        // Ensure that any previous containment relationships are broken.
+
+        addList.clear();
+        testDO.setList("children", addList);
+        testDO.detach();
+
+        // Assign identifier to the created DataObjects
+
+        testDO.setString("stringVal", "testDO");
+        dataObj1.setString("stringVal", "dataObj1");
+        dataObj2.setString("stringVal", "dataObj2");
+
+        // Verify pre-conditions
+
+        assertTrue("Property.isContainment() returned an unexpected value.", containmentProp.isContainment());
+
+        assertNull("DataObject.getContainer() returned an unexpected value.", testDO.getContainer());
+        assertNull("DataObject.getContainmentProprety() returned an unexpected value.", testDO.getContainmentProperty());
+
+        /**
+         * Assign both dataObj1 and dataObj2 to testDO container, then verify
+         * containment of dataObj1 and dataObj2 by testDO
+         */
+
+        addList.add(dataObj1);
+        addList.add(dataObj2);
+        testDO.setList(containmentProp, addList);
+
+        // Verify containment of dataObj1 and dataObj2 by testDO
+        assertEquals("DataObject.getContainer() did not return the appropriate DataObject.",
+                     dataObj1.getContainer(),
+                     testDO);
+
+        assertEquals("DataObject.getContainer() did not return the appropriate DataObject.",
+                     dataObj2.getContainer(),
+                     testDO);
+
+        assertEquals("DataObject.getContainmentProperty() did not return the appropriate Property.", dataObj1
+            .getContainmentProperty(), containmentProp);
+
+        assertEquals("DataObject.getContainmentProperty() did not return the appropriate Property.", dataObj2
+            .getContainmentProperty(), containmentProp);
+
+        returnedList = testDO.getList(containmentProp);
+
+        assertEquals("DataObject.getList() size is incorrect", returnedList.size(), 2);
+        assertEquals("DataObject.getList() did not return the List specified in DataObject.setList()", returnedList
+            .get(0), dataObj1);
+        assertEquals("DataObject.getList() did not return the List specified in DataObject.setList()", returnedList
+            .get(1), dataObj2);
+
+        /**
+         * Assign dataObj2 to dataObj1 container, then verify dataObj2 is
+         * automatically removed from testDO container
+         */
+
+        // After the following section, it should be true that: testDO contains
+        // dataObj1 contains dataObj2
+        addList.clear();
+        addList.add(dataObj2);
+        dataObj1.setList(containmentProp, addList);
+
+        // Verify automatic removal of dataObj2 from testDO container
+
+        returnedList = testDO.getList(containmentProp);
+        assertEquals("Once placed in a new container, the DataObject should no longer appear in the former container.",
+                     returnedList.size(),
+                     1);
+        assertEquals("Once placed in a new container, the DataObject should no longer appear in the former container.",
+                     returnedList.get(0),
+                     dataObj1);
+
+        // Verify that dataObj2 was correctly added to dataObj1 container
+
+        returnedList = dataObj1.getList(containmentProp);
+        assertEquals("Once assigned to a new container, the DataObject should appear in the new container.",
+                     returnedList.size(),
+                     1);
+        assertEquals("Once assigned to a new container, the DataObject should appear in the new container.",
+                     returnedList.get(0),
+                     dataObj2);
+        assertEquals("DataObject.getContainer() did not return the appropriate DataObject.",
+                     dataObj2.getContainer(),
+                     dataObj1);
+
+        // After the following section, it should be true that: dataObj1
+        // contains testDO contains dataObj2
+
+        dataObj1.detach();
+        addList.clear();
+        addList.add(dataObj2);
+        testDO.setList(containmentProp, addList);
+        addList.clear();
+        addList.add(testDO);
+        dataObj1.setList(containmentProp, addList);
+
+        /**
+         * Verify that detach() removes the object from its container.
+         */
+
+        testDO.detach();
+
+        returnedList = dataObj1.getList(containmentProp);
+        assertEquals("Detaching the contained object did not remove it from container", returnedList.size(), 0);
+
+        assertNull("DataObject.getContainer() did not return null as expected for a detached DataObject.", testDO
+            .getContainer());
+
+        /**
+         * Verify that DataObject.detach() does not affect objects contained by
+         * the detached DataObject
+         */
+
+        returnedList = testDO.getList(containmentProp);
+
+        assertEquals("Detaching a DataObject should not affect it as a container.", returnedList.size(), 1);
+        assertEquals("Detaching a DataObject should not affect it as a container.", returnedList.get(0), dataObj2);
+        assertEquals("Detaching a DataObject should not affect it as a container.", dataObj2.getContainer(), testDO);
+
+        /**
+         * Verify that DataObject.delete() removes the object from its container
+         * and affects the containment of objects within the deleted DataObject
+         */
+
+        // After the following section, it should be true that: dataObj1
+        // contains testDO contains dataObj2
+        addList.clear();
+        addList.add(testDO);
+        dataObj1.setList(containmentProp, addList);
+
+        assertEquals("DataObject.getContainer() did not result in the set value.", testDO.getContainer(), dataObj1);
+
+        testDO.delete();
+
+        assertEquals("Deleting the DataObject did not remove it from its container.", dataObj1.getList(containmentProp)
+            .size(), 0);
+
+        assertNotNull("Deleting the DataObject did not affect its view of its container.", testDO);
+
+        assertEquals("Deleting the DataObject did not empty it as a container.",
+                     testDO.getList(containmentProp).size(),
+                     0);
+
+        assertNull("Deleting the containing DataObject was not reflected in the contained DataObject.", dataObj2
+            .getContainer());
+
+    }
+
+    /**
+     * testContainmentCycle ensures that a containment cycle is prevented
+     * appropriately. Attempts are made at 1-member and n-member cycles, as well
+     * as cycles created via setting the containment property through the
+     * DataObject and setting through a returned List. In all cases, an
+     * exception should be thrown and the cycle prevented
+     * 
+     * @param testDO
+     */
+
+    public static void testContainmentCycle(DataObject testDO) {
+        Type type = testDO.getType();
+        List addList = new ArrayList();
+        List returnedList = testDO.getList("children");
+        DataObject dataObj1 = CTSSuite.getTestHelper().getDataFactory().create(type);
+        DataObject dataObj2 = CTSSuite.getTestHelper().getDataFactory().create(type);
+        boolean exceptionCaught;
+
+        // Ensure that any previous containment relationships are broken.
+
+        addList.clear();
+        testDO.setList("children", addList);
+        testDO.detach();
+
+        // Assign identifier to the created DataObjects
+
+        testDO.setString("stringVal", "testDO");
+        dataObj1.setString("stringVal", "dataObj1");
+        dataObj2.setString("stringVal", "dataObj2");
+
+        /**
+         * Attempt to create a one-member containment cycle via
+         * DataObject.set____ and verify that an exception is thrown
+         */
+
+        addList.add(dataObj1);
+        addList.add(testDO);
+
+        exceptionCaught = false;
+        try {
+            testDO.setList("children", addList);
+        } catch (Exception e) {
+            exceptionCaught = true;
+        }
+
+        assertTrue("Attempting to create a one member containment cycle using a set method on the DataObject should result in an Exception.",
+                   exceptionCaught);
+
+        /**
+         * Attempt to create a one-member containment cycle via a returned List
+         * and verify that an exception is thrown
+         */
+
+        addList.clear();
+        testDO.setList("children", addList);
+
+        exceptionCaught = false;
+        try {
+            returnedList.add(testDO);
+        } catch (Exception e) {
+            exceptionCaught = true;
+        }
+        assertTrue("Attempting to create a one member containment cycle using a returned List should result in an Exception.",
+                   exceptionCaught);
+
+        /**
+         * Attempt to create an n-member containment cycle via
+         * DataObject.set____ and verify that an exception is thrown
+         */
+
+        addList.clear();
+        addList.add(dataObj1);
+
+        testDO.setList("children", addList);
+
+        addList.clear();
+        addList.add(dataObj2);
+
+        dataObj1.setList("children", addList);
+
+        addList.clear();
+        addList.add(testDO);
+
+        // testDO contains dataObj1 contains dataObj2. dataObj2 containing
+        // testDO (or dataObj1 or dataObj2) would form a cycle.
+
+        exceptionCaught = false;
+        try {
+            dataObj2.setList("children", addList);
+        } catch (Exception e) {
+            exceptionCaught = true;
+        }
+        assertTrue("Attempting to create a containment cycle should result in an Exception.", exceptionCaught);
+
+        /**
+         * Attempt to create an n-member containment cycle via a returned List
+         * and verify that an exception is thrown
+         */
+
+        addList.clear();
+        testDO.setList("children", addList);
+
+        addList.add(dataObj2);
+        dataObj1.setList("children", addList);
+
+        addList.clear();
+        addList.add(testDO);
+        dataObj2.setList("children", addList);
+
+        // dataObj1 contains dataObj2 contains testDO. testDO containing
+        // dataObj1 (or dataObj2 or testDO) would form a cycle.
+
+        exceptionCaught = false;
+        try {
+            returnedList.add(dataObj1);
+        } catch (Exception e) {
+            exceptionCaught = true;
+        }
+
+        assertTrue("Attempting to create an n-member containment cycle using a returned List should result in an Exception.",
+                   exceptionCaught);
+    }
+}

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

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

Added: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/general/DeleteTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/general/DeleteTest.java?view=auto&rev=501803
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/general/DeleteTest.java (added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/general/DeleteTest.java Wed Jan 31 03:18:45 2007
@@ -0,0 +1,112 @@
+/*
+ *  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.paramatizedTests.general;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import test.sdo21.CTSSuite;
+import test.sdo21.paramatizedTests.BaseSDOParamatizedTest;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+
+/**
+ * Junit 4.1 test case. Tests containment alterations:
+ * <ul>
+ *   <li>recursive deletion</li>
+ * </ul>
+ * 
+ */
+@RunWith(Parameterized.class)
+public class DeleteTest extends BaseSDOParamatizedTest {
+
+    public DeleteTest(DataObject testDO, String description) {
+        super(testDO, description);
+    }
+
+    /**
+     * testRecursiveDeletion verifies that when a DataObject is deleted, all
+     * (recursively) contained DataObjects are also deleted.
+     */
+    @Test
+    public void testRecursiveDeletion() {
+        Type type = testDO.getType();
+        Property containmentProp = type.getProperty("children");
+
+        assertTrue("Cannot continue with test because Property.isContainment() is false.", containmentProp
+            .isContainment());
+
+        DataFactory df =  CTSSuite.getTestHelper().getDataFactory();
+        DataObject child1 = df.create(type);
+        DataObject child2 = df.create(type);
+        DataObject child3 = df.create(type);
+
+        List addList = new ArrayList();
+
+        /**
+         * Establish a series of containment relationships
+         */
+
+        addList.add(child1);
+        testDO.setList(containmentProp, addList);
+
+        addList.clear();
+        addList.add(child2);
+        child1.setList(containmentProp, addList);
+
+        addList.clear();
+        addList.add(child3);
+        child2.setList(containmentProp, addList);
+
+        /**
+         * Verify that containment has been established correctly.
+         */
+
+        assertEquals("The expected containment relationships were not correctly formed.", child3.getContainer(), child2);
+        assertEquals("The expected containment relationships were not correctly formed.", child2.getContainer(), child1);
+        assertEquals("The expected containment relationships were not correctly formed.", child1.getContainer(), testDO);
+
+        /**
+         * Delete the root DataObject and verify that contained DataObjects are
+         * recursively affected.
+         */
+
+        testDO.delete();
+
+        assertEquals("DataObject.delete() did not recursively affect contained DataObjects.", testDO
+            .getList(containmentProp).size(), 0);
+        assertNull("DataObject.delete() did not recursively affect contained DataObjects.", child1.getContainer());
+        assertNull("DataObject.delete() did not recursively affect contained DataObjects.", child2.getContainer());
+        assertNull("DataObject.delete() did not recursively affect contained DataObjects.", child3.getContainer());
+
+    }
+}

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

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

Added: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/general/package.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/general/package.html?view=auto&rev=501803
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/general/package.html (added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/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 paramatized test cases for other general test.
+</body>
+</html>

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

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

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

Added: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/package.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/package.html?view=auto&rev=501803
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/package.html (added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/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 paramatized test cases.
+</body>
+</html>

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

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

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

Added: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/util/ParamatizedTestUtil.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/util/ParamatizedTestUtil.java?view=auto&rev=501803
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/util/ParamatizedTestUtil.java (added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/util/ParamatizedTestUtil.java Wed Jan 31 03:18:45 2007
@@ -0,0 +1,258 @@
+/*
+ *  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.paramatizedTests.util;
+
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import test.sdo21.CTSSuite;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+/**
+ * Utility methods for SDO Tests. Provides methods to populate fields of
+ * DataObjects, serializing DataObjects etc.
+ * 
+ */
+public class ParamatizedTestUtil {
+    public final static String TEST_TYPE = "APITest";
+    public final static String TEST_MODEL = "/api_test.xsd";
+    public final static String TEST_NAMESPACE = "http://www.example.com/api_test";
+    public final static String DATA_XML = "/api_test_full.xml";
+
+    /**
+     * populateFields uses set<Type> to set each of the fields in the
+     * DataObject. It is used to ensure a known set of expected values that are
+     * not other than the default values for the various fields.
+     * 
+     * TODO:  need to create a static sequence here.
+     * @param testDO
+     * @throws ExpectedConditionError
+     */
+    public static void populateFields(DataObject testDO) throws Exception {
+        testDO.setString("stringVal", "String 1");
+        testDO.setBoolean("booleanVal", true);
+        testDO.setBoolean("booleanVal2", false);
+        testDO.setByte("byteVal", (byte)-127);
+        testDO.setString("stringVal2", "Second string!");
+        testDO.setBigDecimal("decimalVal", new BigDecimal(-3.00003));
+        testDO.setBigDecimal("decimalVal2", new BigDecimal(18883.999999));
+        testDO.setInt("intVal", (int)33333);
+        testDO.setFloat("floatVal", (float)0.88881);
+        testDO.setDouble("doubleVal", (double)119.13813);
+        testDO.setDate("dateVal", new Date(System.currentTimeMillis()));
+        testDO.setShort("shortVal", (short)-800);
+        testDO.setLong("longVal", (long)88881113);
+        List children = new ArrayList();
+        children.add(CTSSuite.getTestHelper().getDataFactory().create(testDO.getType()));
+        testDO.setList("children", children);
+        testDO.setBytes("bytesVal", new byte[] {120, 80, -40});
+        testDO.setBigInteger("integerVal", new BigInteger("88819313"));
+        testDO.setChar("charVal", '*');
+        if (testDO.getType().getInstanceClass() != null) {
+        	//TODO:  need to create a static sequence here.
+        	//Sequenced createStatic = StaticSdoFactory.INSTANCE.createSequenced();
+            //testDO.setDataObject("sequencedElem", (DataObject)createStatic);
+        } else {
+            testDO.setDataObject("sequencedElem", CTSSuite.getTestHelper().getDataFactory().create(CTSSuite
+                .getTestHelper().getTypeHelper().getType(TEST_NAMESPACE, "Sequenced")));
+        }       
+    }
+
+    /**
+     * serializeDataObject is a private method to be called by the other methods
+     * in the ScrenarioLibrary
+     * 
+     * @param dataObject
+     * @param fileName
+     * @throws IOException
+     */
+    public static void serializeDataObject(DataObject dataObject, String fileName) throws IOException {
+        FileOutputStream fos = new FileOutputStream(fileName);
+        ObjectOutputStream out = new ObjectOutputStream(fos);
+        out.writeObject(dataObject);
+        out.close();
+    }
+
+    /**
+     * deserializeDataObject is a private method to be called by the other
+     * methods in the ScrenarioLibrary
+     * 
+     * @param fileName
+     * @return
+     * @throws IOException
+     * @throws ClassNotFoundException
+     */
+    public static DataObject deserializeDataObject(String fileName) throws IOException, ClassNotFoundException {
+        FileInputStream fis = new FileInputStream(fileName);
+        ObjectInputStream input = new ObjectInputStream(fis);
+        DataObject dataObject = (DataObject)input.readObject();
+        input.close();
+        return dataObject;
+    }
+
+    /**
+     * clearDataObject is used to restore all fields to their default values
+     * 
+     * @param dataObject
+     */
+    public static void clearDataObject(DataObject dataObject) {
+        List properties = dataObject.getInstanceProperties();
+
+        for (int i = 0, size = properties.size(); i < size; i++) {
+            dataObject.unset(i);
+        }
+    }
+
+    /**
+     * printDataObject is provided to aid in troubleshooting
+     * 
+     * @param dataObject
+     * @param indent
+     */
+    public static void printDataObject(DataObject dataObject, int indent) {
+        // For each property
+
+        List properties = dataObject.getInstanceProperties();
+        for (int i = 0, size = properties.size(); i < size; i++) {
+            if (dataObject.isSet(i)) {
+                Property property = (Property)properties.get(i);
+                if (property.isMany()) {
+                    // For many-valued properties, process a list of values
+                    List values = dataObject.getList(i);
+                    for (int j = 0, count = values.size(); j < count; j++)
+                        printValue(values.get(j), property, indent);
+                } else {
+                    // for single-valued properties, print out the value
+                    printValue(dataObject.get(i), property, indent);
+                }
+            }
+        }
+    }
+
+    /**
+     * areEqualTypes is used to determine of two Types are equivalent even if
+     * not identically equal. The names of the Types are compared, as well as
+     * the Types of each of the Properties making up the Type.
+     * 
+     * @param type1
+     * @param type2
+     * @return
+     */
+    public static boolean areEqualTypes(Type type1, Type type2) {
+        List properties1, properties2;
+        Property property1, property2;
+        int size = 0, j = 0, k;
+        boolean found;
+
+        // Equivalent Types have the same name
+
+        if (!(type1.getName().equals(type2.getName())))
+            return false;
+
+        // Equivalent Types have the same number of Properties
+
+        properties1 = type1.getProperties();
+        properties2 = type2.getProperties();
+        size = properties1.size();
+
+        if (size != properties2.size())
+            return false;
+
+        // Equivalent Types have Properties of the same name and Type
+
+        for (int i = 0; i < size; i++) {
+            property1 = (Property)properties1.get(i);
+            k = 0;
+            found = false;
+
+            while (k < size && !found) {
+                // j is used to prevent the initial Properties in properties2
+                // from being checked every time
+                // j is particularly useful when the Types have Properties in
+                // the order
+
+                property2 = (Property)properties2.get((k + j) % size);
+
+                if (property1.getName().equals(property2.getName())) {
+                    j++;
+                    found = true;
+
+                    // Should not use recursion here to compare the Types of the
+                    // Properties, because
+                    // it is possible that a Type may recursively contain
+                    // itself.
+
+                    if (!(property1.getType().getName().equals(property2.getType().getName())))
+                        return false;
+                }
+
+                k++;
+            }
+
+            if (!found)
+                return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * printValue is a private method which is called by printDataObject
+     * 
+     * @param value
+     * @param property
+     * @param indent
+     */
+    private static void printValue(Object value, Property property, int indent) {
+        // Get the name of the property
+        String propertyName = property.getName();
+
+        // Construct a string for the proper indentation
+        String margin = "";
+        for (int i = 0; i < indent; i++)
+            margin += "\t";
+
+        if (value != null && property.isContainment()) {
+            // For containment properties, display the value
+            // with printDataObject
+
+            Type type = property.getType();
+            String typeName = type.getName();
+            System.out.println(margin + propertyName + " (" + typeName + "):");
+            printDataObject((DataObject)value, indent + 1);
+        } else {
+            // For non-containment properties, just print the value
+            System.out.println(margin + propertyName + ": " + value);
+        }
+
+    }
+
+}

Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/util/ParamatizedTestUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/util/ParamatizedTestUtil.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/util/TypeCreateUtility.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/util/TypeCreateUtility.java?view=auto&rev=501803
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/util/TypeCreateUtility.java (added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/util/TypeCreateUtility.java Wed Jan 31 03:18:45 2007
@@ -0,0 +1,234 @@
+/*
+ *  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.paramatizedTests.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import test.sdo21.CTSSuite;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.helper.TypeHelper;
+
+/**
+ * Utility to create Types for DataObject using a variety of mechanisms
+ *
+ */
+public class TypeCreateUtility {
+
+    /**
+     * createDynamicWithStaticResources creates the DataObject type from an
+     * existing XSD. The same XSD is used to create the Types statically using
+     * the XSD2JavaGenerator. The XSD should be kept in synch with the
+     * createDynamically method in this class.
+     * 
+     * @throws IOException
+     */
+
+    public static void createDynamicWithStaticResources() throws IOException {
+        // Populate the meta data for the test model (APITest)
+        URL url = TypeCreateUtility.class.getResource(ParamatizedTestUtil.TEST_MODEL);
+        InputStream inputStream = url.openStream();
+        CTSSuite.getTestHelper().getXSDHelper().define(inputStream, url.toString());
+        inputStream.close();
+    }
+
+    /**
+     * TODO: DAS Adheres to an existing type
+     */
+
+    public static void createDASAdherence() {
+
+    }
+
+    /**
+     * TODO: DAS dynamically generates the type
+     */
+    public static void createDASDynamically() {
+
+    }
+
+    /**
+     * createDynamically() creates the SDO Types using the TypeHelper. This
+     * method should be kept in synch with the XSD used for
+     * createDynamicallyWithStaticResources. The same XSD is used for the static
+     * generation of SDO Types using XSD2JavaGenerator.
+     */
+    public static void createDynamically() {
+        TypeHelper types = CTSSuite.getTestHelper().getTypeHelper();
+        Type stringType = types.getType("commonj.sdo", "String");
+        Type intType = types.getType("commonj.sdo", "Int");
+        Type booleanType = types.getType("commonj.sdo", "Boolean");
+        Type byteType = types.getType("commonj.sdo", "Byte");
+        Type decimalType = types.getType("commonj.sdo", "Decimal");
+        Type floatType = types.getType("commonj.sdo", "Float");
+        Type doubleType = types.getType("commonj.sdo", "Double");
+        Type dateType = types.getType("commonj.sdo", "Date");
+        Type shortType = types.getType("commonj.sdo", "Short");
+        Type longType = types.getType("commonj.sdo", "Long");
+        Type bytesType = types.getType("commonj.sdo", "Bytes");
+        Type integerType = types.getType("commonj.sdo", "Integer");
+        Type charType = types.getType("commonj.sdo", "Character");
+        // Type dateXSDType = types.getType("http://www.w3.org/2001/XMLSchema",
+        // "date");
+        // Collection aliases = new ArrayList();
+
+        DataObject abstractTypeDO = CTSSuite.getTestHelper().getDataFactory().create("commonj.sdo", "Type");
+        abstractTypeDO.set("uri", ParamatizedTestUtil.TEST_NAMESPACE);
+        abstractTypeDO.set("name", "Abstract");
+        abstractTypeDO.setBoolean("abstract", true);
+        abstractTypeDO.setBoolean("sequenced", true);
+
+        DataObject firstProperty = abstractTypeDO.createDataObject("property");
+        firstProperty.set("name", "firstName");
+        firstProperty.set("type", stringType);
+
+       DataObject lastProperty = abstractTypeDO.createDataObject("property");
+        lastProperty.set("name", "lastName");
+        lastProperty.set("type", stringType);
+
+        Type abstractType = types.define(abstractTypeDO);
+
+        DataObject sequenceTypeDO = CTSSuite.getTestHelper().getDataFactory().create("commonj.sdo", "Type");
+        sequenceTypeDO.set("uri", ParamatizedTestUtil.TEST_NAMESPACE);
+        sequenceTypeDO.set("name", "Sequenced");
+        sequenceTypeDO.setBoolean("sequenced", true);
+
+        List baseTypes = new ArrayList();
+        baseTypes.add(abstractType);
+        sequenceTypeDO.setList("baseType", baseTypes);
+
+        // TODO: Uncomment the following when SDOUtil.addAliasName is
+        // implemented
+        /*
+         * aliases.clear(); aliases.add("Seq2"); sequenceTypeDO.set("aliasName",
+         * aliases);
+         */
+
+        DataObject Letters = sequenceTypeDO.createDataObject("property");
+        Letters.set("name", "Letters");
+        Letters.set("type", stringType);
+        Letters.setBoolean("many", true);
+
+        DataObject Numbers = sequenceTypeDO.createDataObject("property");
+        Numbers.set("name", "Numbers");
+        Numbers.set("type", intType);
+        Numbers.setBoolean("many", true);
+
+        Type sequenceType = types.define(sequenceTypeDO);
+
+        DataObject testType = CTSSuite.getTestHelper().getDataFactory().create("commonj.sdo", "Type");
+        testType.set("uri", ParamatizedTestUtil.TEST_NAMESPACE);
+        testType.set("name", ParamatizedTestUtil.TEST_TYPE);
+
+        DataObject stringProperty = testType.createDataObject("property");
+        stringProperty.set("name", "stringVal");
+        stringProperty.set("type", stringType);
+
+        DataObject booleanProperty = testType.createDataObject("property");
+        booleanProperty.set("name", "booleanVal");
+        booleanProperty.set("type", booleanType);
+
+        DataObject boolean2Property = testType.createDataObject("property");
+        boolean2Property.set("name", "booleanVal2");
+        boolean2Property.set("type", booleanType);
+
+        DataObject byteProperty = testType.createDataObject("property");
+        byteProperty.set("name", "byteVal");
+        byteProperty.set("type", byteType);
+
+        DataObject string2Property = testType.createDataObject("property");
+        string2Property.set("name", "stringVal2");
+        string2Property.set("type", stringType);
+
+        DataObject decimalProperty = testType.createDataObject("property");
+        decimalProperty.set("name", "decimalVal");
+        decimalProperty.set("type", decimalType);
+
+        DataObject decimal2Property = testType.createDataObject("property");
+        decimal2Property.set("name", "decimalVal2");
+        decimal2Property.set("type", decimalType);
+
+        // TODO: Uncomment the following when SDOUtil.addAliasName is
+        // implemented
+        /*
+         * aliases.clear(); aliases.add("Dec2");
+         * decimal2Property.set("aliasName", aliases);
+         */
+        DataObject intProperty = testType.createDataObject("property");
+        intProperty.set("name", "intVal");
+        intProperty.set("type", intType);
+
+        DataObject floatProperty = testType.createDataObject("property");
+        floatProperty.set("name", "floatVal");
+        floatProperty.set("type", floatType);
+
+        DataObject doubleProperty = testType.createDataObject("property");
+        doubleProperty.set("name", "doubleVal");
+        doubleProperty.set("type", doubleType);
+
+        DataObject dateProperty = testType.createDataObject("property");
+        dateProperty.set("name", "dateVal");
+        dateProperty.set("type", dateType);
+
+        DataObject shortProperty = testType.createDataObject("property");
+        shortProperty.set("name", "shortVal");
+        shortProperty.set("type", shortType);
+
+        DataObject longProperty = testType.createDataObject("property");
+        longProperty.set("name", "longVal");
+        longProperty.set("type", longType);
+
+        DataObject childrenProperty = testType.createDataObject("property");
+        childrenProperty.set("name", "children");
+        childrenProperty.setBoolean("many", true);
+        childrenProperty.setBoolean("containment", true);
+        childrenProperty.set("type", testType);
+
+        DataObject bytesProperty = testType.createDataObject("property");
+        bytesProperty.set("name", "bytesVal");
+        bytesProperty.set("type", bytesType);
+
+        DataObject integerProperty = testType.createDataObject("property");
+        integerProperty.set("name", "integerVal");
+        integerProperty.set("type", integerType);
+
+        DataObject charProperty = testType.createDataObject("property");
+        charProperty.set("name", "charVal");
+        charProperty.set("type", charType);
+
+        /*
+         * Problem with dateXSDType - prevents subsequent properties DataObject
+         * dateXSDProperty = testType.createDataObject("property");
+         * dateXSDProperty.set("name", "dateXSDVal");
+         * dateXSDProperty.set("type", dateXSDType);
+         */
+        DataObject sequenceProperty = testType.createDataObject("property");
+        sequenceProperty.set("name", "sequencedElem");
+        sequenceProperty.set("type", sequenceType);
+
+        types.define(testType);
+    }
+}

Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/util/TypeCreateUtility.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/util/TypeCreateUtility.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/util/package.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/util/package.html?view=auto&rev=501803
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/util/package.html (added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/util/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 utilities for paramatized test cases.
+</body>
+</html>

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

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

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

Added: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/CTSGeneralSuite.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/CTSGeneralSuite.java?view=auto&rev=501803
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/CTSGeneralSuite.java (added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/CTSGeneralSuite.java Wed Jan 31 03:18:45 2007
@@ -0,0 +1,47 @@
+/*
+ *  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;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+import test.sdo21.tests.api.DataObjectTest;
+import test.sdo21.tests.conversion.DateConversionTest;
+import test.sdo21.tests.conversion.TypeConversionTest;
+import test.sdo21.tests.general.XSDSerializationTest;
+
+
+/**
+ * Declares general test classes to be run within Junit 4.1 Suite for SDO CTS
+ * which includes the following classes:<br>
+ * <ul>
+ *   <li>test.sdo21.tests.api.DataObjectTest</li>
+ *   <li>test.sdo21.tests.conversion.DateConversionTest</li>
+ *   <li>test.sdo21.tests.conversion.TypeConversionTest</li>
+ *   <li>test.sdo21.tests.general.XSDSerializationTest</li>
+ * </ul>
+ * These test cases should only be run once.
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses( {DateConversionTest.class, XSDSerializationTest.class, DataObjectTest.class, TypeConversionTest.class})
+public class CTSGeneralSuite {
+
+}

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

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

Modified: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/DataObjectTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/DataObjectTest.java?view=diff&rev=501803&r1=501802&r2=501803
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/DataObjectTest.java (original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/DataObjectTest.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,19 +15,25 @@
  *  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 commonj.sdo.DataObject;
 import junit.framework.TestCase;
 import test.sdo21.CTSSuite;
 import test.sdo21.framework.TestHelper;
 
+import commonj.sdo.DataObject;
+
 
 public class DataObjectTest extends TestCase
 {
     private TestHelper testHelper;
 
+    /**
+     * Set of tests for DataObject APIs.
+     */
     public DataObjectTest(String string) throws Exception {
         super(string);
 

Added: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/package.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/package.html?view=auto&rev=501803
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/package.html (added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/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 API test.
+</body>
+</html>

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

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

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

Added: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/conversion/DateConversionTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/conversion/DateConversionTest.java?view=auto&rev=501803
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/conversion/DateConversionTest.java (added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/conversion/DateConversionTest.java Wed Jan 31 03:18:45 2007
@@ -0,0 +1,395 @@
+/*
+ *  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.conversion;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.lang.reflect.Method;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+import org.junit.BeforeClass;
+
+import test.sdo21.CTSSuite;
+
+import commonj.sdo.helper.DataHelper;
+
+// TODO: Could convert to a paramatized test case and simplify this code a lot
+
+/**
+ * Set of tests for date and time related conversions.
+ *         DateConversionTest insures that the
+ *         DataHelper conversions accurately retain the information in the
+ *         specified fields (e.g. month, day or year). It also provides coverage
+ *         for the DataHelper API.
+ */
+public class DateConversionTest {
+    private static Calendar test_calendar;
+
+    private static Date test_date;
+
+    private static DataHelper data_helper;
+
+    private static final TestType TO_DATE_TIME =
+        new TestType("toDateTime", new int[] {Calendar.YEAR, Calendar.MONTH, Calendar.DAY_OF_MONTH,
+                                              Calendar.HOUR_OF_DAY, Calendar.MINUTE, Calendar.SECOND,
+                                              Calendar.MILLISECOND});
+
+    private static final TestType TO_DURATION =
+        new TestType("toDuration", new int[] {Calendar.YEAR, Calendar.MONTH, Calendar.DAY_OF_MONTH,
+                                              Calendar.HOUR_OF_DAY, Calendar.MINUTE, Calendar.SECOND,
+                                              Calendar.MILLISECOND});
+
+    private static final TestType TO_TIME =
+        new TestType("toTime", new int[] {Calendar.HOUR_OF_DAY, Calendar.MINUTE, Calendar.SECOND, Calendar.MILLISECOND});
+
+    private static final TestType TO_DAY = new TestType("toDay", new int[] {Calendar.DAY_OF_MONTH});
+
+    private static final TestType TO_MONTH = new TestType("toMonth", new int[] {Calendar.MONTH});
+
+    private static final TestType TO_MONTH_DAY =
+        new TestType("toMonthDay", new int[] {Calendar.MONTH, Calendar.DAY_OF_MONTH});
+
+    private static final TestType TO_YEAR = new TestType("toYear", new int[] {Calendar.YEAR});
+
+    private static final TestType TO_YEAR_MONTH =
+        new TestType("toYearMonth", new int[] {Calendar.YEAR, Calendar.MONTH});
+
+    private static final TestType TO_YEAR_MONTH_DAY =
+        new TestType("toYearMonthDay", new int[] {Calendar.YEAR, Calendar.MONTH, Calendar.DAY_OF_MONTH});
+
+    /**
+     * Junit 4.1 will execute this once prior to test cases being executed.
+     * This sets up the Calendar with current date.
+     */
+    @BeforeClass
+    public static void setupCalender() {
+        data_helper = CTSSuite.getTestHelper().getDataHelper(); 
+        test_calendar = new GregorianCalendar();
+        test_calendar.setTime(new Date(System.currentTimeMillis()));
+        test_date = test_calendar.getTime();
+    }
+
+    private static class TestType {
+        private static final Class[] DATE_CLASS_ARRAY = {Date.class};
+
+        private static final Class[] CALENDAR_CLASS_ARRAY = {Calendar.class};
+
+        Method date_method;
+
+        Method calendar_method;
+
+        int[] compare_fields;
+
+        public TestType(String method_name, int[] compare_fields) {
+            try {
+                this.date_method = DataHelper.class.getMethod(method_name, DATE_CLASS_ARRAY);
+            } catch (NoSuchMethodException e) {
+                this.date_method = null;
+            }
+
+            this.compare_fields = compare_fields;
+            try {
+                this.calendar_method = DataHelper.class.getMethod(method_name, CALENDAR_CLASS_ARRAY);
+            } catch (NoSuchMethodException e) {
+                this.calendar_method = null;
+            }
+
+        }
+
+        public Method getDateMethod() {
+            return this.date_method;
+        }
+
+        public Method getCalendarMethod() {
+            return this.calendar_method;
+        }
+    }
+
+    private static class Test {
+        String from_type;
+
+        Date from_date;
+
+        Calendar from_calendar;
+
+        Class expected_exception;
+
+        public Test() {
+            from_date = null;
+            from_calendar = null;
+            expected_exception = null;
+        }
+
+        public void initialize(TestType from_type) {
+            this.from_type = from_type.getDateMethod().getName();
+
+            try {
+                String date_string = (String)from_type.getDateMethod().invoke(data_helper, new Object[] {test_date});
+                this.from_date = data_helper.toDate(date_string);
+                date_string = (String)from_type.getCalendarMethod().invoke(data_helper, new Object[] {test_calendar});
+                this.from_calendar = data_helper.toCalendar(date_string);
+            } catch (Exception e) {
+                this.from_date = null;
+                this.from_calendar = null;
+            }
+
+        }
+
+        // This method is needed because there is not a toDate(Date) method in
+        // DataHelper.
+
+        private void initializeToDate() {
+            this.from_calendar = test_calendar;
+            this.from_date = test_date;
+            this.from_type = "toDate";
+        }
+
+        private void attemptConversion(TestType to_type) {
+            executeConversion(to_type.getDateMethod(), new Object[] {this.from_date}, to_type.compare_fields);
+            executeConversion(to_type.getCalendarMethod(), new Object[] {this.from_calendar}, to_type.compare_fields);
+        }
+
+        private void executeConversion(Method conversion, Object[] parm, int[] compare_fields) {
+            String result;
+
+            try {
+                result = (String)conversion.invoke(data_helper, parm);
+
+                assertTrue("The expected value did not result when calling " + conversion.getName()
+                    + " after initializing with "
+                    + this.from_type
+                    + ".", compareFields(parm[0], result, compare_fields));
+            } catch (Exception e) {
+                e.printStackTrace();
+                fail("An unexpected exception was thrown while calling " + conversion.getName()
+                    + " after initializing with "
+                    + this.from_type
+                    + ":"
+                    + e.toString());
+            }
+
+        }
+
+        private boolean compareFields(Object compare_to, String output, int[] compare_fields) {
+            Calendar result = data_helper.toCalendar(output);
+            Calendar expected;
+
+            if (compare_to instanceof Calendar)
+                expected = (GregorianCalendar)test_calendar;
+            else {
+                expected = new GregorianCalendar();
+                expected.setTime((Date)test_date);
+            }
+
+            for (int i = 0; i < compare_fields.length; i++) {
+                if (expected.get(compare_fields[i]) != result.get(compare_fields[i]))
+                    return false;
+            }
+            return true;
+        }
+
+    }
+
+    /**
+     * testConversionsFromDay verifies each of the conversions from Day using
+     * the DataHelper
+     */
+    @org.junit.Test
+    public void testConversionsFromDay() {
+        Test FromDay = new Test();
+        FromDay.initialize(TO_DAY);
+        FromDay.attemptConversion(TO_DAY);
+    }
+
+    /**
+     * testConversionsFromDate verifies each of the conversions from Date using
+     * the DataHelper
+     */
+    @org.junit.Test
+    public void testConversionsFromDate() {
+        Test FromDate = new Test();
+
+        FromDate.initializeToDate();
+
+        FromDate.attemptConversion(TO_DATE_TIME);
+        FromDate.attemptConversion(TO_DURATION);
+        FromDate.attemptConversion(TO_TIME);
+        FromDate.attemptConversion(TO_DAY);
+        FromDate.attemptConversion(TO_MONTH);
+        FromDate.attemptConversion(TO_MONTH_DAY);
+        FromDate.attemptConversion(TO_YEAR);
+        FromDate.attemptConversion(TO_YEAR_MONTH);
+        FromDate.attemptConversion(TO_YEAR_MONTH_DAY);
+    }
+
+    /**
+     * testConversionsFromDateTime verifies each of the conversions from
+     * DateTime using the DataHelper
+     */
+    @org.junit.Test
+    public void testConversionsFromDateTime() {
+        Test FromDateTime = new Test();
+
+        FromDateTime.initialize(TO_DATE_TIME);
+
+        FromDateTime.attemptConversion(TO_DATE_TIME);
+        FromDateTime.attemptConversion(TO_DURATION);
+        FromDateTime.attemptConversion(TO_TIME);
+        FromDateTime.attemptConversion(TO_DAY);
+        FromDateTime.attemptConversion(TO_MONTH);
+        FromDateTime.attemptConversion(TO_MONTH_DAY);
+        FromDateTime.attemptConversion(TO_YEAR);
+        FromDateTime.attemptConversion(TO_YEAR_MONTH);
+        FromDateTime.attemptConversion(TO_YEAR_MONTH_DAY);
+    }
+
+    /**
+     * testConversionsFromDuration verifies each of the conversions from
+     * Duration using the DataHelper
+     */
+    @org.junit.Test
+    public void testConversionsFromDuration() {
+        Test FromDuration = new Test();
+
+        FromDuration.initialize(TO_DURATION);
+
+        FromDuration.attemptConversion(TO_DURATION);
+        FromDuration.attemptConversion(TO_DATE_TIME);
+        FromDuration.attemptConversion(TO_TIME);
+        FromDuration.attemptConversion(TO_DAY);
+        FromDuration.attemptConversion(TO_MONTH);
+        FromDuration.attemptConversion(TO_MONTH_DAY);
+        FromDuration.attemptConversion(TO_YEAR);
+        FromDuration.attemptConversion(TO_YEAR_MONTH);
+        FromDuration.attemptConversion(TO_YEAR_MONTH_DAY);
+    }
+
+    /**
+     * testConversionsFromMonth verifies each of the conversions from Month
+     * using the DataHelper
+     */
+    @org.junit.Test
+    public void testConversionsFromMonth() {
+        Test FromMonth = new Test();
+
+        FromMonth.initialize(TO_MONTH);
+
+        FromMonth.attemptConversion(TO_MONTH);
+    }
+
+    /**
+     * testConversionsFromMonthDay verifies each of the conversions from
+     * MonthDay using the DataHelper
+     */
+    @org.junit.Test
+    public void testConversionsFromMonthDay() {
+        Test FromMonthDay = new Test();
+
+        FromMonthDay.initialize(TO_MONTH_DAY);
+        FromMonthDay.attemptConversion(TO_MONTH_DAY);
+        FromMonthDay.attemptConversion(TO_MONTH);
+        FromMonthDay.attemptConversion(TO_DAY);
+    }
+
+    /**
+     * testConversionsFromTime verifies each of the conversions from Time using
+     * the DataHelper
+     */
+    @org.junit.Test
+    public void testConversionsFromTime() {
+        Test FromTime = new Test();
+
+        FromTime.initialize(TO_TIME);
+
+        FromTime.attemptConversion(TO_TIME);
+    }
+
+    /**
+     * testConversionsFromYear verifies each of the conversions from Year using
+     * the DataHelper
+     */
+    @org.junit.Test
+    public void testConversionsFromYear() {
+        Test FromYear = new Test();
+
+        FromYear.initialize(TO_YEAR);
+
+        FromYear.attemptConversion(TO_YEAR);
+    }
+
+    /**
+     * testConversionsFromYearMonth verifies each of the conversions from
+     * YearMonth using the DataHelper
+     */
+    @org.junit.Test
+    public void testConversionsFromYearMonth() {
+        Test FromYearMonth = new Test();
+
+        FromYearMonth.initialize(TO_YEAR_MONTH);
+
+        FromYearMonth.attemptConversion(TO_YEAR_MONTH);
+        FromYearMonth.attemptConversion(TO_MONTH);
+        FromYearMonth.attemptConversion(TO_YEAR);
+    }
+
+    /**
+     * testConversionsFromYearMonthDay verifies each of the conversions from
+     * YearMonthDay using the DataHelper
+     */
+    @org.junit.Test
+    public void testConversionsFromYearMonthDay() {
+        Test FromYearMonthDay = new Test();
+
+        FromYearMonthDay.initialize(TO_YEAR_MONTH_DAY);
+
+        FromYearMonthDay.attemptConversion(TO_YEAR_MONTH_DAY);
+        FromYearMonthDay.attemptConversion(TO_YEAR_MONTH);
+        FromYearMonthDay.attemptConversion(TO_MONTH_DAY);
+        FromYearMonthDay.attemptConversion(TO_YEAR);
+        FromYearMonthDay.attemptConversion(TO_MONTH);
+        FromYearMonthDay.attemptConversion(TO_DAY);
+    }
+
+    /**
+     * testToDateFormats verifies that strings that should be recognized by
+     * toDate do not result in a null Date value when passed to
+     * DataHelper.toDate(String).
+     */
+    @org.junit.Test
+    public void testToDateFormats() {
+        String[] validStrings =
+            {"2006-03-31T03:30:45.123Z", "-2006-03-31T03:30:45.1Z", "2006-03-31T03:30:45Z", "2006-03-31T03:30:45.123",
+             "2006-03-31T03:30:45.1", "-2006-03-31T03:30:45", "2006-03-31T03:30:45.123 EDT",
+             "2006-03-31T03:30:45.1 EDT", "2006-03-31T03:30:45 EDT", "---05 PST", "---04", "--12 GMT", "--12",
+             "--08-08 EST", "--08-08", "1976-08-08 PDT", "1976-08-08", "88-12 CST", "1988-12", "2005 CDT", "1999",
+             "P2006Y 08M 10D T 12H 24M 07S", "P2006Y 10D T 12H", "-P2006Y 08M 10D T 07S.2", "P08M 10D T 07H",
+             "-P 04M 10DT12H 24S.88", "PT12H"};
+
+        for (int i = 0; i < validStrings.length; i++) {
+            assertNotNull("DataHelper.toData() should not return null for '" + validStrings[i] + "'.", data_helper
+                .toDate(validStrings[i]));
+        }
+    }
+}

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

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



---------------------------------------------------------------------
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