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 13:18:11 UTC

svn commit: r538874 - in /incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21: UnderReviewSuite.java tests/api/ContainmentCyclePreventionTest.java

Author: kelvingoodson
Date: Thu May 17 04:18:10 2007
New Revision: 538874

URL: http://svn.apache.org/viewvc?view=rev&rev=538874
Log:
modified containment cycle test to non parameterized approach

Modified:
    incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/UnderReviewSuite.java
    incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/ContainmentCyclePreventionTest.java

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=538874&r1=538873&r2=538874
==============================================================================
--- 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 04:18:10 2007
@@ -29,7 +29,7 @@
 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.api.ContainmentCyclePreventionTest;
 
 /**
  * This suite of tests is for new test cases, or test cases that are currently
@@ -55,7 +55,9 @@
                       SequenceConsistencySuite.class,
                       TypeHelperTest.class,
                       TypeTest.class,
-                      XMLHelperConsistencySuite.class
+                      XMLHelperConsistencySuite.class,
+                      ContainmentCyclePreventionTest.DynamicMetadata.class,
+                      ContainmentCyclePreventionTest.XSDMetadata.class
                       
                       })
 public class UnderReviewSuite {

Modified: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/ContainmentCyclePreventionTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/ContainmentCyclePreventionTest.java?view=diff&rev=538874&r1=538873&r2=538874
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/ContainmentCyclePreventionTest.java (original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/ContainmentCyclePreventionTest.java Thu May 17 04:18:10 2007
@@ -18,19 +18,26 @@
  */
 package test.sdo21.tests.api;
 
-import static org.junit.Assert.fail;
 import static org.junit.Assert.assertTrue;
-import commonj.sdo.DataObject;
-import commonj.sdo.Sequence;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.After;
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
+import org.junit.runners.Enclosed;
+import org.junit.runners.Suite;
 
-import test.sdo21.framework.DataObjectFactory;
-import test.sdo21.paramatizedTests.BaseSDOParamatizedTest;
+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 java.util.ArrayList;
-import java.util.List;
+import commonj.sdo.DataObject;
+import commonj.sdo.Sequence;
 
 /**
  * Tests prevdention of containment cycles.  Each test passes if the method call that
@@ -38,21 +45,51 @@
  * not allow the formation of containment cycle.  There is a test case for 
  * each of the various mechanisms through which a containment cycle may be created.   
  */
