tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agr...@apache.org
Subject svn commit: r551160 - in /incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/TestData: StandardDynamicFactory.java StandardXSDFactory.java
Date Wed, 27 Jun 2007 13:24:23 GMT
Author: agrove
Date: Wed Jun 27 06:24:22 2007
New Revision: 551160

URL: http://svn.apache.org/viewvc?view=rev&rev=551160
Log:
added code to StandardDynamicFactory and StandardXSDFactory to check if types exist before
attempting to define them

Modified:
    incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/TestData/StandardDynamicFactory.java
    incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/TestData/StandardXSDFactory.java

Modified: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/TestData/StandardDynamicFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/TestData/StandardDynamicFactory.java?view=diff&rev=551160&r1=551159&r2=551160
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/TestData/StandardDynamicFactory.java
(original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/TestData/StandardDynamicFactory.java
Wed Jun 27 06:24:22 2007
@@ -12,6 +12,14 @@
 
   public void defineMetaData(HelperContext hc) {
     TypeHelper types = hc.getTypeHelper();
+      
+    Type t = types.getType(TEST_NAMESPACE, "Abstract");
+    if (t != null) {
+        // the test types have already been defined in this HelperContext (this will happen
when the
+        // implementation being tested does not support multiple contexts, which is not a
2.1 requirement).
+        return;
+    }
+
     Type stringType = types.getType("commonj.sdo", "String");
     Type intType = types.getType("commonj.sdo", "Int");
     Type booleanType = types.getType("commonj.sdo", "Boolean");

Modified: incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/TestData/StandardXSDFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/TestData/StandardXSDFactory.java?view=diff&rev=551160&r1=551159&r2=551160
==============================================================================
--- incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/TestData/StandardXSDFactory.java
(original)
+++ incubator/tuscany/java/cts/sdo2.1/src/main/java/test/sdo21/tests/TestData/StandardXSDFactory.java
Wed Jun 27 06:24:22 2007
@@ -5,6 +5,7 @@
 import java.net.URL;
 
 import commonj.sdo.helper.HelperContext;
+import commonj.sdo.Type;
 
 /**
  * 
@@ -18,6 +19,14 @@
 
   
   public void defineMetaData(HelperContext hc) throws IOException {
+
+    Type t = hc.getTypeHelper().getType(TEST_NAMESPACE, "Abstract");
+    if (t != null) {
+        // the test types have already been defined in this HelperContext (this will happen
when the
+        // implementation being tested does not support multiple contexts, which is not a
2.1 requirement).
+        return;
+    }
+
     // Populate the meta data for the test model (APITest)
     URL url = this.getClass().getResource(TEST_MODEL);
     InputStream inputStream = url.openStream();



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