@Override
 public WanReplicationRef getWanReplicationRef() {
   final WanReplicationRef wanReplicationRef = super.getWanReplicationRef();
   if (wanReplicationRef == null) {
     return null;
   }
   return wanReplicationRef.getAsReadOnly();
 }
 @Test
 public void testMapWanReplicationRef() {
   String mapName = "testMapWanReplicationRef";
   String refName = "test";
   String mergePolicy = "TestMergePolicy";
   String xml =
       HAZELCAST_START_TAG
           + "  <map name=\""
           + mapName
           + "\">\n"
           + "    <wan-replication-ref name=\"test\">\n"
           + "      <merge-policy>TestMergePolicy</merge-policy>\n"
           + "      <filters>\n"
           + "        <filter-impl>com.example.SampleFilter</filter-impl>\n"
           + "      </filters>\n"
           + "    </wan-replication-ref>\n"
           + "  </map>\n"
           + "</hazelcast>";
   final Config config = buildConfig(xml);
   System.out.println("config = " + config);
   WanReplicationRef wanRef = config.getMapConfig(mapName).getWanReplicationRef();
   assertEquals(refName, wanRef.getName());
   assertEquals(mergePolicy, wanRef.getMergePolicy());
   assertTrue(wanRef.isRepublishingEnabled());
   assertEquals(1, wanRef.getFilters().size());
   assertEquals("com.example.SampleFilter", wanRef.getFilters().get(0));
 }
Esempio n. 3
0
 @Test
 public void testMapWanReplicationRef() {
   String mapName = "testMapWanReplicationRef";
   String refName = "test";
   String mergePolicy = "TestMergePolicy";
   String xml =
       "<hazelcast xmlns=\"http://www.hazelcast.com/schema/config\">\n"
           + "  <map name=\""
           + mapName
           + "\">\n"
           + "    <wan-replication-ref name=\"test\">\n"
           + "      <merge-policy>TestMergePolicy</merge-policy>\n"
           + "    </wan-replication-ref>\n"
           + "  </map>\n"
           + "</hazelcast>";
   final Config config = buildConfig(xml);
   System.out.println("config = " + config);
   WanReplicationRef wanRef = config.getMapConfig(mapName).getWanReplicationRef();
   assertEquals(refName, wanRef.getName());
   assertEquals(mergePolicy, wanRef.getMergePolicy());
   assertTrue(wanRef.isRepublishingEnabled());
 }