Faster HZ datastore related unit test.

Unit HZ datastore currently starts in client mode, then
fall back to instance mode, when client fails to connect to hazelcast instance.
This patch attempts to minimize the delay (typically around 5s) to fall back to instance mode.

- When only localhost is specified in hazelcast.xml,
  Hazelcast tries to connect to localhost:5701, localhost:5702, localhost:5703 and wait for all of them to fail.
  Explicitly specifying the ports to detect failure faster.
- Added a property to specify hazelcast retry behavior.
  Setting retry count to 0 for unit testing purpose.

Change-Id: I7713e6e78ef53aa0809c29e0e1fe51682d9f1383
diff --git a/src/test/java/net/onrc/onos/core/datastore/AtomicCounterTest.java b/src/test/java/net/onrc/onos/core/datastore/AtomicCounterTest.java
index 9d451dc..439dd53 100644
--- a/src/test/java/net/onrc/onos/core/datastore/AtomicCounterTest.java
+++ b/src/test/java/net/onrc/onos/core/datastore/AtomicCounterTest.java
@@ -26,14 +26,20 @@
 
 public class AtomicCounterTest {
 
+    static {
+        // configuration to quickly fall back to instance mode for faster test run
+        System.setProperty("net.onrc.onos.core.datastore.hazelcast.client.attemptLimit", "0");
+    }
+
     private static final String TEST_COUNTER = "TestCounter";
     private static final byte[] LONG_ZERO = {0, 0, 0, 0, 0, 0, 0, 0}; // 0L
-    private static final IKVTableID counterID = DataStoreClient.getClient().getTable(TEST_COUNTER).getTableId();
+    private IKVTableID counterID;
 
-    @After
     @Before
+    @After
     public void resetCounter() {
         IKVClient client = DataStoreClient.getClient();
+        counterID = client.getTable(TEST_COUNTER).getTableId();
         client.setCounter(counterID, LONG_ZERO, 0L);
         client.destroyCounter(counterID, LONG_ZERO);
     }