summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk
diff options
context:
space:
mode:
Diffstat (limited to '')
-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) {