Examples of RuntimeEventListener


Examples of org.apache.tuscany.sca.event.RuntimeEventListener

public class BaseEventPublisherTestCase extends TestCase {
    EventPublisher publisher;

    public void testFireListener() {
        Event event = new TestEvent();
        RuntimeEventListener listener = EasyMock.createMock(RuntimeEventListener.class);
        listener.onEvent(EasyMock.same(event));
        EasyMock.expectLastCall();
        EasyMock.replay(listener);
        publisher.addListener(listener);
        publisher.publish(event);
        EasyMock.verify(listener);
View Full Code Here

Examples of org.apache.tuscany.sca.event.RuntimeEventListener

        EasyMock.verify(listener);
    }

    public void testRemoveListener() {
        Event event = new TestEvent();
        RuntimeEventListener listener = EasyMock.createMock(RuntimeEventListener.class);
        EasyMock.replay(listener);
        publisher.addListener(listener);
        publisher.removeListener(listener);
        publisher.publish(event);
        EasyMock.verify(listener);
View Full Code Here

Examples of org.apache.tuscany.sca.event.RuntimeEventListener

        EasyMock.verify(listener);
    }

    public void testFalseFilterListener() {
        Event event = new TestEvent();
        RuntimeEventListener listener = EasyMock.createMock(RuntimeEventListener.class);
        EasyMock.replay(listener);
        publisher.addListener(new FalseFilter(), listener);
        publisher.publish(event);
        EasyMock.verify(listener);
    }
View Full Code Here

Examples of org.apache.tuscany.sca.event.RuntimeEventListener

        EasyMock.verify(listener);
    }

    public void testTrueFilterListener() {
        Event event = new TestEvent();
        RuntimeEventListener listener = EasyMock.createMock(RuntimeEventListener.class);
        listener.onEvent(EasyMock.same(event));
        EasyMock.expectLastCall();
        EasyMock.replay(listener);
        publisher.addListener(new TrueFilter(), listener);
        publisher.publish(event);
        EasyMock.verify(listener);
View Full Code Here

Examples of org.apache.tuscany.sca.event.RuntimeEventListener

        store.destroy();
    }

    public void testNotifyOnEviction() throws Exception {
        final CountDownLatch latch = new CountDownLatch(1);
        RuntimeEventListener listener = EasyMock.createMock(RuntimeEventListener.class);
        listener.onEvent(EasyMock.isA(StoreExpirationEvent.class));
        EasyMock.expectLastCall().andStubAnswer(new IAnswer<Object>() {
            public Object answer() throws Throwable {
                latch.countDown();
                return null;
            }
View Full Code Here

Examples of org.apache.tuscany.sca.event.RuntimeEventListener

public class BaseEventPublisherTestCase extends TestCase {
    EventPublisher publisher;

    public void testFireListener() {
        Event event = new TestEvent();
        RuntimeEventListener listener = EasyMock.createMock(RuntimeEventListener.class);
        listener.onEvent(EasyMock.same(event));
        EasyMock.expectLastCall();
        EasyMock.replay(listener);
        publisher.addListener(listener);
        publisher.publish(event);
        EasyMock.verify(listener);
View Full Code Here

Examples of org.apache.tuscany.sca.event.RuntimeEventListener

        EasyMock.verify(listener);
    }

    public void testRemoveListener() {
        Event event = new TestEvent();
        RuntimeEventListener listener = EasyMock.createMock(RuntimeEventListener.class);
        EasyMock.replay(listener);
        publisher.addListener(listener);
        publisher.removeListener(listener);
        publisher.publish(event);
        EasyMock.verify(listener);
View Full Code Here

Examples of org.apache.tuscany.sca.event.RuntimeEventListener

        EasyMock.verify(listener);
    }

    public void testFalseFilterListener() {
        Event event = new TestEvent();
        RuntimeEventListener listener = EasyMock.createMock(RuntimeEventListener.class);
        EasyMock.replay(listener);
        publisher.addListener(new FalseFilter(), listener);
        publisher.publish(event);
        EasyMock.verify(listener);
    }
View Full Code Here

Examples of org.apache.tuscany.sca.event.RuntimeEventListener

        EasyMock.verify(listener);
    }

    public void testTrueFilterListener() {
        Event event = new TestEvent();
        RuntimeEventListener listener = EasyMock.createMock(RuntimeEventListener.class);
        listener.onEvent(EasyMock.same(event));
        EasyMock.expectLastCall();
        EasyMock.replay(listener);
        publisher.addListener(new TrueFilter(), listener);
        publisher.publish(event);
        EasyMock.verify(listener);
View Full Code Here

Examples of org.apache.tuscany.sca.event.RuntimeEventListener

        store.destroy();
    }

    public void testNotifyOnEviction() throws Exception {
        final CountDownLatch latch = new CountDownLatch(1);
        RuntimeEventListener listener = EasyMock.createMock(RuntimeEventListener.class);
        listener.onEvent(EasyMock.isA(StoreExpirationEvent.class));
        EasyMock.expectLastCall().andStubAnswer(new IAnswer<Object>() {
            public Object answer() throws Throwable {
                latch.countDown();
                return null;
            }
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.