use of classloader.applications.SleepingApplication in project oracle-bedrock by coherence-community.
the class LocalPlatformJavaApplicationTest method shouldLaunchJavaApplicationUsingSystemPropertyWithSpaces.
/**
* Ensure that {@link JavaApplication}s can is launched with a system-property
* that contains spaces.
*/
@Test
public void shouldLaunchJavaApplicationUsingSystemPropertyWithSpaces() {
// set a System-Property for the SleepingApplication (we'll request it back)
String message = "Hello World";
try (JavaApplication application = getPlatform().launch(JavaApplication.class, ClassName.of(SleepingApplication.class), SystemProperty.of("message", message), IPv4Preferred.yes())) {
// request the system property from the SleepingApplication
String propertyValue = application.invoke(new GetSystemProperty("message"));
assertThat(propertyValue, is(message));
}
}
use of classloader.applications.SleepingApplication in project oracle-bedrock by coherence-community.
the class LocalPlatformJavaApplicationTest method shouldExecuteCallable.
/**
* Ensure that {@link JavaApplication}s can have
* {@link java.util.concurrent.Callable}s submitted to them and executed.
*/
@Test
public void shouldExecuteCallable() {
// set a System-Property for the SleepingApplication (we'll request it back)
String uuid = UUID.randomUUID().toString();
try (JavaApplication application = getPlatform().launch(JavaApplication.class, ClassName.of(SleepingApplication.class), SystemProperty.of("uuid", uuid), IPv4Preferred.yes())) {
// request the system property from the SleepingApplication
CompletableFuture<String> future = application.submit(new GetSystemProperty("uuid"));
Eventually.assertThat(future(String.class, future), is(uuid));
}
}
Aggregations