Author: nzamosenchuk
Date: 2012-02-09 07:59:53 -0500 (Thu, 09 Feb 2012)
New Revision: 5593
Modified:
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/lab/infinispan/TestISPNCache.java
Log:
EXOJCR-1682 : one more test added.
Modified:
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/lab/infinispan/TestISPNCache.java
===================================================================
---
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/lab/infinispan/TestISPNCache.java 2012-02-09
11:02:51 UTC (rev 5592)
+++
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/lab/infinispan/TestISPNCache.java 2012-02-09
12:59:53 UTC (rev 5593)
@@ -27,6 +27,8 @@
import org.infinispan.configuration.global.GlobalConfigurationBuilder;
import org.infinispan.manager.DefaultCacheManager;
import org.infinispan.manager.EmbeddedCacheManager;
+import org.infinispan.remoting.transport.jgroups.JGroupsAddress;
+import org.infinispan.remoting.transport.jgroups.JGroupsTransport;
import java.util.concurrent.TimeUnit;
@@ -76,7 +78,7 @@
assertTrue(cache.size() == 1);
assertTrue(cache.containsKey("key"));
- String value = (String)cache.remove("key");
+ String value = cache.remove("key");
assertTrue(value.equals("value"));
assertTrue(cache.isEmpty());
@@ -92,7 +94,27 @@
Thread.sleep(2000 + 500);
assertFalse(cache.containsKey("key"));
}
+
+ /**
+ * Infinispan-based RSync concept relies on some JGroups and ISPN interns, used to
identify physical address
+ * of coodrinator node. This test used to identify any changed in those libraries to
be able quickly update
+ * RSync components.
+ *
+ * @throws Exception
+ */
+ public void testJGroupTransportPhysicalAddress() throws Exception
+ {
+ GlobalConfiguration myGlobalConfig = new
GlobalConfigurationBuilder().clusteredDefault().build();
+ // Create cache manager
+ EmbeddedCacheManager manager = new DefaultCacheManager(myGlobalConfig);
+ // Create a cache
+ Cache<String, String> cache = manager.getCache();
+
+ assertTrue(manager.getCoordinator() instanceof JGroupsAddress);
+ assertTrue(manager.getTransport() instanceof JGroupsTransport);
+ }
+
/**
* Test cluster cache and base operation.
*
@@ -111,7 +133,7 @@
assertTrue(cache.size() == 1);
assertTrue(cache.containsKey("key"));
- String value = (String)cache.remove("key");
+ String value = cache.remove("key");
assertTrue(value.equals("value"));
assertTrue(cache.isEmpty());
Show replies by date