Package com.axemblr.provisionr.test

Examples of com.axemblr.provisionr.test.ProcessVariablesCollector.install()


    private RuntimeService runTest(List<String> processIds, Map<String, ProcessInstance> processMap) throws Exception {
        DelegateExecution execution = mock(DelegateExecution.class);
        when(execution.getVariable(eq(PROCESS_IDS))).thenReturn(processIds);

        ProcessVariablesCollector collector = new ProcessVariablesCollector();
        collector.install(execution);

        RuntimeService runtimeService = mockRuntimeService(processMap, "invalid");

        JavaDelegate delegate = new KillMachineSetUpProcesses(runtimeService, PROCESS_IDS);
        delegate.execute(execution);
View Full Code Here


            Machine.builder().localhost().externalId("local-2").createMachine()
        );
        when(execution.getVariable(eq(CoreProcessVariables.MACHINES))).thenReturn(machines);

        ProcessVariablesCollector collector = new ProcessVariablesCollector();
        collector.install(execution);

        ProcessEngine processEngine = new StandaloneInMemProcessEngineConfiguration()
            .setJobExecutorActivate(true).buildProcessEngine();
        processEngine.getRepositoryService().createDeployment()
            .addClasspathResource("diagrams/empty.bpmn20.xml").deploy();
View Full Code Here

                    new Instance().withInstanceId("i-456").withPublicDnsName("i2.amazonaws.com")
                        .withPublicIpAddress("5.6.7.8").withPrivateDnsName("i2.internal").withPrivateIpAddress("10.4.5.6")
                )));

        ProcessVariablesCollector collector = new ProcessVariablesCollector();
        collector.install(execution);

        AmazonActivity activity = new PublishListOfMachines(clientCache);
        activity.execute(client, null /* not used */, execution);

        @SuppressWarnings("unchecked")
View Full Code Here

        when(execution.getVariable(eq(IsMachinePortOpen.MACHINE)))
            .thenReturn(Machine.builder().localhost().createMachine());

        ProcessVariablesCollector collector = new ProcessVariablesCollector();
        collector.install(execution);

        ServerSocket socket = null;
        try {
            socket = new ServerSocket(0);
View Full Code Here

        when(execution.getVariable(eq(IsMachinePortOpen.MACHINE)))
            .thenReturn(Machine.builder().localhost().createMachine());

        ProcessVariablesCollector collector = new ProcessVariablesCollector();
        collector.install(execution);

        JavaDelegate delegate = new IsMachinePortOpen(RESULT, findRandomNotUsedPort());
        delegate.execute(execution);

        assertThat((Boolean) collector.getVariable(RESULT)).isFalse();
View Full Code Here

    public void testWithAListOfEndedProcesses() throws Exception {
        DelegateExecution execution = mock(DelegateExecution.class);
        when(execution.getVariable(eq(PROCESS_IDS))).thenReturn(Lists.newArrayList("1", "2"));

        ProcessVariablesCollector collector = new ProcessVariablesCollector();
        collector.install(execution);

        RuntimeService runtimeService = mockRuntimeService(ImmutableMap.of(
            "1", mockProcessInstance(/* ended= */ true),
            "2", mockProcessInstance(/* ended= */ true)
        ));
View Full Code Here

    public void testWithOneEndedAndOneStillRunning() throws Exception {
        DelegateExecution execution = mock(DelegateExecution.class);
        when(execution.getVariable(eq(PROCESS_IDS))).thenReturn(Lists.newArrayList("1", "2"));

        ProcessVariablesCollector collector = new ProcessVariablesCollector();
        collector.install(execution);

        RuntimeService runtimeService = mockRuntimeService(ImmutableMap.of(
            "1", mockProcessInstance(/* ended= */ true),
            "2", mockProcessInstance(/* ended= */ false)
        ));
View Full Code Here

    public void testWithOneInvalidProcessId() throws Exception {
        DelegateExecution execution = mock(DelegateExecution.class);
        when(execution.getVariable(eq(PROCESS_IDS))).thenReturn(Lists.newArrayList("1", "invalid"));

        ProcessVariablesCollector collector = new ProcessVariablesCollector();
        collector.install(execution);

        RuntimeService runtimeService = mockRuntimeService(ImmutableMap.of(
            "1", mockProcessInstance(/* ended= */ true)), "invalid");

        JavaDelegate delegate = new CheckProcessesEnded(runtimeService, PROCESS_IDS, RESULT);
View Full Code Here

    }

    @Test
    public void testRunSpotInstances() throws Exception {
        ProcessVariablesCollector collector = new ProcessVariablesCollector();
        collector.install(execution);

        activity.execute(execution);

        @SuppressWarnings("unchecked")
        ArgumentCaptor<List<String>> argument = (ArgumentCaptor<List<String>>)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.