use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class PromoteLiteMemberTest method normalMember_promotion_shouldFail_onNonMaster.
@Test
public void normalMember_promotion_shouldFail_onNonMaster() {
TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory();
factory.newHazelcastInstance(new Config());
HazelcastInstance hz2 = factory.newHazelcastInstance(new Config());
HazelcastInstance hz3 = factory.newHazelcastInstance(new Config());
PromoteLiteMemberOp op = new PromoteLiteMemberOp();
op.setCallerUuid(getMember(hz2).getUuid());
InternalCompletableFuture<MembersView> future = getOperationService(hz2).invokeOnTarget(ClusterServiceImpl.SERVICE_NAME, op, getAddress(hz3));
exception.expect(CompletionException.class);
exception.expect(new RootCauseMatcher(IllegalStateException.class));
future.join();
}
use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class LoggingScheduledExecutorTest method throwsExecutionException_withCallable_withFutureGetTimeout.
@Test
public void throwsExecutionException_withCallable_withFutureGetTimeout() throws Exception {
executor = new LoggingScheduledExecutor(logger, 1, factory);
Future<Integer> future = executor.submit(new FailedCallable());
expectedException.expect(new RootCauseMatcher(RuntimeException.class));
future.get(10, SECONDS);
assertNull(logger.getThrowable());
}
use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class YamlClientConfigImportVariableReplacementTest method testImportRedefinesSameConfigScalarThrows.
@Test
public void testImportRedefinesSameConfigScalarThrows() throws Exception {
String importedYaml = "" + "hazelcast-client:\n" + " cluster-name: name1";
String configPath = helper.givenConfigFileInWorkDir("foo.bar", importedYaml).getAbsolutePath();
String yaml = "" + "hazelcast-client:\n" + " import:\n" + " - ${config.location}\n" + " cluster-name: name2";
rule.expect(new RootCauseMatcher(InvalidConfigurationException.class, "hazelcast-client/cluster-name"));
buildConfig(yaml, "config.location", configPath);
}
use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class YamlClientConfigImportVariableReplacementTest method testImportNodeScalarVsSequenceThrows.
@Test
public void testImportNodeScalarVsSequenceThrows() throws Exception {
String importedYaml = "" + "hazelcast-client:\n" + " cluster-name: name1";
String configPath = helper.givenConfigFileInWorkDir("foo.bar", importedYaml).getAbsolutePath();
String yaml = "" + "hazelcast-client:\n" + " import:\n" + " - ${config.location}\n" + " cluster-name:\n" + " - seqName: {}";
rule.expect(new RootCauseMatcher(InvalidConfigurationException.class, "hazelcast-client/cluster-name"));
buildConfig(yaml, "config.location", configPath);
}
use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class YamlClientConfigImportVariableReplacementTest method testImportNodeScalarVsMappingThrows.
@Test
public void testImportNodeScalarVsMappingThrows() throws Exception {
String importedYaml = "" + "hazelcast-client:\n" + " cluster-name: name1";
String configPath = helper.givenConfigFileInWorkDir("foo.bar", importedYaml).getAbsolutePath();
String yaml = "" + "hazelcast-client:\n" + " import:\n" + " - ${config.location}\n" + " cluster-name: {}";
rule.expect(new RootCauseMatcher(InvalidConfigurationException.class, "hazelcast-client/cluster-name"));
buildConfig(yaml, "config.location", configPath);
}
Aggregations