You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by cs...@apache.org on 2017/11/23 08:39:14 UTC

aries-rsa git commit: Separate callSlow and callException

Repository: aries-rsa
Updated Branches:
  refs/heads/master 1c5922ce7 -> a8a6a057d


Separate callSlow and callException


Project: http://git-wip-us.apache.org/repos/asf/aries-rsa/repo
Commit: http://git-wip-us.apache.org/repos/asf/aries-rsa/commit/a8a6a057
Tree: http://git-wip-us.apache.org/repos/asf/aries-rsa/tree/a8a6a057
Diff: http://git-wip-us.apache.org/repos/asf/aries-rsa/diff/a8a6a057

Branch: refs/heads/master
Commit: a8a6a057d433f0753b1f213048492cb62b969e88
Parents: 1c5922c
Author: Christian Schneider <cs...@adobe.com>
Authored: Thu Nov 23 09:39:09 2017 +0100
Committer: Christian Schneider <cs...@adobe.com>
Committed: Thu Nov 23 09:39:09 2017 +0100

----------------------------------------------------------------------
 .../aries/rsa/provider/tcp/TcpProviderTest.java |  4 ++--
 .../rsa/provider/tcp/myservice/MyService.java   |  4 +++-
 .../provider/tcp/myservice/MyServiceImpl.java   | 20 ++++++++++----------
 3 files changed, 15 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/a8a6a057/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpProviderTest.java
----------------------------------------------------------------------
diff --git a/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpProviderTest.java b/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpProviderTest.java
index fab0129..2160588 100644
--- a/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpProviderTest.java
+++ b/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpProviderTest.java
@@ -73,7 +73,7 @@ public class TcpProviderTest {
     @Test
     public void testCallTimeout() {
         try {
-            myServiceProxy.call("slow");
+            myServiceProxy.callSlow();
             Assert.fail("Expecting timeout");
         } catch (RuntimeException e) {
             Assert.assertEquals(SocketTimeoutException.class, e.getCause().getClass());
@@ -90,7 +90,7 @@ public class TcpProviderTest {
     
     @Test(expected=IllegalArgumentException.class)
     public void testCallException() {
-        myServiceProxy.call("throw exception");
+        myServiceProxy.callException();
     }
     
     @Test

http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/a8a6a057/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/myservice/MyService.java
----------------------------------------------------------------------
diff --git a/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/myservice/MyService.java b/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/myservice/MyService.java
index da3b10c..cfeb32b 100644
--- a/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/myservice/MyService.java
+++ b/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/myservice/MyService.java
@@ -26,7 +26,9 @@ import javax.jws.Oneway;
 public interface MyService {
     String echo(String msg);
 
-    void call(String msg);
+    void callSlow();
+    
+    void callException();
 
     // Oneway not yet supported
     @Oneway

http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/a8a6a057/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/myservice/MyServiceImpl.java
----------------------------------------------------------------------
diff --git a/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/myservice/MyServiceImpl.java b/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/myservice/MyServiceImpl.java
index 0e4d88a..1a5a48c 100644
--- a/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/myservice/MyServiceImpl.java
+++ b/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/myservice/MyServiceImpl.java
@@ -32,16 +32,16 @@ public class MyServiceImpl implements MyService {
     }
 
     @Override
-    public void call(String msg) {
-        if ("throw exception".equals(msg)) {
-            throw new IllegalArgumentException("Throwing expected exception");
-        }
-        if ("slow".equals(msg)) {
-            try {
-                Thread.sleep(300);
-            } catch (InterruptedException e) {
-            }
-        }
+    public void callSlow() {
+        try {
+            Thread.sleep(300);
+        } catch (InterruptedException e) {
+        } 
+    }
+
+    @Override
+    public void callException() {
+        throw new IllegalArgumentException("Throwing expected exception");
     }
 
     @Override