-@RunWith(Parameterized.class)
-public class ContainmentCyclePreventionTest extends BaseSDOParamatizedTest {    
+public abstract class ContainmentCyclePreventionTest extends CTSConsistencyBase {
+  
+    public ContainmentCyclePreventionTest() {
+    } 
+    
+    public static class DynamicMetadata extends ContainmentCyclePreventionTest {
+      public DynamicMetadata() {
+        
+      }
+      public TestDataFactory createTestDataFactory() {
+  
+        return new StandardDynamicFactory();
+      }
+    }
+
+    public static class XSDMetadata extends ContainmentCyclePreventionTest {
+      
+      public XSDMetadata() {
+      }
+      
+      public TestDataFactory createTestDataFactory() {
+  
+        return new StandardXSDFactory();
+      }
+    }
+    
     
-    public ContainmentCyclePreventionTest(DataObjectFactory factory, String description) 
-    {
-        super(factory, description);
+    @Before
+    public void setUp () throws Exception {
+      super.setUp();
+    }
+    
+    @After
+    public void tearDown() throws Exception {
+      super.tearDown();
     }
     
     /**
      * Attempt to create a 1-Member Containment Cycle using set____ on a single valued property
      * and verify the behavior of the method.  
+     * @throws Exception 
      */
 	@Test
-    public void oneMemberSingleValueSetDataObject() {        
-        DataObject dataObj1 = factory.createTestAPIObject();     
+    public void oneMemberSingleValueSetDataObject() throws Exception {        
+        DataObject dataObj1 = factory.createTestData(getScope(), StandardFactory.API_TYPE);     
         
         setSingleValueOneMember(dataObj1);
     }
@@ -60,12 +97,13 @@
     /**
      * Attempt to create an n-Member Containment Cycle using set____ on a single valued property
      * and verify the behavior of the method.  
+     * @throws Exception 
      */
 	@Test
-    public void nMemberSingleValueSetDataObject() {
-        DataObject dataObj1 = factory.createTestAPIObject();
-        DataObject dataObj2 = factory.createTestAPIObject();
-        DataObject dataObj3 = factory.createTestAPIObject();
+    public void nMemberSingleValueSetDataObject() throws Exception {
+        DataObject dataObj1 = factory.createTestData(getScope(), StandardFactory.API_TYPE);
+        DataObject dataObj2 = factory.createTestData(getScope(), StandardFactory.API_TYPE);
+        DataObject dataObj3 = factory.createTestData(getScope(), StandardFactory.API_TYPE);
         
         setSingleValueNMember(dataObj1, dataObj2, dataObj3);
     }
@@ -73,12 +111,13 @@
     /**
      * Attempt to create a 1-Member Containment Cycle using set____ on a multi valued property
      * and verify the behavior of the method.  
+     * @throws Exception 
      */
 	@Test
-    public void oneMemberMultiValueSetDataObject() {
-        DataObject dataObj1 = factory.createTestAPIObject();
-        DataObject dataObj2 = factory.createTestAPIObject();
-        DataObject dataObj3 = factory.createTestAPIObject();
+    public void oneMemberMultiValueSetDataObject() throws Exception {
+        DataObject dataObj1 = factory.createTestData(getScope(), StandardFactory.API_TYPE);
+        DataObject dataObj2 = factory.createTestData(getScope(), StandardFactory.API_TYPE);
+        DataObject dataObj3 = factory.createTestData(getScope(), StandardFactory.API_TYPE);
         
         setMultiValueOneMember(dataObj1, dataObj2, dataObj3);
     }
@@ -86,12 +125,13 @@
     /**
      * Attempt to create an n-Member Containment Cycle using set____ on a multi valued property
      * and verify the behavior of the method.  
+     * @throws Exception 
      */
 	@Test
-    public void nMemberMultiValueSetDataObject() {
-        DataObject dataObj1 = factory.createTestAPIObject();
-        DataObject dataObj2 = factory.createTestAPIObject();
-        DataObject dataObj3 = factory.createTestAPIObject();
+    public void nMemberMultiValueSetDataObject() throws Exception {
+        DataObject dataObj1 = factory.createTestData(getScope(), StandardFactory.API_TYPE);
+        DataObject dataObj2 = factory.createTestData(getScope(), StandardFactory.API_TYPE);
+        DataObject dataObj3 = factory.createTestData(getScope(), StandardFactory.API_TYPE);
         
         setManyValueNMember(dataObj1, dataObj2, dataObj3);
     }
@@ -100,10 +140,11 @@
      * Attempt to create a 1-Member Containment Cycle by making updates to a List returned
      * from the DataObject and verify the behavior of the method.  This is the static version 
      * of this test case.
+     * @throws Exception 
      */
 	@Test
-    public void oneMemberReturnedList() {
-        DataObject dataObj1 = factory.createTestAPIObject();
+    public void oneMemberReturnedList() throws Exception {
+        DataObject dataObj1 = factory.createTestData(getScope(), StandardFactory.API_TYPE);
         
         returnedListOneMember(dataObj1);
     }
@@ -112,12 +153,13 @@
      * Attempt to create an n-Member Containment Cycle by making updates to a List returned
      * from the DataObject and verify the behavior of the method.  This is the static version 
      * of this test case.
+     * @throws Exception 
      */
 	@Test
-    public void nMemberReturnedList() {
-        DataObject dataObj1 = factory.createTestAPIObject();
-        DataObject dataObj2 = factory.createTestAPIObject();
-        DataObject dataObj3 = factory.createTestAPIObject();
+    public void nMemberReturnedList() throws Exception {
+        DataObject dataObj1 = factory.createTestData(getScope(), StandardFactory.API_TYPE);
+        DataObject dataObj2 = factory.createTestData(getScope(), StandardFactory.API_TYPE);
+        DataObject dataObj3 = factory.createTestData(getScope(), StandardFactory.API_TYPE);
         
         returnedListNMember(dataObj1, dataObj2, dataObj3);
     }
@@ -126,10 +168,11 @@
      * Attempt to create a 1-Member Containment Cycle using by using a Sequence to make updates
      * to the DataObject, affecting a single valued property, and verify the behavior of 
      * the method.  
+     * @throws Exception 
      */
 	@Test
-    public void oneMemberSingleValueSequence() {
-        DataObject dataObj1 = factory.createSequencedObject();
+    public void oneMemberSingleValueSequence() throws Exception {
+        DataObject dataObj1 = factory.createTestData(getScope(), StandardFactory.SEQ_TYPE);
         
         sequenceSingleValueOneMember(dataObj1);
     }
@@ -138,12 +181,13 @@
      * Attempt to create an n-Member Containment Cycle using by using a Sequence to make updates
      * to the DataObject, affecting a single valued property, and verify the behavior of 
      * the method.  
+     * @throws Exception 
      */
 	@Test
-    public void nMemberSingleValueSequence() {
-        DataObject dataObj1 = factory.createSequencedObject();
-        DataObject dataObj2 = factory.createSequencedObject();
-        DataObject dataObj3 = factory.createSequencedObject();
+    public void nMemberSingleValueSequence() throws Exception {
+        DataObject dataObj1 = factory.createTestData(getScope(), StandardFactory.SEQ_TYPE);;
+        DataObject dataObj2 = factory.createTestData(getScope(), StandardFactory.SEQ_TYPE);;
+        DataObject dataObj3 = factory.createTestData(getScope(), StandardFactory.SEQ_TYPE);;
         
         sequenceSingleValueNMember(dataObj1, dataObj2, dataObj3);
     }
@@ -152,12 +196,13 @@
      * Attempt to create a 1-Member Containment Cycle using by using a Sequence to make updates
      * to the DataObject, affecting a multi valued property, and verify the behavior of 
      * the method.  
+     * @throws Exception 
      */
 	@Test
-    public void oneMemberMultiValueSequence() {
-        DataObject dataObj1 = factory.createSequencedObject();
-        DataObject dataObj2 = factory.createSequencedObject();
-        DataObject dataObj3 = factory.createSequencedObject();
+    public void oneMemberMultiValueSequence() throws Exception {
+        DataObject dataObj1 = factory.createTestData(getScope(), StandardFactory.SEQ_TYPE);;
+        DataObject dataObj2 = factory.createTestData(getScope(), StandardFactory.SEQ_TYPE);;
+        DataObject dataObj3 = factory.createTestData(getScope(), StandardFactory.SEQ_TYPE);;
         
         sequenceMultiValueOneMember(dataObj1, dataObj2, dataObj3);
     }
@@ -166,12 +211,13 @@
      * Attempt to create an n-Member Containment Cycle using by using a Sequence to make updates
      * to the DataObject, affecting a multi valued property, and verify the behavior of 
      * the method.  
+     * @throws Exception 
      */
 	@Test
-    public void nMemberMultiValueSequence() {
-        DataObject dataObj1 = factory.createSequencedObject();
-        DataObject dataObj2 = factory.createSequencedObject();
-        DataObject dataObj3 = factory.createSequencedObject();
+    public void nMemberMultiValueSequence() throws Exception {
+        DataObject dataObj1 = factory.createTestData(getScope(), StandardFactory.SEQ_TYPE);;
+        DataObject dataObj2 = factory.createTestData(getScope(), StandardFactory.SEQ_TYPE);;
+        DataObject dataObj3 = factory.createTestData(getScope(), StandardFactory.SEQ_TYPE);;
         
         sequenceManyValueNMember(dataObj1, dataObj2, dataObj3);
     }



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