Examples of MyEvent


Examples of il.co.springsource.insight.MyEvent

        ctx.refresh();

        MyApplicationListener listener = ctx.getBean(MyApplicationListener.class);
        MyApplicationListenerAndRepository listenerAndRepo = ctx.getBean(MyApplicationListenerAndRepository.class);

        MyEvent event = new MyEvent("fubar");
        ctx.publishEvent(event);
        assertSame("Mismatched listener event", event, listener.getLastEvent());
        assertSame("Mismatched listener&repo event", event, listenerAndRepo.getLastEvent());

        List<Operation> opsList = ((OperationListCollector) spiedOperationCollector).getCollectedOperations();
View Full Code Here

Examples of il.co.springsource.insight.MyEvent

    @Test
    public void testSourceFilteredListener() {
        StaticApplicationContext ctx = new StaticApplicationContext();
        MyApplicationListener delegate = new MyApplicationListener();
        MyEventSource source = new MyEventSource();
        MyEvent event = new MyEvent(source);
        ctx.addApplicationListener(new SourceFilteringListener(source, delegate));
        ctx.refresh();
        ctx.publishEvent(event);

        assertSame("Mismatched delegate event", event, delegate.getLastEvent());
View Full Code Here

Examples of il.co.springsource.insight.MyEvent

    }

    @Test
    public void testPublishEvent() {
        MyApplicationEventPublisher publisher = new MyApplicationEventPublisher();
        MyEvent event = new MyEvent("testPublishEvent");
        publisher.publishEvent(event);

        assertPublishOperation("publish");
        assertSame("Mismatched event instance", event, publisher.getLastEvent());
    }
View Full Code Here

Examples of il.co.springsource.insight.MyEvent

    }

    @Test
    public void testMulticastEvent() {
        MyApplicationEventMulticaster publisher = new MyApplicationEventMulticaster();
        MyEvent event = new MyEvent("testMulticastEvent");
        publisher.multicastEvent(event);

        assertPublishOperation("multicast");
        assertSame("Mismatched event instance", event, publisher.getLastEvent());
    }
View Full Code Here

Examples of il.co.springsource.insight.MyEvent

        super();
    }

    @Test
    public void testNonApplicationContextEvent() {
        MyEvent event = new MyEvent("testNonApplicationContextEvent");
        assertNullValue("Unexpected initial context", SpringEventReferenceCollectionAspect.getApplicationContext(event));
        assertTrue("Event class not marked without context", SpringEventReferenceCollectionAspect.nonContextEvents.contains(event.getClass()));
        assertNullValue("Unexpected extraction method mapping", SpringEventReferenceCollectionAspect.contextMethods.get(event.getClass()));
    }
View Full Code Here

Examples of org.axonframework.test.MyEvent

    private MyEvent expectedEvent;
    private String aggregateId = "AggregateId";

    @Before
    public void setUp() {
        expectedEvent = new MyEvent(aggregateId, 1);
        testSubject = Matchers.equalTo(expectedEvent);
    }
View Full Code Here

Examples of org.axonframework.test.MyEvent

        assertTrue(testSubject.matches(expectedEvent));
    }

    @Test
    public void testMatches_EqualInstance() {
        assertTrue(testSubject.matches(new MyEvent(aggregateId, 1)));
    }
View Full Code Here

Examples of org.axonframework.test.MyEvent

        assertFalse(testSubject.matches(new MyOtherEvent()));
    }

    @Test
    public void testMatches_WrongFieldValue() {
        assertFalse(testSubject.matches(new MyEvent(aggregateId, 2)));
        assertEquals("someValue", testSubject.getFailedField().getName());
    }
View Full Code Here

Examples of org.axonframework.test.MyEvent

        assertEquals("someValue", testSubject.getFailedField().getName());
    }

    @Test
    public void testMatches_WrongFieldValueInArray() {
        assertFalse(testSubject.matches(new MyEvent(aggregateId, 1, new byte[]{1, 2})));
        assertEquals("someBytes", testSubject.getFailedField().getName());
    }
View Full Code Here

Examples of org.axonframework.test.MyEvent

        assertEquals("org.axonframework.test.MyEvent", description.toString());
    }

    @Test
    public void testDescription_AfterMatchWithWrongFieldValue() {
        testSubject.matches(new MyEvent(aggregateId, 2));
        StringDescription description = new StringDescription();
        testSubject.describeTo(description);
        assertEquals("org.axonframework.test.MyEvent (failed on field 'someValue')", description.toString());
    }
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.