tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agr...@apache.org
Subject svn commit: r551832 - /incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/SequenceAddTypedTest.java
Date Fri, 29 Jun 2007 09:13:45 GMT
Author: agrove
Date: Fri Jun 29 02:13:45 2007
New Revision: 551832

URL: http://svn.apache.org/viewvc?view=rev&rev=551832
Log:
check if type already exists in the current helper context before attempting to create it

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

Modified: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/SequenceAddTypedTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/SequenceAddTypedTest.java?view=diff&rev=551832&r1=551831&r2=551832
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/SequenceAddTypedTest.java
(original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/SequenceAddTypedTest.java
Fri Jun 29 02:13:45 2007
@@ -73,52 +73,54 @@
 
       String testURI = URI + testName;
 
-      DataObject testRootType = dataFactory.create( "commonj.sdo", "Type" );
-      testRootType.set( "uri" , testURI);
-      testRootType.set( "name", testName);
-      testRootType.set( "sequenced", true );
-
-      DataObject testProperty = testRootType.createDataObject( "property" );
-      testProperty.set( "name", "testBoolean" );
-      testProperty.set( "type", typeHelper.getType("commonj.sdo", "Boolean" ));
-      testProperty.set( "many", true);
-
-      testProperty = testRootType.createDataObject( "property" );
-      testProperty.set( "name", "testString" );
-      testProperty.set( "type", typeHelper.getType("commonj.sdo", "String" ));
-      testProperty.set( "many", true);
-
-      testProperty = testRootType.createDataObject( "property" );
-      testProperty.set( "name", "testCharacter" );
-      testProperty.set( "type", typeHelper.getType("commonj.sdo", "Character" ));
-      testProperty.set( "many", true);
-
-      testProperty = testRootType.createDataObject( "property" );
-      testProperty.set( "name", "testDate" );
-      testProperty.set( "type", typeHelper.getType("commonj.sdo", "Date" ));
-      testProperty.set( "many", true);
-
-      testProperty = testRootType.createDataObject( "property" );
-      testProperty.set( "name", "testDateTime" );
-      testProperty.set( "type", typeHelper.getType("commonj.sdo", "DateTime" ));
-      testProperty.set( "many", true);
-
-      testProperty = testRootType.createDataObject( "property" );
-      testProperty.set( "name", "testDay" );
-      testProperty.set( "type", typeHelper.getType("commonj.sdo", "Day" ));
-      testProperty.set( "many", true);
-
-      testProperty = testRootType.createDataObject( "property" );
-      testProperty.set( "name", "testDecimal" );
-      testProperty.set( "type", typeHelper.getType("commonj.sdo", "Decimal" ));
-      testProperty.set( "many", true);
-
-      testProperty = testRootType.createDataObject( "property" );
-      testProperty.set( "name", "testDouble" );
-      testProperty.set( "type", typeHelper.getType("commonj.sdo", "Double" ));
-      testProperty.set( "many", true);
+      if (typeHelper.getType(testURI, testName) == null) {
+          DataObject testRootType = dataFactory.create( "commonj.sdo", "Type" );
+          testRootType.set( "uri" , testURI);
+          testRootType.set( "name", testName);
+          testRootType.set( "sequenced", true );
+
+          DataObject testProperty = testRootType.createDataObject( "property" );
+          testProperty.set( "name", "testBoolean" );
+          testProperty.set( "type", typeHelper.getType("commonj.sdo", "Boolean" ));
+          testProperty.set( "many", true);
+
+          testProperty = testRootType.createDataObject( "property" );
+          testProperty.set( "name", "testString" );
+          testProperty.set( "type", typeHelper.getType("commonj.sdo", "String" ));
+          testProperty.set( "many", true);
+
+          testProperty = testRootType.createDataObject( "property" );
+          testProperty.set( "name", "testCharacter" );
+          testProperty.set( "type", typeHelper.getType("commonj.sdo", "Character" ));
+          testProperty.set( "many", true);
+
+          testProperty = testRootType.createDataObject( "property" );
+          testProperty.set( "name", "testDate" );
+          testProperty.set( "type", typeHelper.getType("commonj.sdo", "Date" ));
+          testProperty.set( "many", true);
+
+          testProperty = testRootType.createDataObject( "property" );
+          testProperty.set( "name", "testDateTime" );
+          testProperty.set( "type", typeHelper.getType("commonj.sdo", "DateTime" ));
+          testProperty.set( "many", true);
+
+          testProperty = testRootType.createDataObject( "property" );
+          testProperty.set( "name", "testDay" );
+          testProperty.set( "type", typeHelper.getType("commonj.sdo", "Day" ));
+          testProperty.set( "many", true);
+
+          testProperty = testRootType.createDataObject( "property" );
+          testProperty.set( "name", "testDecimal" );
+          testProperty.set( "type", typeHelper.getType("commonj.sdo", "Decimal" ));
+          testProperty.set( "many", true);
+
+          testProperty = testRootType.createDataObject( "property" );
+          testProperty.set( "name", "testDouble" );
+          testProperty.set( "type", typeHelper.getType("commonj.sdo", "Double" ));
+          testProperty.set( "many", true);
 
-      typeHelper.define( testRootType );
+          typeHelper.define( testRootType );
+      }
       testDataObject = dataFactory.create( testURI, testName );
     }
 



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