use of com.oracle.bedrock.runtime.Application in project oracle-bedrock by coherence-community.
the class SimpleRemoteApplicationLauncherTest method shouldDeployAndLaunchSimpleApplicationRemotely.
/**
* Ensure that we can launch deploy a test file.
*/
@Test
public void shouldDeployAndLaunchSimpleApplicationRemotely() throws Exception {
RemotePlatform platform = getRemotePlatform();
URL testFileURL = Thread.currentThread().getContextClassLoader().getResource("test.txt");
File testFile = new File(testFileURL.toURI().getPath());
try (Application application = platform.launch("ls", Argument.of("-la"), Console.system(), CustomDeployment.including(new DeploymentArtifact(testFile)))) {
assertThat(application.waitFor(), is(0));
application.close();
assertThat(application.exitValue(), is(0));
}
}
use of com.oracle.bedrock.runtime.Application in project oracle-bedrock by coherence-community.
the class TestClassesClassPathClassesTest method createJar.
private File createJar(Class<?>... classes) throws Exception {
File content = createClassesFolder(classes);
File jar = new File(content, "test.jar");
try (Application app = LocalPlatform.get().launch("jar", Argument.of("-cvf"), Argument.of("test.jar"), Argument.of("."), WorkingDirectory.at(content), Console.system())) {
app.waitFor();
}
return jar;
}
Aggregations