summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/itest/nodes/one-jvm-hazelcast-client/src
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-01-28 11:59:54 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-01-28 11:59:54 +0000
commit8a8048b6926cb55be2a052d62664ad6045fb8a96 (patch)
tree798cedc4001d1231112c93f828584e36196fdac1 /sca-java-2.x/trunk/itest/nodes/one-jvm-hazelcast-client/src
parent4e77ed5f2c2f83477fcaf127ed2303ea530df25f (diff)
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
Diffstat (limited to 'sca-java-2.x/trunk/itest/nodes/one-jvm-hazelcast-client/src')
-rw-r--r--sca-java-2.x/trunk/itest/nodes/one-jvm-hazelcast-client/src/test/java/itest/ClientTestCase.java27
1 files changed, 24 insertions, 3 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 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<Object, Object> 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) {