diff options
Diffstat (limited to '')
7 files changed, 51 insertions, 7 deletions
diff --git a/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/MboxInterface.java b/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/MboxInterface.java index 8f950d54f7..034abab8f3 100644 --- a/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/MboxInterface.java +++ b/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/MboxInterface.java @@ -60,6 +60,6 @@ public interface MboxInterface { @ErlangAtom String[][] sendArgs(@ErlangAtom String[][] arg1, int arg2); - void sendArgs(); + void sendArgs() throws Exception; } diff --git a/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ReferenceServiceTestCase.java b/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ReferenceServiceTestCase.java index 0c80df7a04..2073e4b154 100644 --- a/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ReferenceServiceTestCase.java +++ b/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ReferenceServiceTestCase.java @@ -32,7 +32,6 @@ import org.apache.tuscany.sca.host.embedded.SCADomain; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -464,6 +463,30 @@ public class ReferenceServiceTestCase { } /** + * Tests Erlang Atom types on service side + * + * @throws Exception + */ + @Test(timeout = 1000) + public void testServiceAtoms() throws Exception { + String[] args = { "Say", "Atoms" }; + OtpErlangObject[] toList = new OtpErlangObject[2]; + toList[0] = new OtpErlangString(args[0]); + toList[1] = new OtpErlangString(args[1]); + OtpErlangList list = new OtpErlangList(toList); + OtpErlangObject[] toTuple = new OtpErlangObject[2]; + toTuple[0] = refMbox.self(); + toTuple[1] = list; + refMbox.send("sayAtoms", "RPCServerMbox", new OtpErlangTuple(toTuple)); + OtpErlangObject result = refMbox.receiveMsg().getMsg(); + assertEquals(args.length, ((OtpErlangList) result).arity()); + for (int i = 0; i < args.length; i++) { + assertEquals(args[i], ((OtpErlangAtom) ((OtpErlangList) result) + .elementAt(i)).atomValue()); + } + } + + /** * Tests mismatched interface * * @throws Exception @@ -886,12 +909,16 @@ public class ReferenceServiceTestCase { cookieModuleReference.sayHellos(); } + /** + * Tests fix which allow to send message with no user specified content (in + * fact always will be some content - senders PID at the content beginning). + * + * @throws Exception + */ @Test(timeout = 1000) - @Ignore("Nothing to test yet") public void testMboxNoArgs() throws Exception { - // FIXME: decide what to do while invoking mbox reference with no params - // exception? log? mboxReference.sendArgs(); + // no exception should occur } } diff --git a/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceInterface.java b/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceInterface.java index 76ff3fdbe0..244e6f7f40 100644 --- a/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceInterface.java +++ b/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceInterface.java @@ -41,5 +41,5 @@ public interface ServiceInterface { void notExistWithException() throws Exception; void notExist(); - + } diff --git a/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceTestComponent.java b/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceTestComponent.java index 60650188bc..7cc1fe4dc1 100644 --- a/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceTestComponent.java +++ b/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceTestComponent.java @@ -19,6 +19,8 @@ package org.apache.tuscany.sca.binding.erlang.testing; +import org.apache.tuscany.sca.binding.erlang.meta.ErlangAtom; + /** * @version $Rev$ $Date$ */ @@ -28,6 +30,9 @@ public interface ServiceTestComponent { String[] sayHellos() throws Exception; + @ErlangAtom + String[] sayAtoms(@ErlangAtom String[] arg); + StructuredTuple passComplexArgs(StructuredTuple arg1, String[] arg2); void doNothing(); diff --git a/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceTestComponentImpl.java b/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceTestComponentImpl.java index 551ad3d063..b3f39fecd4 100644 --- a/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceTestComponentImpl.java +++ b/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceTestComponentImpl.java @@ -41,4 +41,8 @@ public class ServiceTestComponentImpl implements ServiceTestComponent { // doing nothing } + public String[] sayAtoms(String[] arg) { + return arg; + } + } diff --git a/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceTestComponentImplClone.java b/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceTestComponentImplClone.java index b59662551c..735cefe53d 100644 --- a/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceTestComponentImplClone.java +++ b/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceTestComponentImplClone.java @@ -41,4 +41,8 @@ public class ServiceTestComponentImplClone implements ServiceTestComponent { } + public String[] sayAtoms(String[] arg) { + return arg; + } + } diff --git a/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceTestComponentImplTimeout.java b/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceTestComponentImplTimeout.java index bcf454837e..40a9f96769 100644 --- a/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceTestComponentImplTimeout.java +++ b/branches/sca-java-1.x/modules/binding-erlang-runtime/src/test/java/org/apache/tuscany/sca/binding/erlang/testing/ServiceTestComponentImplTimeout.java @@ -25,7 +25,7 @@ package org.apache.tuscany.sca.binding.erlang.testing; public class ServiceTestComponentImplTimeout implements ServiceTestComponent { private long duration = 1000; - + public String sayHello(String arg1, String arg2) { try { Thread.sleep(duration); @@ -58,4 +58,8 @@ public class ServiceTestComponentImplTimeout implements ServiceTestComponent { } + public String[] sayAtoms(String[] arg) { + return arg; + } + } |