Package org.apache.tuscany.sca.event

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


        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

        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

        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

        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

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

        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

        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

        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

        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

Related Classes of org.apache.tuscany.sca.event.RuntimeEventListener

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.