Search in sources :

Example 1 with CPSubsystemConfigChecker

use of com.hazelcast.config.ConfigCompatibilityChecker.CPSubsystemConfigChecker in project hazelcast by hazelcast.

the class ConfigXmlGeneratorTest method testCPSubsystemConfig.

@Test
public void testCPSubsystemConfig() {
    Config config = new Config();
    config.getCPSubsystemConfig().setCPMemberCount(10).setGroupSize(5).setSessionTimeToLiveSeconds(15).setSessionHeartbeatIntervalSeconds(3).setMissingCPMemberAutoRemovalSeconds(120).setFailOnIndeterminateOperationState(true).setPersistenceEnabled(true).setBaseDir(new File("/custom-dir"));
    config.getCPSubsystemConfig().getRaftAlgorithmConfig().setLeaderElectionTimeoutInMillis(500).setLeaderHeartbeatPeriodInMillis(100).setMaxMissedLeaderHeartbeatCount(10).setAppendRequestMaxEntryCount(25).setAppendRequestMaxEntryCount(250).setUncommittedEntryCountToRejectNewAppends(75).setAppendRequestBackoffTimeoutInMillis(50);
    config.getCPSubsystemConfig().addSemaphoreConfig(new SemaphoreConfig("sem1", true, 1)).addSemaphoreConfig(new SemaphoreConfig("sem2", false, 2));
    config.getCPSubsystemConfig().addLockConfig(new FencedLockConfig("lock1", 1)).addLockConfig(new FencedLockConfig("lock1", 2));
    CPSubsystemConfig generatedConfig = getNewConfigViaXMLGenerator(config).getCPSubsystemConfig();
    assertTrue(generatedConfig + " should be compatible with " + config.getCPSubsystemConfig(), new CPSubsystemConfigChecker().check(config.getCPSubsystemConfig(), generatedConfig));
}
Also used : CPSubsystemConfigChecker(com.hazelcast.config.ConfigCompatibilityChecker.CPSubsystemConfigChecker) FencedLockConfig(com.hazelcast.config.cp.FencedLockConfig) TlsAuthenticationConfig(com.hazelcast.config.security.TlsAuthenticationConfig) TokenIdentityConfig(com.hazelcast.config.security.TokenIdentityConfig) LdapAuthenticationConfig(com.hazelcast.config.security.LdapAuthenticationConfig) SemaphoreConfig(com.hazelcast.config.cp.SemaphoreConfig) CPSubsystemConfig(com.hazelcast.config.cp.CPSubsystemConfig) SimpleAuthenticationConfig(com.hazelcast.config.security.SimpleAuthenticationConfig) KerberosIdentityConfig(com.hazelcast.config.security.KerberosIdentityConfig) KerberosAuthenticationConfig(com.hazelcast.config.security.KerberosAuthenticationConfig) RealmConfig(com.hazelcast.config.security.RealmConfig) JaasAuthenticationConfig(com.hazelcast.config.security.JaasAuthenticationConfig) JetConfig(com.hazelcast.jet.config.JetConfig) FencedLockConfig(com.hazelcast.config.cp.FencedLockConfig) SemaphoreConfig(com.hazelcast.config.cp.SemaphoreConfig) File(java.io.File) CPSubsystemConfig(com.hazelcast.config.cp.CPSubsystemConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

CPSubsystemConfigChecker (com.hazelcast.config.ConfigCompatibilityChecker.CPSubsystemConfigChecker)1 CPSubsystemConfig (com.hazelcast.config.cp.CPSubsystemConfig)1 FencedLockConfig (com.hazelcast.config.cp.FencedLockConfig)1 SemaphoreConfig (com.hazelcast.config.cp.SemaphoreConfig)1 JaasAuthenticationConfig (com.hazelcast.config.security.JaasAuthenticationConfig)1 KerberosAuthenticationConfig (com.hazelcast.config.security.KerberosAuthenticationConfig)1 KerberosIdentityConfig (com.hazelcast.config.security.KerberosIdentityConfig)1 LdapAuthenticationConfig (com.hazelcast.config.security.LdapAuthenticationConfig)1 RealmConfig (com.hazelcast.config.security.RealmConfig)1 SimpleAuthenticationConfig (com.hazelcast.config.security.SimpleAuthenticationConfig)1 TlsAuthenticationConfig (com.hazelcast.config.security.TlsAuthenticationConfig)1 TokenIdentityConfig (com.hazelcast.config.security.TokenIdentityConfig)1 JetConfig (com.hazelcast.jet.config.JetConfig)1 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 File (java.io.File)1 Test (org.junit.Test)1