Package org.openengsb.core.api

Examples of org.openengsb.core.api.Event


                + "   e : Event()\n"
                + "then\n"
                + "   NullDomain origin = (NullDomain) OsgiHelper.getResponseProxy(e, NullDomain.class);"
                + "   origin.nullMethod(42);");

        Event event = new Event();
        event.setOrigin("test-connector");
        service.processEvent(event);
        verify(nullDomainImpl).nullMethod(42);
    }
View Full Code Here


                + "   e : Event(name==\"evil\")\n"
                + "then\n"
                + "   String testxx = null;"
                + "   testxx.toString();"); // provoke NPE
        try {
            service.processEvent(new Event("evil"));
            fail("evil Event should trigger Exception");
        } catch (Exception e) {
            // expected
        }
        final AtomicReference<Exception> exceptionOccured = new AtomicReference<Exception>();
        final AtomicBoolean completed = new AtomicBoolean(false);
        Thread t = new Thread() {
            @Override
            public void run() {
                try {
                    service.processEvent(new Event()); // should work because the evil Event should have been removed
                    completed.set(true);
                } catch (Exception e) {
                    exceptionOccured.set(e);
                }
            };
View Full Code Here

                + "   e : Event(name==\"evil\")\n"
                + "then\n"
                + "   String testxx = null;"
                + "   testxx.toString();"); // provoke NPE
        try {
            service.processEvent(new Event("evil"));
            fail("evil Event should trigger Exception");
        } catch (Exception e) {
            String exceptionString = new ObjectMapper().writeValueAsString(e);
            assertThat(exceptionString, not(nullValue()));
        }
View Full Code Here

        }
    }

    @Test
    public void testThrowEvent_shouldAuditEvent() throws Exception {
        Event event = new Event("good");
        service.processEvent(event);
        verify(auditingMock).onEvent(event);
    }
View Full Code Here

    /**
     * inserts an Event into the existing session and fires All rules
     */
    private void sendEventToSession() {
        session.insert(new Event());
        session.fireAllRules();
    }
View Full Code Here

    @Ignore
    public void testRaiseEvent_shouldForwardToConnector() throws Exception {
        ContextHolder.get().setCurrentContextId("foo");
        WorkflowService workflowService = getOsgiService(WorkflowService.class);
        authenticateAsAdmin();
        Event event = new Event();
        workflowService.processEvent(event);
        assertThat(exampleMock.lastEvent, equalTo(event));
    }
View Full Code Here

        Map<String, Object> properties = new HashMap<String, Object>();
        attributes.put("mixin.1", EventSupport.class.getName());
        remoteConnector.start(new MyExampleConnector(eventRef),
                new ConnectorDescription("example", "external-connector-proxy", attributes, properties));
        WorkflowService workflowService = getOsgiService(WorkflowService.class);
        Event event = new Event("test");
        ContextHolder.get().setCurrentContextId("foo");
        authenticateAsAdmin();
        workflowService.processEvent(event);
        assertThat(eventRef.get().getName(), equalTo("test"));
    }
View Full Code Here

            @Override
            public Object answer(InvocationOnMock invocation) throws Throwable {
                ServiceList<EventSupport> eventSupports = makeServiceList(EventSupport.class);
                for (EventSupport e : eventSupports) {
                    try {
                        e.onEvent(new Event());
                    } catch (Exception e1) {
                        e1.printStackTrace();
                    }
                }
                EKBCommit commit = (EKBCommit) invocation.getArguments()[0];
View Full Code Here

        ConnectorDescription desc = makeConnectorDescription(CSVParser.class, testFile);
        connectorManager.create(desc);

        ServiceReference<EventSupport> reference = bundleContext.getServiceReference(EventSupport.class);
        EventSupport service = bundleContext.getService(reference);
        service.onEvent(new Event());
        verify(queryService).queryForActiveModels(TestModel.class);
    }
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.