コード例 #1
0
 @Test
 public void testWanReplicationConfig() {
   WanReplicationConfig wcfg = config.getWanReplicationConfig("testWan");
   assertNotNull(wcfg);
   assertFalse(wcfg.isSnapshotEnabled());
   assertEquals(2, wcfg.getTargetClusterConfigs().size());
   WanTargetClusterConfig targetCfg = wcfg.getTargetClusterConfigs().get(0);
   assertNotNull(targetCfg);
   assertEquals("tokyo", targetCfg.getGroupName());
   assertEquals("tokyo-pass", targetCfg.getGroupPassword());
   assertEquals("com.hazelcast.wan.impl.WanNoDelayReplication", targetCfg.getReplicationImpl());
   assertEquals(2, targetCfg.getEndpoints().size());
   assertEquals("10.2.1.1:5701", targetCfg.getEndpoints().get(0));
   assertEquals("10.2.1.2:5701", targetCfg.getEndpoints().get(1));
   assertEquals(wanReplication, wcfg.getTargetClusterConfigs().get(1).getReplicationImplObject());
   WanTargetClusterConfig targetClusterConfig0 = wcfg.getTargetClusterConfigs().get(0);
   WanTargetClusterConfig targetClusterConfig1 = wcfg.getTargetClusterConfigs().get(1);
   assertEquals(
       WanAcknowledgeType.ACK_ON_OPERATION_COMPLETE, targetClusterConfig0.getAcknowledgeType());
   assertEquals(WanAcknowledgeType.ACK_ON_RECEIPT, targetClusterConfig1.getAcknowledgeType());
   assertEquals(WANQueueFullBehavior.THROW_EXCEPTION, targetClusterConfig0.getQueueFullBehavior());
   assertEquals(7, targetClusterConfig0.getBatchSize());
   assertEquals(14, targetClusterConfig0.getBatchMaxDelayMillis());
   assertEquals(21, targetClusterConfig0.getQueueCapacity());
   assertEquals(28, targetClusterConfig0.getResponseTimeoutMillis());
 }
コード例 #2
0
 @Test
 public void testWanReplicationConfig() {
   WanReplicationConfig wcfg = config.getWanReplicationConfig("testWan");
   assertNotNull(wcfg);
   assertFalse(wcfg.isSnapshotEnabled());
   assertEquals(2, wcfg.getTargetClusterConfigs().size());
   WanTargetClusterConfig targetCfg = wcfg.getTargetClusterConfigs().get(0);
   assertNotNull(targetCfg);
   assertEquals("tokyo", targetCfg.getGroupName());
   assertEquals("tokyo-pass", targetCfg.getGroupPassword());
   assertEquals("com.hazelcast.wan.impl.WanNoDelayReplication", targetCfg.getReplicationImpl());
   assertEquals(2, targetCfg.getEndpoints().size());
   assertEquals("10.2.1.1:5701", targetCfg.getEndpoints().get(0));
   assertEquals("10.2.1.2:5701", targetCfg.getEndpoints().get(1));
   assertEquals(wanReplication, wcfg.getTargetClusterConfigs().get(1).getReplicationImplObject());
 }