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/15 13:14:15 UTC

svn commit: r538137 - in /incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/XMLHelper: ./ XMLHelperTest.java

Author: kelvingoodson
Date: Tue May 15 04:14:14 2007
New Revision: 538137

URL: http://svn.apache.org/viewvc?view=rev&rev=538137
Log:
early commit to separate move from rename

Added:
    incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/XMLHelper/
    incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/XMLHelper/XMLHelperTest.java
      - copied, changed from r537760, incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/api/XMLHelperTest.java

Copied: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/XMLHelper/XMLHelperTest.java (from r537760, incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/api/XMLHelperTest.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/XMLHelper/XMLHelperTest.java?view=diff&rev=538137&p1=incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/api/XMLHelperTest.java&r1=537760&p2=incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/XMLHelper/XMLHelperTest.java&r2=538137
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/paramatizedTests/api/XMLHelperTest.java (original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/XMLHelper/XMLHelperTest.java Tue May 15 04:14:14 2007
@@ -18,7 +18,7 @@
  *  
  *  $Rev$  $Date$
  */
-package test.sdo21.paramatizedTests.api;
+package test.sdo21.tests.api.XMLHelper;
 
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertNotNull;
@@ -27,6 +27,7 @@
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -35,28 +36,41 @@
 import test.sdo21.framework.DataObjectFactory;
 import test.sdo21.paramatizedTests.BaseSDOParamatizedTest;
 import test.sdo21.paramatizedTests.util.ParamatizedTestUtil;
+import test.sdo21.tests.TestData.StandardDynamicFactory;
+import test.sdo21.tests.TestData.StandardFactory;
+import test.sdo21.tests.TestData.TestDataFactory;
+import test.sdo21.tests.api.CTSConsistencyBase;
+import test.sdo21.tests.util.CTSUtil;
 
 import commonj.sdo.DataObject;
 import commonj.sdo.helper.HelperContext;
 
-/**
- * Junit 4.1 test case. Tests XMLHelper methods
- */
-@RunWith(Parameterized.class)
-public class XMLHelperTest extends BaseSDOParamatizedTest {
+
+public class XMLHelperTest extends CTSConsistencyBase {
 	private DataObject testDO;
 	private HelperContext helperContext;
-	
-    public XMLHelperTest(DataObjectFactory factory, String description) {
-        super(factory, description);
+  
+    public TestDataFactory createTestDataFactory() {
+  
+      return new StandardDynamicFactory();
     }
 
+
     @Before
-    public void setUp () {
-    	testDO = factory.createTestAPIObject();
-    	helperContext = factory.getHelperContext();
+    public void setUp () throws Exception {
+      super.setUp();
+    	testDO = factory.createTestData(getScope(), StandardFactory.API_TYPE);
+    	helperContext = getScope();
     }
     
+    
+    
+    @After
+    public void tearDown() throws Exception {
+      super.tearDown();
+    }
+
+
     /**
      * Serialize the DataObject then Deserialize the output using Java serialization. Result should be
      * equivalent to testDO.
@@ -64,13 +78,13 @@
     @Test
     public void testJavaSerializeDeserialize() {
         try {
-            ParamatizedTestUtil.populateFields(testDO, factory);
+            ((StandardFactory)factory).populateFields(testDO, helperContext);
         } catch (Exception e) {
             fail("Could not populate DataObject");
         }
         DataObject tempDO = null;
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
-// FIXME KG reintroduce
+// FIXME reintroduce
 //        try {
 //            ParamatizedTestUtil.serializeDataObjectJava(testDO, baos, helperContext);
 //        } catch (Exception e) {
@@ -98,14 +112,14 @@
     @Test
     public void testXMLHelperSerializeDeserialize() {
         try {
-            ParamatizedTestUtil.populateFields(testDO, factory);
+          ((StandardFactory)factory).populateFields(testDO, helperContext);
         } catch (Exception e) {
             fail("Could not populate DataObject");
         }
         DataObject tempDO = null;
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         try {
-            ParamatizedTestUtil.serializeDataObjectXML(testDO, baos, helperContext);
+            CTSUtil.serializeDataObjectXML(testDO, baos, helperContext);
         } catch (Exception e) {
             e.printStackTrace();
             fail("An Exception occurred while serializing the DataObject: " + e.toString());
@@ -113,7 +127,7 @@
 
         try {
             ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
-            tempDO = ParamatizedTestUtil.deserializeDataObjectXML(bais, helperContext);
+            tempDO = CTSUtil.deserializeDataObjectXML(bais, helperContext);
         } catch (Exception e) {
             e.printStackTrace();
             fail("An Exception occurred while deserializing the output of the serialization: " + e.toString());
@@ -121,7 +135,7 @@
 
         assertNotNull("Deserialization returned a null value.", tempDO);
         assertTrue("Serialization and deserialization resulted in a nonequivalent DataObject.",
-                ParamatizedTestUtil.equalDataObjects(testDO, tempDO));
+                CTSUtil.equalDataObjects(testDO, tempDO));
     }
 
     /**



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