diff options
Diffstat (limited to '')
5 files changed, 26 insertions, 19 deletions
diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldReferenceImpl.java b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldReferenceImpl.java index 4233f42b73..732b49ea6c 100644 --- a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldReferenceImpl.java +++ b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldReferenceImpl.java @@ -18,7 +18,6 @@ */ package org.apache.tuscany.sca.binding.jms.format.jmstextxmlinjmsobjectout.helloworld; -import org.apache.tuscany.sca.binding.jms.format.jmstextxml.helloworld.Person; import org.osoa.sca.annotations.Reference; @@ -31,11 +30,9 @@ public class HelloWorldReferenceImpl implements HelloWorldService { return helloWorldService1.getGreetings(name).toString(); } - /* public String getPersonGreetings(Person person){ - return null; - } - */ + return helloWorldService1.getPersonGreetings(person).toString(); + } } diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldService.java b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldService.java index e860c0594d..65323a3d63 100644 --- a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldService.java +++ b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldService.java @@ -28,6 +28,6 @@ public interface HelloWorldService { public String getGreetings(String name); - //public String getPersonGreetings(Person person); + public String getPersonGreetings(Person person); } diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldServiceImpl.java b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldServiceImpl.java index b8b27287bb..2f2c53b41d 100644 --- a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldServiceImpl.java +++ b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldServiceImpl.java @@ -26,12 +26,10 @@ public class HelloWorldServiceImpl implements HelloWorldService { return response; } - /* public String getPersonGreetings(Person person){ String response = "Hello " + person.getFirstName() + " " + person.getLastName(); System.out.println("getPersonGreetings: " + response); return response; } - */ } diff --git a/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextXMLInJMSObjectOutTestCase.java b/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextXMLInJMSObjectOutTestCase.java index b30d579c49..5d3b0ac9e3 100644 --- a/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextXMLInJMSObjectOutTestCase.java +++ b/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextXMLInJMSObjectOutTestCase.java @@ -57,7 +57,7 @@ public class FormatJMSTextXMLInJMSObjectOutTestCase { Person person = new Person(); person.setFirstName("Fred"); person.setLastName("Bloggs"); - //assertEquals("Hello Fred Bloggs Hello Fred Bloggs Hello Fred Bloggs", helloWorldService.getPersonGreetings(person)); + assertEquals("Hello Fred Bloggs", helloWorldService.getPersonGreetings(person)); } @After diff --git a/branches/sca-java-1.x/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java b/branches/sca-java-1.x/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java index 23f1eec8cf..38ae3f11d4 100644 --- a/branches/sca-java-1.x/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java +++ b/branches/sca-java-1.x/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java @@ -189,13 +189,19 @@ public class InterfaceImpl implements Interface { public void resetInterfaceInputTypes(Interface newInterface){ for (int i = 0; i < getOperations().size(); i++) { - // TODO - same operation order is assumed. How to really - // find the right operation when we know that the - // data types will be different + // only remote interfaces only have a data type model defined + // and in this case operations cannot be overloaded so match + // operations by name Operation oldOperation = getOperations().get(i); - Operation newOperation = newInterface.getOperations().get(i); + Operation newOperation = null; - if (!oldOperation.getName().equals(newOperation.getName())){ + for (Operation tmpOperation : newInterface.getOperations()){ + if (tmpOperation.getName().equals(oldOperation.getName())){ + newOperation = tmpOperation; + } + } + + if (newOperation == null){ break; } @@ -212,13 +218,19 @@ public class InterfaceImpl implements Interface { public void resetInterfaceOutputTypes(Interface newInterface){ for (int i = 0; i < getOperations().size(); i++) { - // TODO - same operation order is assumed. How to really - // find the right operation when we know that the - // data types will be different + // only remote interfaces only have a data type model defined + // and in this case operations cannot be overloaded so match + // operations by name Operation oldOperation = getOperations().get(i); - Operation newOperation = newInterface.getOperations().get(i); + Operation newOperation = null; + + for (Operation tmpOperation : newInterface.getOperations()){ + if (tmpOperation.getName().equals(oldOperation.getName())){ + newOperation = tmpOperation; + } + } - if (!oldOperation.getName().equals(newOperation.getName())){ + if (newOperation == null){ break; } |