summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-09-17 20:12:07 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-09-17 20:12:07 +0000
commit12d905c8cd8cf3d1e64595ef9a0f42e8e988f61e (patch)
treea196f836185b3196d7eaaf60d5f7c77d47f22a24
parent16b8b195e6e48294b7d651aba6fa9f47c9d277aa (diff)
Fix for TUSCANY-3273
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@816364 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--branches/sca-java-1.5.1/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java16
-rw-r--r--branches/sca-java-1.5.1/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java6
-rw-r--r--branches/sca-java-1.5.1/samples/quote-xquery/src/main/resources/xqueryquotewsclient.composite7
-rw-r--r--branches/sca-java-1.5.1/samples/quote-xquery/src/test/java/xquery/quote/XQueryQuoteClientTestCase.java2
4 files changed, 21 insertions, 10 deletions
diff --git a/branches/sca-java-1.5.1/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java b/branches/sca-java-1.5.1/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java
index 695722be18..ada0c94a8d 100644
--- a/branches/sca-java-1.5.1/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java
+++ b/branches/sca-java-1.5.1/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java
@@ -138,16 +138,26 @@ public final class SDOContextHelper {
}
try {
Type type = helperContext.getTypeHelper().getType(javaType);
- if (type != null && (!type.isDataType())) {
+ return register(helperContext, type);
+ } catch (Exception e) {
+ throw new TransformationException(e);
+ }
+ }
+
+ public static boolean register(HelperContext helperContext, Type type) {
+ if (type != null && (!type.isDataType())) {
+ try {
Method method = type.getClass().getMethod("getEPackage");
Object factory = method.invoke(type, new Object[] {});
method = factory.getClass().getMethod("register", HelperContext.class);
method.invoke(factory, new Object[] {helperContext});
return true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ return false;
}
+ } else {
return false;
- } catch (Exception e) {
- throw new TransformationException(e);
}
}
diff --git a/branches/sca-java-1.5.1/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java b/branches/sca-java-1.5.1/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java
index 0b58be9e41..39e9ffc161 100644
--- a/branches/sca-java-1.5.1/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java
+++ b/branches/sca-java-1.5.1/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java
@@ -69,7 +69,7 @@ public class SDODataBinding extends BaseDataBinding {
}
});
- Type type = context.getTypeHelper().getType(javaType);
+ final Type type = context.getTypeHelper().getType(javaType);
if (type == null) {
// FIXME: Need a better to test dynamic SDO
if (DataObject.class.isAssignableFrom(javaType)) {
@@ -92,10 +92,12 @@ public class SDODataBinding extends BaseDataBinding {
public Object run() {
if (context == SDOContextHelper.getDefaultHelperContext()) {
HelperContext newContext = SDOUtil.createHelperContext();
- SDOContextHelper.register(newContext, javaType);
+ SDOContextHelper.register(newContext, type);
if (operation != null) {
operation.getInputType().setMetaData(HelperContext.class, newContext);
}
+ } else {
+ SDOContextHelper.register(context, type);
}
return null;
}
diff --git a/branches/sca-java-1.5.1/samples/quote-xquery/src/main/resources/xqueryquotewsclient.composite b/branches/sca-java-1.5.1/samples/quote-xquery/src/main/resources/xqueryquotewsclient.composite
index 35306b9f89..c9887c8c19 100644
--- a/branches/sca-java-1.5.1/samples/quote-xquery/src/main/resources/xqueryquotewsclient.composite
+++ b/branches/sca-java-1.5.1/samples/quote-xquery/src/main/resources/xqueryquotewsclient.composite
@@ -18,7 +18,9 @@
* under the License.
-->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://quote.xquery/client"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0" xmlns:xq="http://quote.xquery/client"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ xmlns:dbsdo="http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0"
+ xmlns:xq="http://quote.xquery/client"
name="xqueryquotewsclient">
<component name="QuoteJoinLocalComponent">
@@ -101,9 +103,8 @@
</component>
<reference name="availQuoteProvider" promote="QuoteJoinExternalReferencesComponent/availQuoteProvider">
- <!-- removed because it doesn't work with TUSCANY-2324 fix
+ <!-- removed because it doesn't work with TUSCANY-2324 fix -->
<interface.java interface="xquery.quote.AvailQuoteProviderService" />
- -->
<binding.ws wsdlElement="http://quote.xquery#wsdl.port(AvailQuoteProviderService/AvailQuoteProviderSoapPort)" />
</reference>
<reference name="quoteJoinWs" promote="QuoteJoinLocalComponent/quoteJoinWs">
diff --git a/branches/sca-java-1.5.1/samples/quote-xquery/src/test/java/xquery/quote/XQueryQuoteClientTestCase.java b/branches/sca-java-1.5.1/samples/quote-xquery/src/test/java/xquery/quote/XQueryQuoteClientTestCase.java
index a7224b0efa..9555532b3e 100644
--- a/branches/sca-java-1.5.1/samples/quote-xquery/src/test/java/xquery/quote/XQueryQuoteClientTestCase.java
+++ b/branches/sca-java-1.5.1/samples/quote-xquery/src/test/java/xquery/quote/XQueryQuoteClientTestCase.java
@@ -33,7 +33,6 @@ import org.example.quote.Quote;
import org.example.quote.QuoteResponse;
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import commonj.sdo.DataObject;
@@ -63,7 +62,6 @@ import commonj.sdo.DataObject;
* total price
* 4. SDO is used for data interchange
*/
-@Ignore("Broken, see TUSCANY-2943")
public class XQueryQuoteClientTestCase {
public static boolean SHOW_DEBUG_MSG = false;