Package org.openengsb.core.api

Examples of org.openengsb.core.api.Event


    }

    @Test
    public void testStartProcessWithEvents_shouldRunScriptNodes() throws Exception {
        long id = service.startFlow("floweventtest");
        service.processEvent(new Event());
        service.processEvent(new TestEvent());
        service.waitForFlowToFinishIndefinitely(id);
        InOrder inOrder2 = inOrder(logService);
        inOrder2.verify(logService).doSomething("start testflow");
        inOrder2.verify(logService).doSomething("first event received");
View Full Code Here


    @Test
    public void testStart2Processes_shouldOnlyTriggerSpecificEvents() throws Exception {
        long id1 = service.startFlow("floweventtest");
        long id2 = service.startFlow("floweventtest");

        service.processEvent(new Event("event", id1));
        service.processEvent(new TestEvent(id1));
        service.waitForFlowToFinishIndefinitely(id1);

        assertThat(service.getRunningFlows(), hasItem(id2));
        assertThat(service.getRunningFlows(), not(hasItem(id1)));
View Full Code Here

    @Test
    public void testStartWorkflowTriggeredByEvent_shouldStartWorkflow() throws Exception {
        manager.add(new RuleBaseElementId(RuleBaseElementType.Rule, "test42"), "when\n" + "  Event()\n" + "then\n"
                + "  kcontext.getKnowledgeRuntime().startProcess(\"ci\");\n");
        service.processEvent(new Event());
        assertThat(service.getRunningFlows().isEmpty(), is(false));
    }
View Full Code Here

        assertThat(service.getRunningFlows().isEmpty(), is(false));
    }

    @Test
    public void testRegisterWorkflowTrigger_shouldRegisterTrigger() throws Exception {
        service.registerFlowTriggerEvent(new Event("triggerEvent"), "ci");
        service.processEvent(new Event());
        service.processEvent(new Event("triggerEvent"));
        assertThat(service.getRunningFlows().size(), is(1));
    }
View Full Code Here

        testEvent.setTestProperty("foo");
        testEvent.setTestStringProp("bar");
        testEvent.setTestBoolProp(true);
        testEvent.setTestIntProp(42);
        service.registerFlowTriggerEvent(testEvent, "ci");
        service.processEvent(new Event());
        service.processEvent(testEvent);
        assertThat(service.getRunningFlows().size(), is(1));
    }
View Full Code Here

    @Test
    public void testRegisterWorkflowTriggerIgnoreNullFields_shouldRegisterTrigger() throws Exception {
        NullEvent3 testEvent = new NullEvent3();
        testEvent.setName("triggerEvent");
        service.registerFlowTriggerEvent(testEvent, "ci");
        service.processEvent(new Event());
        service.processEvent(testEvent);
        assertThat(service.getRunningFlows().size(), is(1));
    }
View Full Code Here

        NullEvent3 testEvent = new NullEvent3();
        testEvent.setName("triggerEvent");
        testEvent.setTestStringProp("bar");
        testEvent.setTestIntProp(42);
        service.registerFlowTriggerEvent(testEvent, "ci");
        service.processEvent(new Event());
        service.processEvent(testEvent);
        assertThat(service.getRunningFlows().size(), is(1));
    }
View Full Code Here

        assertThat(service.getRunningFlows().size(), is(1));
    }

    @Test(timeout = 3000)
    public void testRegisterWorkflowTriggerWithFlowStartedEvent_shouldRegisterTrigger() throws Exception {
        service.registerFlowTriggerEvent(new Event("triggerEvent"), "flowStartedEvent");
        service.processEvent(new Event("triggerEvent"));
        for (Long id : service.getRunningFlows()) {
            service.waitForFlowToFinishIndefinitely(id);
        }
    }
View Full Code Here

        }
    }

    @Test
    public void testIfEventIsRetracted_shouldWork() throws Exception {
        Event event = new Event();
        service.processEvent(event);
        event = new Event("test-context");
        service.processEvent(event);
        verify(logService, times(2)).doSomething("Hello World");
    }
View Full Code Here

    }

    @Test
    public void testWaitForFlowThatCannotFinish_shouldReturnFalse() throws Exception {
        Long pid = service.startFlow("floweventtest");
        service.processEvent(new Event("FirstEvent"));
        service.startFlow("flowtest");
        boolean finished = service.waitForFlowToFinish(pid, 400);
        assertThat(finished, is(false));
    }
View Full Code Here

TOP

Related Classes of org.openengsb.core.api.Event

Copyright © 2018 www.massapicom. 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.