SingleVMCloudKeeper { public EnvironmentBuilder newCloudKeeperEnvironmentBuilder() { return new EnvironmentBuilder(); } private  SingleVMCloudKeeper(
        boolean ownsActorSystem,
        ActorSystem actorSystem,
        ActorRef administrator,
        ActorRef masterInterpreter,
        ActorRef executor,
        InstanceProvider instanceProvider,
        boolean ownsWorkspaceBasePath,
        Path workspaceBasePath
    ); SingleVMCloudKeeper shutdown(); void awaitTermination(); EnvironmentBuilder newCloudKeeperEnvironmentBuilder();  }
@Test public void testFibonacci() throws Exception { CloudKeeperEnvironment cloudKeeperEnvironment = cloudKeeper.newCloudKeeperEnvironmentBuilder() .setCleaningRequested(true) .build(); Fibonacci fibonacciModule = ModuleFactory.getDefault().create(Fibonacci.class) .n().fromValue(5); WorkflowExecution workflowExecution = fibonacciModule .newPreconfiguredWorkflowExecutionBuilder(cloudKeeperEnvironment) .setBundleIdentifiers(Collections.singletonList(SimpleRepository.BUNDLE_ID)) .start(); int result = WorkflowExecutions.getOutputValue( workflowExecution, fibonacciModule.result(), WAIT_SECONDS, TimeUnit.SECONDS); Assert.assertEquals(result, 5); workflowExecution.toCompletableFuture().get(WAIT_SECONDS, TimeUnit.SECONDS); }
@Test public void testProxyFibonacci() throws Exception { CloudKeeperEnvironment cloudKeeperEnvironment = cloudKeeper.newCloudKeeperEnvironmentBuilder() .setCleaningRequested(true) .build(); WorkflowExecution workflowExecution = cloudKeeperEnvironment .newWorkflowExecutionBuilder(new MutableProxyModule().setDeclaration(Fibonacci.class.getName())) .setBundleIdentifiers(Arrays.asList(SimpleRepository.BUNDLE_ID, FibonacciRepository.BUNDLE_ID)) .setInputs(Collections.singletonMap(SimpleName.identifier("n"), (Object) 5)) .start(); int result = (Integer) workflowExecution.getOutput("result").get(WAIT_SECONDS, TimeUnit.SECONDS); Assert.assertEquals(result, 5); workflowExecution.toCompletableFuture().get(WAIT_SECONDS, TimeUnit.SECONDS); }
@Test public void testCompositeModule() throws Exception { CloudKeeperEnvironment cloudKeeperEnvironment = cloudKeeper.newCloudKeeperEnvironmentBuilder() .setCleaningRequested(true) .build(); int n = 5; BareModule pascalTriangleModule = PascalTriangle.createCompositeModule(n); WorkflowExecution workflowExecution = cloudKeeperEnvironment.newWorkflowExecutionBuilder(pascalTriangleModule) .setBundleIdentifiers(Collections.singletonList(SimpleRepository.BUNDLE_ID)) .start(); for (int k = 0; k <= n; ++k) { Assert.assertEquals( (int) workflowExecution.getOutput("coef_" + k).get(WAIT_SECONDS, TimeUnit.SECONDS), binomial(n, k) ); } workflowExecution.toCompletableFuture().get(WAIT_SECONDS, TimeUnit.SECONDS); }