use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class YamlClientConfigImportVariableReplacementTest method testImportNodeSequenceVsMappingThrows.
@Test
public void testImportNodeSequenceVsMappingThrows() throws Exception {
String importedYaml = "" + "hazelcast-client:\n" + " cluster-name:\n" + " - seqname";
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);
}
use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class YamlClientConfigBuilderTest method testExplicitNullScalarThrows.
@Test
public void testExplicitNullScalarThrows() {
String yaml = "" + "hazelcast-client:\n" + " group:\n" + " name: !!null";
expected.expect(new RootCauseMatcher(InvalidConfigurationException.class, "hazelcast-client/group/name"));
buildConfig(yaml);
}
use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class ClientInvocationFutureTest method test_exceptionalCompletion_withJoin.
@Test
public void test_exceptionalCompletion_withJoin() {
invocationFuture.completeExceptionally(new IllegalArgumentException());
expected.expect(CompletionException.class);
expected.expectCause(new RootCauseMatcher(IllegalArgumentException.class));
invocationFuture.join();
}
use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class ClientDelegatingFutureTest method join_whenCompletedExceptionally.
@Test
public void join_whenCompletedExceptionally() {
invocationFuture.completeExceptionally(new IllegalArgumentException());
expected.expect(CompletionException.class);
expected.expectCause(new RootCauseMatcher(IllegalArgumentException.class));
delegatingFuture.join();
}
use of com.hazelcast.internal.util.RootCauseMatcher in project hazelcast by hazelcast.
the class ClientDelegatingFutureTest method whenComplete_whenExceptional.
@Test
public void whenComplete_whenExceptional() {
CompletableFuture<String> nextStage = delegatingFuture.whenComplete((v, t) -> {
assertInstanceOf(IllegalArgumentException.class, t);
});
invocationFuture.completeExceptionally(new IllegalArgumentException());
assertTrueEventually(() -> assertTrue(nextStage.isDone()));
expected.expect(CompletionException.class);
expected.expectCause(new RootCauseMatcher(IllegalArgumentException.class));
delegatingFuture.join();
}
Aggregations