You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ke...@apache.org on 2007/05/17 17:51:54 UTC

svn commit: r538980 - in /incubator/tuscany/java/cts: sdo2.1-tuscany/src/main/java/tests/ sdo2.1-tuscany/src/main/java/tests/sdo21/ sdo2.1-tuscany/src/main/java/tests/sdo21/vendor/ sdo2.1-tuscany/src/main/java/tests/sdo21/vendor/tuscany/ sdo2.1-tuscany...

Author: kelvingoodson
Date: Thu May 17 08:51:53 2007
New Revision: 538980

URL: http://svn.apache.org/viewvc?view=rev&rev=538980
Log:
created new ProposedForAdoptionSuite class as staging post for discussion on mailing list.
Added optional tests suite for tuscany vendor specific tests in order to be able to move out
tests which have tuscany leakage. cleaned up import warnings.

Added:
    incubator/tuscany/java/cts/sdo2.1-tuscany/src/main/java/tests/
    incubator/tuscany/java/cts/sdo2.1-tuscany/src/main/java/tests/sdo21/
    incubator/tuscany/java/cts/sdo2.1-tuscany/src/main/java/tests/sdo21/vendor/
    incubator/tuscany/java/cts/sdo2.1-tuscany/src/main/java/tests/sdo21/vendor/tuscany/
    incubator/tuscany/java/cts/sdo2.1-tuscany/src/main/java/tests/sdo21/vendor/tuscany/api/
    incubator/tuscany/java/cts/sdo2.1-tuscany/src/main/java/tests/sdo21/vendor/tuscany/api/TypeTest.java
    incubator/tuscany/java/cts/sdo2.1-tuscany/src/test/java/test/sdo21/vendor/tuscany/tests/TuscanyOptionalTestSuite.java
    incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/ProposedForAdoptionSuite.java
    incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/ChangeSummaryTest.java
Modified:
    incubator/tuscany/java/cts/sdo2.1-tuscany/src/test/java/test/sdo21/vendor/tuscany/tests/OptionalCtsTestSuite.java
    incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/CTSSuite.java
    incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/UnderReviewSuite.java
    incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/framework/TestHelper.java
    incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/ConsistencyTestTemplate.java
    incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/TestTemplate.java
    incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/DataGraph/DataGraphConsistencyBase.java
    incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/TypeHelperTest.java
    incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/TypeTest.java

Added: incubator/tuscany/java/cts/sdo2.1-tuscany/src/main/java/tests/sdo21/vendor/tuscany/api/TypeTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1-tuscany/src/main/java/tests/sdo21/vendor/tuscany/api/TypeTest.java?view=auto&rev=538980
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1-tuscany/src/main/java/tests/sdo21/vendor/tuscany/api/TypeTest.java (added)
+++ incubator/tuscany/java/cts/sdo2.1-tuscany/src/main/java/tests/sdo21/vendor/tuscany/api/TypeTest.java Thu May 17 08:51:53 2007
@@ -0,0 +1,102 @@
+/*
+ *  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: 537885 $  $Date: 2007-05-14 16:39:47 +0100 (Mon, 14 May 2007) $
+ */
+package tests.sdo21.vendor.tuscany.api;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import test.sdo21.framework.CTSTestCase;
+import test.sdo21.tests.ConsistencyTestTemplate;
+import test.sdo21.tests.TestData.StandardDynamicFactory;
+import test.sdo21.tests.TestData.StandardFactory;
+import test.sdo21.tests.TestData.StandardXSDFactory;
+import test.sdo21.tests.TestData.TestDataFactory;
+import test.sdo21.tests.api.CTSConsistencyBase;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+
+public abstract class TypeTest extends CTSConsistencyBase {
+    public TypeTest() {
+    } 
+
+    public static class DynamicMetadata extends TypeTest {
+      public DynamicMetadata() {
+        
+      }
+      public TestDataFactory createTestDataFactory() {
+  
+        return new StandardDynamicFactory();
+      }
+    }
+  
+    public static class XSDMetadata extends TypeTest {
+      
+      public XSDMetadata() {
+      }
+      
+      public TestDataFactory createTestDataFactory() {
+  
+        return new StandardXSDFactory();
+      }
+    }
+    
+    
+    @Before
+    public void setUp () throws Exception {
+      super.setUp();
+    }
+    
+    @After
+    public void tearDown() throws Exception {
+      super.tearDown();
+    }
+    
+    
+    /**
+     * Verify the value returned by Type.getAliasNames() when there are alias
+     * names to return
+     */
+    @Ignore("typeGetAliasNames test case is suppressed until SDOUtil.addAliasName is implemented.")
+    @Test
+    public void typeGetAliasNames() {
+        Type sequencedType = testDO.getInstanceProperty("sequencedElem").getType();
+        List aliases = sequencedType.getAliasNames();
+
+        assertEquals("The List returned by Type.getAliasNames was not of the expected size.", 1, aliases.size());
+
+        String aliasName = (String)aliases.get(1);
+        assertEquals("The alias returned by Type.getAliasNames was not the expected name.", "Seq2", aliasName);
+    }
+
+}

