Package org.apache.tuscany.sca.event

Examples of org.apache.tuscany.sca.event.RuntimeEventListener.onEvent()


    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


    }

    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

    }

    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

    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

    }

    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

    }

    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 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

    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

    }

    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

    }

    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.