aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject aries-rsa git commit: Fix tests
Date Fri, 01 Apr 2016 14:16:02 GMT
Repository: aries-rsa
Updated Branches:
  refs/heads/master 5b76fb789 -> e1c85793b


Fix tests


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

Branch: refs/heads/master
Commit: e1c85793b515135e51c2493123f601a00f1a7d10
Parents: 5b76fb7
Author: Christian Schneider <chris@die-schneider.net>
Authored: Fri Apr 1 16:15:56 2016 +0200
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Fri Apr 1 16:15:56 2016 +0200

----------------------------------------------------------------------
 .../aries/rsa/provider/tcp/TcpEndpointTest.java     |  6 ++++--
 .../aries/rsa/provider/tcp/TcpProviderTest.java     | 16 ++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/e1c85793/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpEndpointTest.java
----------------------------------------------------------------------
diff --git a/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpEndpointTest.java
b/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpEndpointTest.java
index cf4c291..61010b3 100644
--- a/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpEndpointTest.java
+++ b/provider/tcp/src/test/java/org/apache/aries/rsa/provider/tcp/TcpEndpointTest.java
@@ -14,17 +14,19 @@ import org.osgi.service.remoteserviceadmin.RemoteConstants;
 
 public class TcpEndpointTest {
 
+    private static final String PORT = "45346";
+
     @Test
     public void testEndpointProperties() throws IOException {
         Object service = new MyServiceImpl();
         Map<String, Object> props = new HashMap<>();
         props.put(Constants.OBJECTCLASS, new String[]{MyService.class.getName()});
         props.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, "");
-        props.put("port", "45346");
+        props.put("port", PORT);
         props.put("hostname", "myhost");
         TcpEndpoint tcpEndpoint = new TcpEndpoint(service, props);
         EndpointDescription epd = tcpEndpoint.description();
-        Assert.assertEquals("tcp://myhost:45346", epd.getId());
+        Assert.assertEquals("tcp://myhost:" + PORT, epd.getId());
         tcpEndpoint.close();
     }
     

http://git-wip-us.apache.org/repos/asf/aries-rsa/blob/e1c85793/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 c83073d..0c8061c 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
@@ -32,20 +32,20 @@ import org.apache.aries.rsa.provider.tcp.myservice.MyServiceImpl;
 import org.apache.aries.rsa.spi.Endpoint;
 import org.apache.aries.rsa.util.EndpointHelper;
 import org.easymock.EasyMock;
-import org.junit.After;
+import org.junit.AfterClass;
 import org.junit.Assert;
-import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
 import org.osgi.framework.BundleContext;
 
 public class TcpProviderTest {
 
     private static final int NUM_CALLS = 100;
-    private MyService myServiceProxy;
-    private Endpoint ep;
+    private static MyService myServiceProxy;
+    private static Endpoint ep;
     
-    @Before
-    public void createServerAndProxy() {
+    @BeforeClass
+    public static void createServerAndProxy() {
         Class<?>[] exportedInterfaces = new Class[] {MyService.class};
         TCPProvider provider = new TCPProvider();
         Map<String, Object> props = new HashMap<String, Object>();
@@ -91,8 +91,8 @@ public class TcpProviderTest {
         myServiceProxy.callWithList(msgList);
     }
     
-    @After
-    public void close() throws IOException {
+    @AfterClass
+    public static void close() throws IOException {
         ep.close();
     }
 


Mime
View raw message