Skip to content

Commit

Permalink
wip test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmetmircik committed Jun 9, 2021
1 parent d5d0df8 commit 5988a9f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.hazelcast.config.security.KerberosIdentityConfig;
import com.hazelcast.config.security.LdapAuthenticationConfig;
import com.hazelcast.config.security.RealmConfig;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.instance.EndpointQualifier;
import com.hazelcast.internal.nio.IOUtil;
import com.hazelcast.splitbrainprotection.SplitBrainProtectionOn;
Expand Down Expand Up @@ -1377,17 +1376,13 @@ public void testMapWanReplicationRef() {
+ " " + mapName + ":\n"
+ " wan-replication-ref:\n"
+ " test:\n"
+ " merge-policy-class-name: LatestUpdateMergePolicy\n"
+ " merge-policy-class-name: TestMergePolicy\n"
+ " filters:\n"
+ " - com.example.SampleFilter\n";

Config config = buildConfig(yaml);
MapConfig mapConfig = config.getMapConfig(mapName);
WanReplicationRef wanRef = mapConfig.getWanReplicationRef();
mapConfig.setPerEntryStatsEnabled(false);


HazelcastInstance hazelcastInstance = createHazelcastInstance(config);

assertEquals(refName, wanRef.getName());
assertEquals(mergePolicy, wanRef.getMergePolicyClassName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
@Category({QuickTest.class, ParallelJVMTest.class})
public class MergePolicyValidatorMapIntegrationTest extends AbstractMergePolicyValidatorIntegrationTest {

private boolean perEntryStatsEnabled = false;
private boolean perEntryStatsEnabled = true;

@Override
void addConfig(Config config, String name, MergePolicyConfig mergePolicyConfig) {
Expand All @@ -60,9 +60,9 @@ public void testMap_withPutIfAbsentMergePolicy() {

@Test
public void testMap_withHyperLogLogMergePolicy() {
expectCardinalityEstimatorException();
HazelcastInstance hz = getHazelcastInstance("cardinalityEstimator", hyperLogLogMergePolicy);

expectCardinalityEstimatorException();
hz.getMap("cardinalityEstimator");
}

Expand All @@ -76,9 +76,9 @@ public void testMap_withHigherHitsMergePolicy() {

@Test
public void testMap_withInvalidMergePolicy() {
expectedInvalidMergePolicyException();
HazelcastInstance hz = getHazelcastInstance("invalid", invalidMergePolicyConfig);

expectedInvalidMergePolicyException();
hz.getMap("invalid");
}

Expand All @@ -105,9 +105,11 @@ public void testMap_withExpirationTimeMergePolicy_withStatsEnabled() {
*/
@Test
public void testMap_withLastStoredTimeMergePolicy() {
perEntryStatsEnabled = false;
expectedMapStatisticsDisabledException(lastStoredTimeMergePolicy);

HazelcastInstance hz = getHazelcastInstance("lastStoredTime", lastStoredTimeMergePolicy);

expectedMapStatisticsDisabledException(lastStoredTimeMergePolicy);
hz.getMap("lastStoredTime");
}

Expand All @@ -124,9 +126,11 @@ public void testMap_withLastStoredMergePolicy_withStatsEnabled() {
*/
@Test
public void testMap_withLastStoredTimeMergePolicyNoTypeVariable() {
perEntryStatsEnabled = false;
expectedMapStatisticsDisabledException(lastStoredTimeMergePolicyNoTypeVariable);

HazelcastInstance hz = getHazelcastInstance("lastStoredTimeNoTypeVariable", lastStoredTimeMergePolicyNoTypeVariable);

expectedMapStatisticsDisabledException(lastStoredTimeMergePolicyNoTypeVariable);
hz.getMap("lastStoredTimeNoTypeVariable");
}

Expand Down Expand Up @@ -163,9 +167,10 @@ public void testMap_withComplexCustomMergePolicy_withStatsEnabled() {
*/
@Test
public void testMap_withCustomMapMergePolicy() {
perEntryStatsEnabled = false;
expectedMapStatisticsDisabledException(customMapMergePolicy);
HazelcastInstance hz = getHazelcastInstance("customMap", customMapMergePolicy);

expectedMapStatisticsDisabledException(customMapMergePolicy);
hz.getMap("customMap");
}

Expand All @@ -183,9 +188,11 @@ public void testMap_withCustomMapMergePolicy_withStatsEnabled() {
*/
@Test
public void testMap_withCustomMapMergePolicyNoTypeVariable() {
perEntryStatsEnabled = false;
expectedMapStatisticsDisabledException(customMapMergePolicyNoTypeVariable);

HazelcastInstance hz = getHazelcastInstance("customMapNoTypeVariable", customMapMergePolicyNoTypeVariable);

expectedMapStatisticsDisabledException(customMapMergePolicyNoTypeVariable);
hz.getMap("customMapNoTypeVariable");
}

Expand Down

0 comments on commit 5988a9f

Please sign in to comment.