Package fi.jumi.actors.maven.reference

Examples of fi.jumi.actors.maven.reference.DummyListenerEventizer


        generator = new EventStubGenerator(DummyListener.class, targetPackageResolver);
    }

    @Test
    public void eventizer_advertises_its_actor_interface_type() {
        DummyListenerEventizer eventizer = new DummyListenerEventizer();

        assertEquals(DummyListener.class, eventizer.getType());
    }
View Full Code Here


    }

    @Test
    public void stubs_forward_events_from_frontend_to_backend() {
        DummyListener target = mock(DummyListener.class);
        DummyListenerEventizer eventizer = new DummyListenerEventizer();
        MessageSender<Event<DummyListener>> backend = eventizer.newBackend(target);
        DummyListener frontend = eventizer.newFrontend(backend);

        frontend.onSomething("foo", "bar");
        frontend.onOther();

        verify(target).onSomething("foo", "bar");
View Full Code Here

    }

    @Test
    public void event_classes_are_serializable() {
        MessageQueue<Event<DummyListener>> spy = new MessageQueue<Event<DummyListener>>();
        DummyListenerEventizer eventizer = new DummyListenerEventizer();
        DummyListener frontend = eventizer.newFrontend(spy);

        frontend.onSomething("foo", "bar");
        Event<DummyListener> event = spy.poll();

        assertThat(event, is(instanceOf(Serializable.class)));
View Full Code Here

    }

    @Test
    public void the_events_have_descriptive_toString_methods() {
        MessageQueue<Event<DummyListener>> spy = new MessageQueue<Event<DummyListener>>();
        DummyListenerEventizer eventizer = new DummyListenerEventizer();
        DummyListener frontend = eventizer.newFrontend(spy);

        frontend.onSomething("foo", "bar");
        frontend.onOther();

        assertThat(spy.poll().toString(), is("DummyListener.onSomething(\"foo\", \"bar\")"));
View Full Code Here

    }

    @Test
    public void the_generated_events_and_DynamicEvent_have_the_same_toString_format() {
        MessageQueue<Event<DummyListener>> spy = new MessageQueue<Event<DummyListener>>();
        DummyListener generated = new DummyListenerEventizer().newFrontend(spy);
        DummyListener dynamic = new DynamicEventizer<DummyListener>(DummyListener.class).newFrontend(spy);

        generated.onSomething("foo", "bar");
        dynamic.onSomething("foo", "bar");
View Full Code Here

TOP

Related Classes of fi.jumi.actors.maven.reference.DummyListenerEventizer

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.