Search in sources :

Example 11 with Version

use of com.hazelcast.version.Version in project hazelcast by hazelcast.

the class ClusterVersionInitTest method test_clusterVersion_isEventuallySet_whenTcpJoinerConfiguredSingleNode.

@Test
public void test_clusterVersion_isEventuallySet_whenTcpJoinerConfiguredSingleNode() {
    Config config = new Config();
    config.getGroupConfig().setName(randomName());
    config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
    config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true);
    setupInstance(config);
    assertEqualsEventually(new Callable<Version>() {

        @Override
        public Version call() throws Exception {
            return cluster.getClusterVersion();
        }
    }, codebaseVersion.asVersion());
}
Also used : MemberVersion(com.hazelcast.version.MemberVersion) Version(com.hazelcast.version.Version) Config(com.hazelcast.config.Config) ExpectedException(org.junit.rules.ExpectedException) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 12 with Version

use of com.hazelcast.version.Version in project hazelcast by hazelcast.

the class ClusterVersionInitTest method test_clusterVersion_isEventuallySetOnJoiningMember_whenMulticastJoinerConfigured.

@Test
public void test_clusterVersion_isEventuallySetOnJoiningMember_whenMulticastJoinerConfigured() {
    Config config = new Config();
    config.getGroupConfig().setName(randomName());
    config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(true);
    setupInstance(config);
    HazelcastInstance joiner = Hazelcast.newHazelcastInstance(config);
    final ClusterServiceImpl joinerCluster = (ClusterServiceImpl) joiner.getCluster();
    assertEqualsEventually(new Callable<Version>() {

        @Override
        public Version call() throws Exception {
            return joinerCluster.getClusterVersion();
        }
    }, codebaseVersion.asVersion());
    joiner.shutdown();
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) MemberVersion(com.hazelcast.version.MemberVersion) Version(com.hazelcast.version.Version) Config(com.hazelcast.config.Config) ExpectedException(org.junit.rules.ExpectedException) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 13 with Version

use of com.hazelcast.version.Version in project hazelcast by hazelcast.

the class ClusterVersionInitTest method test_clusterVersion_isEventuallySetOnJoiningMember_whenTcpJoinerConfigured.

@Test
public void test_clusterVersion_isEventuallySetOnJoiningMember_whenTcpJoinerConfigured() {
    Config config = new Config();
    config.getGroupConfig().setName(randomName());
    config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
    config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true);
    setupInstance(config);
    HazelcastInstance joiner = Hazelcast.newHazelcastInstance(config);
    final ClusterServiceImpl joinerCluster = (ClusterServiceImpl) joiner.getCluster();
    assertEqualsEventually(new Callable<Version>() {

        @Override
        public Version call() throws Exception {
            return joinerCluster.getClusterVersion();
        }
    }, codebaseVersion.asVersion());
    joiner.shutdown();
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) MemberVersion(com.hazelcast.version.MemberVersion) Version(com.hazelcast.version.Version) Config(com.hazelcast.config.Config) ExpectedException(org.junit.rules.ExpectedException) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 14 with Version

use of com.hazelcast.version.Version in project hazelcast by hazelcast.

the class ClusterVersionChangeTest method test_clusterVersionUpgradeFails_whenNodeMajorVersionPlusOne.

@Test
public void test_clusterVersionUpgradeFails_whenNodeMajorVersionPlusOne() {
    Version newVersion = Version.of(codebaseVersion.getMajor() + 1, codebaseVersion.getMinor());
    expectedException.expect(VersionMismatchException.class);
    cluster.changeClusterVersion(newVersion);
}
Also used : MemberVersion(com.hazelcast.version.MemberVersion) Version(com.hazelcast.version.Version) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 15 with Version

use of com.hazelcast.version.Version in project hazelcast by hazelcast.

the class ClusterVersionInitTest method test_clusterVersion_isEventuallySet_whenNoJoinerConfiguredSingleNode.

@Test
public void test_clusterVersion_isEventuallySet_whenNoJoinerConfiguredSingleNode() {
    Config config = new Config();
    config.getGroupConfig().setName(randomName());
    config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
    config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(false);
    setupInstance(config);
    assertEqualsEventually(new Callable<Version>() {

        @Override
        public Version call() throws Exception {
            return cluster.getClusterVersion();
        }
    }, codebaseVersion.asVersion());
}
Also used : MemberVersion(com.hazelcast.version.MemberVersion) Version(com.hazelcast.version.Version) Config(com.hazelcast.config.Config) ExpectedException(org.junit.rules.ExpectedException) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

Version (com.hazelcast.version.Version)20 ParallelTest (com.hazelcast.test.annotation.ParallelTest)17 QuickTest (com.hazelcast.test.annotation.QuickTest)17 Test (org.junit.Test)17 MemberVersion (com.hazelcast.version.MemberVersion)16 Config (com.hazelcast.config.Config)5 ExpectedException (org.junit.rules.ExpectedException)5 ClusterState (com.hazelcast.cluster.ClusterState)3 HazelcastInstance (com.hazelcast.core.HazelcastInstance)3 ClusterVersionListener (com.hazelcast.internal.cluster.ClusterVersionListener)3 CountDownLatch (java.util.concurrent.CountDownLatch)3 CacheStatisticsImpl (com.hazelcast.cache.impl.CacheStatisticsImpl)1 GroupConfig (com.hazelcast.config.GroupConfig)1 BackupTaskStatus (com.hazelcast.hotrestart.BackupTaskStatus)1 MemberImpl (com.hazelcast.instance.MemberImpl)1 Node (com.hazelcast.instance.Node)1 ClusterService (com.hazelcast.internal.cluster.ClusterService)1 MemberInfo (com.hazelcast.internal.cluster.MemberInfo)1 AuthenticationFailureOperation (com.hazelcast.internal.cluster.impl.operations.AuthenticationFailureOperation)1 AuthorizationOperation (com.hazelcast.internal.cluster.impl.operations.AuthorizationOperation)1