Modified: incubator/tuscany/java/cts/sdo2.1-tuscany/src/test/java/test/sdo21/vendor/tuscany/tests/OptionalCtsTestSuite.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1-tuscany/src/test/java/test/sdo21/vendor/tuscany/tests/OptionalCtsTestSuite.java?view=diff&rev=538980&r1=538979&r2=538980
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1-tuscany/src/test/java/test/sdo21/vendor/tuscany/tests/OptionalCtsTestSuite.java (original)
+++ incubator/tuscany/java/cts/sdo2.1-tuscany/src/test/java/test/sdo21/vendor/tuscany/tests/OptionalCtsTestSuite.java Thu May 17 08:51:53 2007
@@ -29,7 +29,8 @@
  * contains new test cases under review for inclusion.
  */
 @RunWith(Suite.class)
-@Suite.SuiteClasses( {test.sdo21.UnderReviewSuite.class})
+@Suite.SuiteClasses( {test.sdo21.UnderReviewSuite.class,
+                      test.sdo21.vendor.tuscany.tests.TuscanyOptionalTestSuite.class})
 public class OptionalCtsTestSuite {
 
 }

Added: incubator/tuscany/java/cts/sdo2.1-tuscany/src/test/java/test/sdo21/vendor/tuscany/tests/TuscanyOptionalTestSuite.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1-tuscany/src/test/java/test/sdo21/vendor/tuscany/tests/TuscanyOptionalTestSuite.java?view=auto&rev=538980
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1-tuscany/src/test/java/test/sdo21/vendor/tuscany/tests/TuscanyOptionalTestSuite.java (added)
+++ incubator/tuscany/java/cts/sdo2.1-tuscany/src/test/java/test/sdo21/vendor/tuscany/tests/TuscanyOptionalTestSuite.java Thu May 17 08:51:53 2007
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+package test.sdo21.vendor.tuscany.tests;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+/**
+ * Provided to execute the non adopted test cases in the SDO CTS within tuscany
+ * environment using the maven plugin. The {@link test.sdo21.CTSSuite} suite contains
+ * test cases that have been 'adopted' by the community, {@link test.sdo21.UnderReviewSuite} 
+ * contains new test cases under review for inclusion.
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses( {tests.sdo21.vendor.tuscany.api.TypeTest.DynamicMetadata.class,
+                      tests.sdo21.vendor.tuscany.api.TypeTest.XSDMetadata.class})
+public class TuscanyOptionalTestSuite {
+
+}

Modified: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/CTSSuite.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/CTSSuite.java?view=diff&rev=538980&r1=538979&r2=538980
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/CTSSuite.java (original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/CTSSuite.java Thu May 17 08:51:53 2007
@@ -20,12 +20,9 @@
  */
 package test.sdo21;
 
