tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agr...@apache.org
Subject svn commit: r551078 - /incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/SequenceAddOpenTest.java
Date Wed, 27 Jun 2007 06:53:30 GMT
Author: agrove
Date: Tue Jun 26 23:53:29 2007
New Revision: 551078

URL: http://svn.apache.org/viewvc?view=rev&rev=551078
Log:
updated SequenceAddOpenTest to check if type already exists before attempting to create it

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

Modified: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/SequenceAddOpenTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/SequenceAddOpenTest.java?view=diff&rev=551078&r1=551077&r2=551078
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/SequenceAddOpenTest.java
(original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/api/SequenceAddOpenTest.java
Tue Jun 26 23:53:29 2007
@@ -55,13 +55,19 @@
         dataFactory = scope.getDataFactory();
         typeHelper = scope.getTypeHelper();
 
-        // define an open type
-        DataObject typeDef = dataFactory.create( "commonj.sdo", "Type" );
-        typeDef.set( "uri", "http://www.example.com/cts/SequenceAddOpenTest" );
-        typeDef.set( "name", "OpenDataObject" );
-        typeDef.set( "open", true );
-        typeDef.set( "sequenced", true );
-        Type openType = typeHelper.define( typeDef );
+        // define an open type if it is not already defined in the HelperContext provided
+        // by the implementation being tested
+        String typeURI = "http://www.example.com/cts/SequenceAddOpenTest";
+        String typeName = "OpenDataObject";
+        Type openType = typeHelper.getType(typeURI, typeName);
+        if (openType == null) {
+          DataObject typeDef = dataFactory.create("commonj.sdo", "Type");
+          typeDef.set("uri", typeURI);
+          typeDef.set("name", typeName);
+          typeDef.set("open", true);
+          typeDef.set("sequenced", true);
+          openType = typeHelper.define(typeDef);
+        }
 
         testOpenDataObject = dataFactory.create( openType );
     }



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