Search in sources :

Example 1 with DefaultClusterConfiguration

use of com.palantir.timelock.config.DefaultClusterConfiguration in project atlasdb by palantir.

the class TimeLockAgentTest method throwsIfStartedWithLessThanThreeServers_dangerousTopologyNotEnabled.

@Test
public void throwsIfStartedWithLessThanThreeServers_dangerousTopologyNotEnabled() {
    DefaultClusterConfiguration dangerousTopologyConfig = ImmutableDefaultClusterConfiguration.builder().localServer(SERVER_A).cluster(PartialServiceConfiguration.of(ImmutableList.of(SERVER_A, SERVER_B), Optional.empty())).build();
    assertThatThrownBy(() -> TimeLockAgent.verifyTopologyOffersHighAvailability(TimeLockInstallConfiguration.builder().paxos(createPaxosInstall(false, true, false)).build(), dangerousTopologyConfig)).isInstanceOf(SafeIllegalArgumentException.class);
}
Also used : DefaultClusterConfiguration(com.palantir.timelock.config.DefaultClusterConfiguration) ImmutableDefaultClusterConfiguration(com.palantir.timelock.config.ImmutableDefaultClusterConfiguration) Test(org.junit.Test)

Example 2 with DefaultClusterConfiguration

use of com.palantir.timelock.config.DefaultClusterConfiguration in project atlasdb by palantir.

the class TimeLockAgentTest method doesNotThrowIfStartedWithLessThanThreeServers_dangerousTopologyEnabledInInstallConfig.

@Test
public void doesNotThrowIfStartedWithLessThanThreeServers_dangerousTopologyEnabledInInstallConfig() {
    DefaultClusterConfiguration dangerousTopologyConfig = ImmutableDefaultClusterConfiguration.builder().localServer(SERVER_A).cluster(PartialServiceConfiguration.of(ImmutableList.of(SERVER_A, SERVER_B), Optional.empty())).build();
    assertThatCode(() -> TimeLockAgent.verifyTopologyOffersHighAvailability(TimeLockInstallConfiguration.builder().paxos(createPaxosInstall(false, true, false)).cluster(ImmutableClusterInstallConfiguration.builder().enableNonstandardAndPossiblyDangerousTopology(true).build()).build(), dangerousTopologyConfig)).doesNotThrowAnyException();
}
Also used : DefaultClusterConfiguration(com.palantir.timelock.config.DefaultClusterConfiguration) ImmutableDefaultClusterConfiguration(com.palantir.timelock.config.ImmutableDefaultClusterConfiguration) Test(org.junit.Test)

Example 3 with DefaultClusterConfiguration

use of com.palantir.timelock.config.DefaultClusterConfiguration in project atlasdb by palantir.

the class TimeLockAgentTest method doesNotThrowIfStartedWithLessThanThreeServers_dangerousTopologyEnabledInRuntimeConfig.

@Test
public void doesNotThrowIfStartedWithLessThanThreeServers_dangerousTopologyEnabledInRuntimeConfig() {
    DefaultClusterConfiguration dangerousTopologyConfig = ImmutableDefaultClusterConfiguration.builder().localServer(SERVER_A).cluster(PartialServiceConfiguration.of(ImmutableList.of(SERVER_A, SERVER_B), Optional.empty())).enableNonstandardAndPossiblyDangerousTopology(true).build();
    assertThatCode(() -> TimeLockAgent.verifyTopologyOffersHighAvailability(TimeLockInstallConfiguration.builder().paxos(createPaxosInstall(false, true, false)).build(), dangerousTopologyConfig)).doesNotThrowAnyException();
}
Also used : DefaultClusterConfiguration(com.palantir.timelock.config.DefaultClusterConfiguration) ImmutableDefaultClusterConfiguration(com.palantir.timelock.config.ImmutableDefaultClusterConfiguration) Test(org.junit.Test)

Aggregations

DefaultClusterConfiguration (com.palantir.timelock.config.DefaultClusterConfiguration)3 ImmutableDefaultClusterConfiguration (com.palantir.timelock.config.ImmutableDefaultClusterConfiguration)3 Test (org.junit.Test)3