-import org.junit.BeforeClass;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 
-import test.sdo21.framework.TestHelper;
-
 /**
  * The main "root" CTS test suite which includes execution of the following
  * sub-categorized CTS within Junit 4.1 environment:
@@ -44,9 +41,6 @@
 @RunWith(Suite.class)
 @Suite.SuiteClasses( {test.sdo21.tests.CTSGeneralSuite.class})
 public class CTSSuite {
-
-    private static TestHelper testHelper;
-    private static boolean initialized = false;
 
     /**
      * Name of environment variable for vendor specific implementation for

Added: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/ProposedForAdoptionSuite.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/ProposedForAdoptionSuite.java?view=auto&rev=538980
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/ProposedForAdoptionSuite.java (added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/ProposedForAdoptionSuite.java Thu May 17 08:51:53 2007
@@ -0,0 +1,45 @@
+/*
+ *  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: 538933 $  $Date: 2007-05-17 15:11:43 +0100 (Thu, 17 May 2007) $
+ */
+package test.sdo21;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+import test.sdo21.tests.CTSGeneralSuite;
+import test.sdo21.tests.api.TypeTest;
+import test.sdo21.tests.api.DataFactory.DataFactoryConsistencySuite;
+import test.sdo21.tests.api.DataGraph.DataGraphConsistencySuite;
+
+/**
+ * This suite of tests is for test cases which have been reviewed, by
+ * a member of the community and proposed on the mailing list as suitable for adoption.
+ * After mailing list discussion or in the absence of any contention, lazy consensus
+ * the tests can be moved to the appropriate place, i.e. the {@link CTSGeneralSuite} or back to
+ * the {@link UnderReviewSuite} suite.
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses( {DataGraphConsistencySuite.class,
+                      DataFactoryConsistencySuite.class,
+                      TypeTest.DynamicMetadata.class,
+                      TypeTest.XSDMetadata.class})
+public class ProposedForAdoptionSuite {
+
+}

Modified: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/UnderReviewSuite.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/UnderReviewSuite.java?view=diff&rev=538980&r1=538979&r2=538980
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/UnderReviewSuite.java (original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/UnderReviewSuite.java Thu May 17 08:51:53 2007
@@ -23,15 +23,13 @@
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 
+import test.sdo21.tests.api.ChangeSummaryTest;
 import test.sdo21.tests.api.ContainmentCyclePreventionTest;
 import test.sdo21.tests.api.ContainmentCycleSerializationTest;
 import test.sdo21.tests.api.PropertyTest;
 import test.sdo21.tests.api.TypeHelperTest;
-import test.sdo21.tests.api.TypeTest;
 import test.sdo21.tests.api.XMLWithoutSchemaTest;
 import test.sdo21.tests.api.CopyHelper.CopyEqualityTest;
-import test.sdo21.tests.api.DataFactory.DataFactoryConsistencySuite;
-import test.sdo21.tests.api.DataGraph.DataGraphConsistencySuite;
 import test.sdo21.tests.api.Sequence.SequenceConsistencySuite;
 import test.sdo21.tests.api.XMLHelper.XMLHelperConsistencySuite;
 import test.sdo21.tests.conversion.StringConversionTest;
@@ -44,13 +42,12 @@
  * the CTS.
  */
 @RunWith(Suite.class)
