Examples of ProcessVariablesCollector


Examples of org.apache.provisionr.test.ProcessVariablesCollector

        DelegateExecution execution = mock(DelegateExecution.class);

        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

Examples of org.apache.provisionr.test.ProcessVariablesCollector

    @Test
    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)
        ));

        JavaDelegate delegate = new CheckProcessesEnded(runtimeService, PROCESS_IDS, RESULT);
        delegate.execute(execution);

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

Examples of org.apache.provisionr.test.ProcessVariablesCollector

    @Test
    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)
        ));

        JavaDelegate delegate = new CheckProcessesEnded(runtimeService, PROCESS_IDS, RESULT);
        delegate.execute(execution);

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

Examples of org.apache.provisionr.test.ProcessVariablesCollector

    @Test
    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);
        delegate.execute(execution);

        assertThat((Boolean) collector.getVariable(RESULT)).isTrue();
    }
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.