Package org.openengsb.core.api

Examples of org.openengsb.core.api.Event


        tester.getApplication().getComponentInstantiationListeners()
            .add(new PaxWicketSpringBeanComponentInjector(tester.getApplication(), context));
        eventService = mock(WorkflowService.class);
       
        List<Event> allAudits = new ArrayList<Event>();
        Event event1 = new Event();
        event1.setName("123");
        event1.setProcessId(1L);
        Event event2 = new Event();
        event2.setName("456");
        event2.setProcessId(2L);
        allAudits.add(event1);
        allAudits.add(event2);

        Mockito.when(auditingDomain.getAllAudits()).thenReturn(allAudits);
        context.putBean("eventService", eventService);
View Full Code Here


        auditsContainer.setOutputMarkupId(true);

        AjaxButton submitButton = new IndicatingAjaxButton("submitButton", form) {
            @Override
            protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
                Event event = buildEvent(dropDownChoice.getModelObject(), realValues);
                if (event != null) {
                    try {
                        eventService.processEvent(event);
                        info(new StringResourceModel("send.event.success", SendEventPage.this, null).getString());
                    } catch (WorkflowException e) {
View Full Code Here

        return attributes;
    }

    private Event buildEvent(Class<?> eventClass, Map<String, String> values) {
        try {
            Event obj = (Event) eventClass.newInstance();
            BeanInfo beanInfo = Introspector.getBeanInfo(eventClass);
            PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
            for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
                if (propertyDescriptor.getWriteMethod() == null
                        || !Modifier.isPublic(propertyDescriptor.getWriteMethod().getModifiers())) {
View Full Code Here

        notification = (DummyNotificationDomain) domains.get("notification");
    }

    @Test
    public void testProcessEvent_shouldProcessEvent() throws Exception {
        service.processEvent(new Event());
    }
View Full Code Here

        service.processEvent(event);
    }

    @Test
    public void testProcessEvent_shouldTriggerHelloWorld() throws Exception {
        Event event = new Event();
        service.processEvent(event);
        verify(notification, atLeast(1)).notify("Hello");
        verify((DummyExampleDomain) domains.get("example"), atLeast(1)).doSomething("Hello World");
        verify(myservice, atLeast(1)).call();
    }
View Full Code Here

        verify(myservice, atLeast(1)).call();
    }

    @Test
    public void testUseLog_shouldLog() throws Exception {
        Event event = new Event("test-context");
        service.processEvent(event);
        verify(logService).doSomething("42");
    }
View Full Code Here

    @Test
    public void testUpdateRule_shouldWork() throws Exception {
        manager.update(new RuleBaseElementId(RuleBaseElementType.Rule, "hello1"),
            "when\n Event ( name == \"test-context\")\n then \n example.doSomething(\"21\");");
        Event event = new Event("test-context");
        service.processEvent(event);
        verify(logService).doSomething("21");
    }
View Full Code Here

        verify(logService).doSomething("21");
    }

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

            manager.add(new RuleBaseElementId(RuleBaseElementType.Rule, "hello"), "this*is_invalid");
            fail("expected Exception");
        } catch (RuleBaseException e) {
            // expected
        }
        Event event = new Event("test-context");
        service.processEvent(event);
        verify(logService, times(2)).doSomething(anyString());
    }
View Full Code Here

            manager.update(new RuleBaseElementId(RuleBaseElementType.Rule, "hello1"), "this*is_invalid");
            fail("expected Exception");
        } catch (RuleBaseException e) {
            assertThat(e.getCause(), nullValue());
        }
        Event event = new Event("test-context");
        service.processEvent(event);
        verify(logService, times(2)).doSomething(anyString());
    }
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.