-@Suite.SuiteClasses( {StringConversionTest.class,
+@Suite.SuiteClasses( {ProposedForAdoptionSuite.class,
+                      
+                      StringConversionTest.class,
                       XMLWithoutSchemaTest.class,
-                      DataGraphConsistencySuite.class,
-                      DataFactoryConsistencySuite.class,
                       SequenceConsistencySuite.class,
                       TypeHelperTest.class,
-                      TypeTest.class,
                       XMLHelperConsistencySuite.class,
                       ContainmentCyclePreventionTest.DynamicMetadata.class,
                       ContainmentCyclePreventionTest.XSDMetadata.class,
@@ -59,7 +56,8 @@
                       CopyEqualityTest.DynamicMetadata.class,
                       CopyEqualityTest.XSDMetadata.class,
                       PropertyTest.class,
-                      TypeConversionTest2.class
+                      TypeConversionTest2.class,
+                      ChangeSummaryTest.class
                       
                       })
 public class UnderReviewSuite {

Modified: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/framework/TestHelper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/framework/TestHelper.java?view=diff&rev=538980&r1=538979&r2=538980
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/framework/TestHelper.java (original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/framework/TestHelper.java Thu May 17 08:51:53 2007
@@ -20,18 +20,11 @@
  */
 package test.sdo21.framework;
 
-import java.util.Collection;
-
-import commonj.sdo.DataGraph;
-import commonj.sdo.DataObject;
-import commonj.sdo.Type;
-import commonj.sdo.helper.HelperContext;
-import commonj.sdo.helper.TypeHelper;
-import java.io.ObjectOutputStream;
+import java.io.InputStream;
 import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.io.OutputStream;
-import java.io.InputStream;
-//import javax.xml.stream.XMLStreamWriter;
+import java.util.Collection;
 
 import test.sdo21.tests.ConsistencyTestTemplate;
 import test.sdo21.tests.TestData.StandardDynamicFactory;
@@ -39,6 +32,11 @@
 import test.sdo21.tests.TestData.StandardXSDFactory;
 import test.sdo21.tests.TestData.TestDataFactory;
 import test.sdo21.tests.util.CTSUtil;
+
+import commonj.sdo.DataGraph;
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.helper.HelperContext;
 
 /**
  * Vendors can provide an implementation of this interface to bootstrap their

Modified: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/ConsistencyTestTemplate.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/ConsistencyTestTemplate.java?view=diff&rev=538980&r1=538979&r2=538980
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/ConsistencyTestTemplate.java (original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/ConsistencyTestTemplate.java Thu May 17 08:51:53 2007
@@ -23,7 +23,6 @@
 // static imports simply allow you to call assertTrue rather than
 // Assert.assertTrue
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
 
 import org.junit.After;
 import org.junit.Before;
@@ -31,14 +30,13 @@
 import org.junit.Ignore;
 import org.junit.Test;
 
-import commonj.sdo.DataObject;
-
-import test.sdo21.framework.TestHelper;
 import test.sdo21.tests.TestData.StandardDynamicFactory;
 import test.sdo21.tests.TestData.StandardXSDFactory;
 import test.sdo21.tests.TestData.TestDataFactory;
 import test.sdo21.tests.api.CTSConsistencyBase;
 
+import commonj.sdo.DataObject;
+
 /**
  * Example test class to be used as a template for SDO test cases which apply
  * the same set of tests to a number of data sets of the same shape, but backed
@@ -156,18 +154,17 @@
      * Sometimes you may not have the resources to implement a test case. If is
      * very very valuable to create method signatures in the appropiate classes
      * for test cases that are currently not covered. In cases such as these
-     * please define and checkin method signatures with the following failure
+     * please define and checkin method signatures with the following ignore
      * message. <br>
      * <br>
      * In this case you should ensure that the class that contains the test
      * method is added to a testSuite such as
-     * {@link test.sdo21.paramatizedTests.CTSParamatizedSuite} so that it will
+     * {@link test.sdo21.UnderReviewSuite} so that it will
      * be completed, or open a defect/JIRA to complete the test case.
      */
     @Test
+    @Ignore("This test method requires implementation")
     public void exampleUnimplementedTestCase() {
-        fail(TestHelper.INCOMPLETE_TEST_CASE_FAILURE);
-        // test method here
     }
 
     /**

Modified: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/TestTemplate.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/TestTemplate.java?view=diff&rev=538980&r1=538979&r2=538980
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/TestTemplate.java (original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/TestTemplate.java Thu May 17 08:51:53 2007
@@ -23,14 +23,14 @@
 // static imports simply allow you to call assertTrue rather than
 // Assert.assertTrue
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
 
+import org.junit.After;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
 
-import test.sdo21.framework.TestHelper;
+import test.sdo21.framework.CTSTestCase;
 
 /**
  * Example test class to be used as a template SDO test cases.
@@ -59,7 +59,7 @@
  * <LI>Initial implementation
  * </UL>
  */
-public class TestTemplate {
+public class TestTemplate extends CTSTestCase {
 
 
     /**
@@ -92,18 +92,16 @@
      * Sometimes you may not have the resources to implement a test case. If is
      * very very valuable to create method signatures in the appropiate classes
      * for test cases that are currently not covered. In cases such as these
-     * please define and checkin method signatures with the following failure
-     * message. <br>
+     * please define and checkin method signatures<br>
      * <br>
      * In this case you should ensure that the class that contains the test
      * method is added to a testSuite such as
-     * {@link test.sdo21.paramatizedTests.CTSParamatizedSuite} so that it will
+     * {@link test.sdo21.UnderReviewSuite} so that it will
      * be completed, or open a defect/JIRA to complete the test case.
      */
     @Test
+    @Ignore("This test method requires implementation")
     public void exampleUnimplementedTestCase() {
-        fail(TestHelper.INCOMPLETE_TEST_CASE_FAILURE);
-        // test method here
     }
 
     /**
@@ -112,10 +110,16 @@
      * <code>public void</code> method with <code>@Before</code> causes that method to be run before the
      *         {@link org.junit.Test} method. The <code>@Before</code> methods of superclasses will be run before those of the
      *         current class. There is also an <code>@After</code> annotation
+     * @throws Exception 
      */
     @Before
-    public void testCaseInit() {
-        // initMethod
+    public void setUp() throws Exception {
+      super.setUp();
+    }
+
+    @After
+    public void tearDown() throws Exception {
+      super.tearDown();
     }
 
     /**

Added: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/ChangeSummaryTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/ChangeSummaryTest.java?view=auto&rev=538980
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/ChangeSummaryTest.java (added)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/ChangeSummaryTest.java Thu May 17 08:51:53 2007
@@ -0,0 +1,122 @@
+/*
+ *  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: 538928 $  $Date: 2007-05-17 15:00:54 +0100 (Thu, 17 May 2007) $
+ */
+package test.sdo21.tests.api;
+
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import test.sdo21.framework.CTSTestCase;
+import test.sdo21.tests.TestData.StandardDynamicFactory;
+import test.sdo21.tests.TestData.StandardFactory;
+import test.sdo21.tests.TestData.TestDataFactory;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.DataGraph;
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.impl.HelperProvider;
+
+/**
+ */
+public class ChangeSummaryTest extends CTSTestCase {
+    private DataObject testDO;
+    TestDataFactory factory;
+    
+    public ChangeSummaryTest() {
+      factory = new StandardDynamicFactory();
+    }
+  
+    @Before
+    public void setUp () throws Exception {
+      super.setUp();
+      factory.defineMetaData(getScope());
+      testDO = factory.createTestData(getScope(), StandardFactory.API_TYPE);
+    }
+   
+  
+    @After
+    public void tearDown() throws Exception {
+      super.tearDown();
+    }
+    
+    /**
+     * testGetChangeSummary performs some verification on the ChangeSummary
+     * returned by DataGraph.getChangeSummary()
+     */
+    private void runChangeSummaryTests(DataGraph generatingDG) {
+        ChangeSummary generatedCS = generatingDG.getChangeSummary();
+  
+        assertNotNull("DataGraph.getChangeSummary() returned a null ChangeSummary.", generatedCS);
+  
+        assertEquals("The ChangeSummary returned by DataGraph.getChangeSummary() did not return refer to the generating DataGraph.",
+                     generatedCS.getDataGraph(),
+                     generatingDG);
+  
+        assertEquals("The ChangeSummary returned by DataGraph.getChangeSummary() and the DataGraph have different root Objects. ",
+                     generatedCS.getRootObject(),
+                     generatingDG.getRootObject());
+    }
+  
+    /**
+     * Verify the proper function of DataGraph.getChangeSummary() when the
+     * DataGraph RootObject was created by Type
+     */
+    @Test
+    public void testDataGraphGetChangeSummaryType() {
+        Type testType = testDO.getType();
+  
+        DataGraph dataGraph = getTestHelper().createDataGraph();
+        dataGraph.createRootObject(testType);
+  
+        runChangeSummaryTests(dataGraph);
+    }
+  
+    /**
+     * Verify the proper function of DataGraph.getChangeSummary() when the
+     * DataGraph RootObject was created by URI
+     * @throws Exception 
+     */
+    @Test
+    public void testDataGraphGetChangeSummaryURI() throws Exception {
+        // we are constrained to work with the default helper context for these APIs
+        // so lets override the default behaviour of the test framework for this method
+        
+        HelperContext globalScope = HelperProvider.getDefaultContext();
+        factory.defineMetaData(globalScope);
+        testDO = factory.createTestData(globalScope, StandardFactory.API_TYPE);
+  
+        Type testType = testDO.getType();
+  
+        DataGraph dataGraph = getTestHelper().createDataGraph();
+        dataGraph.createRootObject(testType.getURI(), testType.getName());
+  
+        runChangeSummaryTests(dataGraph);
+    }
+
+
+
+}

Modified: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/DataGraph/DataGraphConsistencyBase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/DataGraph/DataGraphConsistencyBase.java?view=diff&rev=538980&r1=538979&r2=538980
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/DataGraph/DataGraphConsistencyBase.java (original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/DataGraph/DataGraphConsistencyBase.java Thu May 17 08:51:53 2007
@@ -21,22 +21,19 @@
 package test.sdo21.tests.api.DataGraph;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
 
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 
-import test.sdo21.framework.CTSTestCase;
 import test.sdo21.tests.TestData.StandardFactory;
-import test.sdo21.tests.TestData.TestDataFactory;
 import test.sdo21.tests.api.CTSConsistencyBase;
 
-import commonj.sdo.ChangeSummary;
 import commonj.sdo.DataGraph;
 import commonj.sdo.DataObject;
 import commonj.sdo.Type;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.impl.HelperProvider;
 
 public abstract class DataGraphConsistencyBase extends CTSConsistencyBase {
 
@@ -72,13 +69,16 @@
 
     /**
      * Verify the proper function of DataGraph.createRootObject(URI,Name).
+     * @throws Exception 
      */
     @Test
-    // FIXME I don't think we should be removing tests because they will in the future be deprecated
-    // This suite tests against the 2.1 spec as it stands -- so we may need to have some
-    // tests running against the default helper context if the API doesn't support selection of scope
-    @Ignore("(Uri,name) methods of DataGraph should be deprecated due to absence of HelperContext.")
-    public void testCreateRootObjectByURI() {
+    public void testCreateRootObjectByURI() throws Exception {
+        // we are constrained to work with the default helper context for these APIs
+        // so lets override the default behaviour of the test framework for this method
+        
+        HelperContext globalScope = HelperProvider.getDefaultContext();
+        factory.defineMetaData(globalScope);
+        testDO = factory.createTestData(globalScope, StandardFactory.API_TYPE);
         Type testType = testDO.getType();
 
         DataGraph dataGraph = getTestHelper().createDataGraph();
@@ -93,42 +93,22 @@
                      rootDO);
     }
 
-    /**
-     * Verify the proper function of DataGraph.getChangeSummary() when the
-     * DataGraph RootObject was created by Type
-     */
-    @Test
-    public void testDataGraphGetChangeSummaryType() {
-        Type testType = testDO.getType();
-
-        DataGraph dataGraph = getTestHelper().createDataGraph();
-        dataGraph.createRootObject(testType);
-
-        runChangeSummaryTests(dataGraph);
-    }
-
-    /**
-     * Verify the proper function of DataGraph.getChangeSummary() when the
-     * DataGraph RootObject was created by URI
-     */
-    @Test
-    @Ignore("(Uri,name) methods of DataGraph should be deprecated due to absence of HelperContext.")
-    public void testDataGraphGetChangeSummaryURI() {
-        Type testType = testDO.getType();
 
-        DataGraph dataGraph = getTestHelper().createDataGraph();
-        dataGraph.createRootObject(testType.getURI(), testType.getName());
-
-        runChangeSummaryTests(dataGraph);
-    }
 
     /**
      * Verify the proper function of DataGraph.getType(URI, Name) when the
      * DataGraph RootObject was created by Type
+     * @throws Exception 
      */
     @Test
-    @Ignore("(Uri,name) methods of DataGraph should be deprecated due to absence of HelperContext.")
-    public void testDataGraphGetType() {
+    public void testDataGraphGetType() throws Exception {
+        // we are constrained to work with the default helper context for these APIs
+        // so lets override the default behaviour of the test framework for this method
+        
+        HelperContext globalScope = HelperProvider.getDefaultContext();
+        factory.defineMetaData(globalScope);
+        testDO = factory.createTestData(globalScope, StandardFactory.API_TYPE);
+
         Type testType = testDO.getType();
 
         DataGraph dataGraph = getTestHelper().createDataGraph();
@@ -142,10 +122,17 @@
     /**
      * Verify the proper function of DataGraph.getType(URI, Name) when the
      * DataGraph RootObject was created by URI
+     * @throws Exception 
      */
     @Test
-    @Ignore("(Uri,name) methods of DataGraph should be deprecated due to absence of HelperContext.")
-    public void testDataGraphGetURI() {
+    public void testDataGraphGetURI() throws Exception {
+        // we are constrained to work with the default helper context for these APIs
+        // so lets override the default behaviour of the test framework for this method
+        
+        HelperContext globalScope = HelperProvider.getDefaultContext();
+        factory.defineMetaData(globalScope);
+        testDO = factory.createTestData(globalScope, StandardFactory.API_TYPE);
+
         Type testType = testDO.getType();
 
         DataGraph dataGraph = getTestHelper().createDataGraph();
@@ -156,21 +143,5 @@
                      testType);
     }
 
-    /**
-     * testGetChangeSummary performs some verification on the ChangeSummary
-     * returned by DataGraph.getChangeSummary()
-     */
-    private void runChangeSummaryTests(DataGraph generatingDG) {
-        ChangeSummary generatedCS = generatingDG.getChangeSummary();
-
-        assertNotNull("DataGraph.getChangeSummary() returned a null ChangeSummary.", generatedCS);
 
-        assertEquals("The ChangeSummary returned by DataGraph.getChangeSummary() did not return refer to the generating DataGraph.",
-                     generatedCS.getDataGraph(),
-                     generatingDG);
-
-        assertEquals("The ChangeSummary returned by DataGraph.getChangeSummary() and the DataGraph have different root Objects. ",
-                     generatedCS.getRootObject(),
-                     generatingDG.getRootObject());
-    }
 }

Modified: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/TypeHelperTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/TypeHelperTest.java?view=diff&rev=538980&r1=538979&r2=538980
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/TypeHelperTest.java (original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/TypeHelperTest.java Thu May 17 08:51:53 2007
@@ -37,6 +37,7 @@
 import test.sdo21.framework.CTSTestCase;
 import test.sdo21.tests.TestData.StandardDynamicFactory;
 import test.sdo21.tests.TestData.StandardFactory;
+import test.sdo21.tests.TestData.StandardXSDFactory;
 import test.sdo21.tests.TestData.TestDataFactory;
 import test.sdo21.tests.util.CTSUtil;
 
@@ -55,7 +56,7 @@
   public TypeHelperTest() {
     // Tests on the Property interface should be independent of the metadata creation mechanism
     // so just pick one Standard Factory
-    factory = new StandardDynamicFactory();
+    factory = new StandardXSDFactory();
   }
 
   @Before
@@ -83,6 +84,7 @@
       TypeHelper typeHelper = getScope().getTypeHelper();
       Type returnedType = typeHelper.getType(testType.getURI(), testType.getName());
 
+      // TODO I thinkk we can assert that the types are the same instance here?
       assertTrue("TypeHelper.getType(URI, Name) did not return the expected Type.", CTSUtil.areEqualTypes(returnedType, testType));
     }
 
@@ -91,8 +93,9 @@
      * @throws Exception 
      */
     @Test
+    @Ignore("this test currently never reaches the interesting assertion")
     public void getTypeByClass() throws Exception {
-    	DataObject testDO = factory.createTestData(getScope(), StandardFactory.API_TYPE);
+    	  DataObject testDO = factory.createTestData(getScope(), StandardFactory.API_TYPE);
         Type testType = testDO.getType();
 
         TypeHelper typeHelper = getScope().getTypeHelper();

Modified: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/TypeTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/TypeTest.java?view=diff&rev=538980&r1=538979&r2=538980
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/TypeTest.java (original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/TypeTest.java Thu May 17 08:51:53 2007
@@ -30,37 +30,48 @@
 
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 
-import test.sdo21.framework.CTSTestCase;
 import test.sdo21.tests.TestData.StandardDynamicFactory;
 import test.sdo21.tests.TestData.StandardFactory;
+import test.sdo21.tests.TestData.StandardXSDFactory;
 import test.sdo21.tests.TestData.TestDataFactory;
 
-import commonj.sdo.DataObject;
 import commonj.sdo.Property;
 import commonj.sdo.Type;
 
 
-public class TypeTest extends CTSTestCase {
-    private DataObject testDO;
-    TestDataFactory factory;
-    
+public abstract class TypeTest extends CTSConsistencyBase {
     public TypeTest() {
-      // Tests on the Property interface should be independent of the metadata creation mechanism
-      // so just pick one Standard Factory
-      factory = new StandardDynamicFactory();
+    } 
+
+    public static class DynamicMetadata extends TypeTest {
+      public DynamicMetadata() {
+        
+      }
+      public TestDataFactory createTestDataFactory() {
+  
+        return new StandardDynamicFactory();
+      }
     }
   
+    public static class XSDMetadata extends TypeTest {
+      
+      public XSDMetadata() {
+      }
+      
+      public TestDataFactory createTestDataFactory() {
+  
+        return new StandardXSDFactory();
+      }
+    }
+    
+    
     @Before
     public void setUp () throws Exception {
       super.setUp();
-      factory.defineMetaData(getScope());
-      testDO = factory.createTestData(getScope(), StandardFactory.API_TYPE);
     }
     
-    
     @After
     public void tearDown() throws Exception {
       super.tearDown();
@@ -218,22 +229,6 @@
         Type type = testDO.getType();
 
         assertEquals("Type.getAliasNames() returned a List of unexpected size.", 0, type.getAliasNames().size());
-    }
-
-    /**
-     * Verify the value returned by Type.getAliasNames() when there are alias
-     * names to return
-     */
-    @Ignore("typeGetAliasNames test case is suppressed until SDOUtil.addAliasName is implemented.")
-    @Test
-    public void typeGetAliasNames() {
-        Type sequencedType = testDO.getInstanceProperty("sequencedElem").getType();
-        List aliases = sequencedType.getAliasNames();
-
-        assertEquals("The List returned by Type.getAliasNames was not of the expected size.", 1, aliases.size());
-
-        String aliasName = (String)aliases.get(1);
-        assertEquals("The alias returned by Type.getAliasNames was not the expected name.", "Seq2", aliasName);
     }
 
     /**



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