From 8a8048b6926cb55be2a052d62664ad6045fb8a96 Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 28 Jan 2010 11:59:54 +0000 Subject: Update client test to use generic local host ip address and add tests for bad passowrd and connect address git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@904048 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/test/java/itest/ClientTestCase.java | 27 +++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'sca-java-2.x/trunk/itest/nodes/one-jvm-hazelcast-client/src') 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 aa29335f9b..630e9bfddd 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,6 +19,7 @@ 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; @@ -40,7 +41,7 @@ import com.hazelcast.core.IMap; */ public class ClientTestCase{ - private static URI domainURI = URI.create("tuscany:OneNodeTestCase"); + private static URI domainURI = URI.create("tuscany:OneNodeTestCase?listen=127.0.0.1:14820"); private static Node node; private static HazelcastInstance client; @@ -52,8 +53,8 @@ public class ClientTestCase{ @Test public void testNode() throws Exception { - - client = HazelcastClient.newHazelcastClient("OneNodeTestCase", "tuscany", "192.168.1.73:14820"); + + client = HazelcastClient.newHazelcastClient("OneNodeTestCase", "tuscany", "127.0.0.1:14820"); IMap map = client.getMap("OneNodeTestCase/Endpoints"); assertNotNull(map); @@ -66,6 +67,26 @@ public class ClientTestCase{ assertNotNull(ep2); } + @Test + public void testBadPassword() throws Exception { + try { + client = HazelcastClient.newHazelcastClient("OneNodeTestCase", "IncorrectPassword", "127.0.0.1:14820"); + fail(); + } catch (Exception e) { + //expected + } + } + + @Test + public void testBadIP() throws Exception { + try { + client = HazelcastClient.newHazelcastClient("OneNodeTestCase", "IncorrectPassword", "127.0.0.99:9999"); + fail(); + } catch (Exception e) { + //expected + } + } + @AfterClass public static void tearDownAfterClass() throws Exception { if (client != null) { -- cgit v1.2.3