Package il.co.springsource.insight

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


    @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

    }

    @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

    }

    @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

        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

TOP

Related Classes of il.co.springsource.insight.MyEvent

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.