diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-01-28 12:17:41 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-01-28 12:17:41 +0000 |
commit | 32f41f3e6cc2dcce53e1918ae18d30c59c1083f1 (patch) | |
tree | 13ae0a5625d5872e5c38b1181db253aad8b5cb65 | |
parent | 5690659313cb6c8dd25ed3339430d5cefdd643f9 (diff) |
Change to use a less commonly used port, add a commentted out test on how long a client connection takes
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@904058 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sca-java-2.x/trunk/itest/nodes/one-jvm-hazelcast-client/src/test/java/itest/ClientTestCase.java | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/sca-java-2.x/trunk/itest/nodes/one-jvm-hazelcast-client/src/test/java/itest/ClientTestCase.java b/sca-java-2.x/trunk/itest/nodes/one-jvm-hazelcast-client/src/test/java/itest/ClientTestCase.java index 630e9bfddd..5950a0dec6 100644 --- a/sca-java-2.x/trunk/itest/nodes/one-jvm-hazelcast-client/src/test/java/itest/ClientTestCase.java +++ b/sca-java-2.x/trunk/itest/nodes/one-jvm-hazelcast-client/src/test/java/itest/ClientTestCase.java @@ -19,10 +19,10 @@ package itest;
-import static org.junit.Assert.fail;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import java.net.URI;
@@ -41,7 +41,7 @@ import com.hazelcast.core.IMap; */
public class ClientTestCase{
- private static URI domainURI = URI.create("tuscany:OneNodeTestCase?listen=127.0.0.1:14820");
+ private static URI domainURI = URI.create("tuscany:OneNodeTestCase?listen=127.0.0.1:14829");
private static Node node;
private static HazelcastInstance client;
@@ -54,23 +54,35 @@ public class ClientTestCase{ @Test
public void testNode() throws Exception {
- client = HazelcastClient.newHazelcastClient("OneNodeTestCase", "tuscany", "127.0.0.1:14820");
+ client = HazelcastClient.newHazelcastClient("OneNodeTestCase", "tuscany", "127.0.0.1:14829");
IMap<Object, Object> map = client.getMap("OneNodeTestCase/Endpoints");
assertNotNull(map);
assertEquals(2, map.size());
Object ep1 = map.get("HelloworldService#service-binding(Helloworld/Helloworld)");
- System.out.println((RuntimeEndpointImpl)ep1);
+// System.out.println((RuntimeEndpointImpl)ep1);
assertNotNull(ep1);
assertTrue(ep1 instanceof RuntimeEndpointImpl);
Object ep2 = map.get("HelloworldClient#service-binding(Helloworld/Helloworld)");
assertNotNull(ep2);
}
+ //@Test
+ public void testTime() throws Exception {
+ long start = System.currentTimeMillis();
+ long count = 100;
+ for (int i=0; i<count; i++) {
+ testNode();
+ client.shutdown();
+ }
+ long avg = (System.currentTimeMillis() - start) / count;
+ System.out.println("Average for " + count + " client connects " + avg);
+ }
+
@Test
public void testBadPassword() throws Exception {
try {
- client = HazelcastClient.newHazelcastClient("OneNodeTestCase", "IncorrectPassword", "127.0.0.1:14820");
+ client = HazelcastClient.newHazelcastClient("OneNodeTestCase", "IncorrectPassword", "127.0.0.1:14829");
fail();
} catch (Exception e) {
//expected
|