Package de.novanic.eventservice.client.connection.strategy.connector.streaming

Examples of de.novanic.eventservice.client.connection.strategy.connector.streaming.GWTStreamingClientConnector


    public void testListen_2() throws Exception {
        DummyEventNotification theDummyEventNotification = new DummyEventNotification();

        assertEquals(0, theDummyEventNotification.getOccurredDomainEvents().size());

        GWTStreamingClientConnector theGWTStreamingClientConnector = new GWTStreamingClientConnectorGecko();
        theGWTStreamingClientConnector.init(myEventService);
        theGWTStreamingClientConnector.listen(theDummyEventNotification, new DummyListenAsyncCallback());

        assertEquals(0, theDummyEventNotification.getOccurredDomainEvents().size());

        theGWTStreamingClientConnector.receiveEvent("[0,3,2,1,[\"de.novanic.eventservice.client.event.DefaultDomainEvent/3924906731\",\"de.novanic.eventservice.client.event.domain.DefaultDomain/240262385\",\"test_domain\"],0," + ClientSerializationStreamReader.SERIALIZATION_STREAM_VERSION + "]");
        theGWTStreamingClientConnector.listen(theDummyEventNotification, new DummyListenAsyncCallback());

        assertEquals(1, theDummyEventNotification.getOccurredDomainEvents().size());
        assertNotNull(theDummyEventNotification.getOccurredDomainEvents().get(0));
        assertNotNull(theDummyEventNotification.getOccurredDomainEvents().get(0).getDomain());
        assertNull(theDummyEventNotification.getOccurredDomainEvents().get(0).getEvent());
View Full Code Here


    public void testListen_Error() throws Exception {
        DummyEventNotification theDummyEventNotification = new DummyEventNotification();

        assertEquals(0, theDummyEventNotification.getOccurredDomainEvents().size());

        GWTStreamingClientConnector theGWTStreamingClientConnector = new GWTStreamingClientConnectorGecko();
        theGWTStreamingClientConnector.init(myEventService);
        theGWTStreamingClientConnector.listen(theDummyEventNotification, new DummyListenAsyncCallback());

        assertEquals(0, theDummyEventNotification.getOccurredDomainEvents().size());

        try {
            theGWTStreamingClientConnector.receiveEvent("[4,3,2,1,[\"de.novanic.eventservice.client.event.DefaultDomainEvent/3924906731\",\"de.novanic.eventservice.client.event.domain.DefaultDomain/240262385\",\"test_domain\",\"does.not.exist.DummyEventWithoutPackage\"],0," + ClientSerializationStreamReader.SERIALIZATION_STREAM_VERSION + "]");
            fail("Exception expected, because the event can not be de-serialized / instantiated!");
        } catch(RemoteEventServiceRuntimeException e) {
            assertTrue(e.getCause() instanceof SerializationException);
        }
    }
View Full Code Here

{
    private GWTStreamingClientConnector myGWTStreamingClientConnector;

    @Before
    public void setUp() {
        myGWTStreamingClientConnector = new GWTStreamingClientConnector();
    }
View Full Code Here

TOP

Related Classes of de.novanic.eventservice.client.connection.strategy.connector.streaming.GWTStreamingClientConnector

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.