Package de.novanic.eventservice.service.registry

Examples of de.novanic.eventservice.service.registry.EventRegistry.listen()


        theEventRegistry.registerUser(theDomain, theUserId, null);

        RemoteEventServiceServlet theRemoteEventServiceServlet = new DummyRemoteEventServlet(theDomain, theEvent);
        theRemoteEventServiceServlet.init(null);

        final List<DomainEvent> theEvents = theEventRegistry.listen(getLongPollingListener(), theUserId);
        assertNotNull(theEvents);
        assertEquals(1, theEvents.size());
        assertSame(theDomain, theEvents.get(0).getDomain());
        assertSame(theEvent, theEvents.get(0).getEvent());
    }
View Full Code Here


        theEventRegistry.registerUser(theDomain, theUserId, null);

        DummyRemoteEventServlet theRemoteEventServiceServlet = new DummyRemoteEventServlet(theDomain, theEvent);
        theRemoteEventServiceServlet.addEventCall();

        final List<DomainEvent> theEvents = theEventRegistry.listen(getLongPollingListener(), theUserId);
        assertNotNull(theEvents);
        assertEquals(1, theEvents.size());
        assertSame(theDomain, theEvents.get(0).getDomain());
        assertSame(theEvent, theEvents.get(0).getEvent());
    }
View Full Code Here

        try {
            theRemoteEventServiceServlet.addEventUserSpecificCall();
            fail("Exception expected, because the HTTPRequest shouldn't be available!");
        } catch(NoSessionAvailableException e) {}

        final List<DomainEvent> theEvents = theEventRegistry.listen(getLongPollingListener(), theUserId);
        assertNotNull(theEvents);
        assertTrue(theEvents.isEmpty());
    }

    @Test
View Full Code Here

    @Test
    public void testAddEvent() {
        final EventRegistry theEventRegistry = EventRegistryFactory.getInstance().getEventRegistry();
        theEventRegistry.registerUser(TEST_DOMAIN, TEST_USER_ID, null);

        List<DomainEvent> theEvents = theEventRegistry.listen(getLongPollingListener(), TEST_USER_ID);
        assertNotNull(theEvents);
        assertTrue(theEvents.isEmpty());

        myEventExecutorService.addEvent(TEST_DOMAIN, new EmptyEvent());
        theEvents = theEventRegistry.listen(getLongPollingListener(), TEST_USER_ID);
View Full Code Here

        List<DomainEvent> theEvents = theEventRegistry.listen(getLongPollingListener(), TEST_USER_ID);
        assertNotNull(theEvents);
        assertTrue(theEvents.isEmpty());

        myEventExecutorService.addEvent(TEST_DOMAIN, new EmptyEvent());
        theEvents = theEventRegistry.listen(getLongPollingListener(), TEST_USER_ID);
        assertNotNull(theEvents);
        assertFalse(theEvents.isEmpty());
        assertEquals(1, theEvents.size());
    }
View Full Code Here

    @Test
    public void testAddEvent_2() {
        final EventRegistry theEventRegistry = EventRegistryFactory.getInstance().getEventRegistry();
        theEventRegistry.registerUser(TEST_DOMAIN, TEST_USER_ID, null);

        List<DomainEvent> theEvents = theEventRegistry.listen(getLongPollingListener(), TEST_USER_ID);
        assertNotNull(theEvents);
        assertTrue(theEvents.isEmpty());

        myEventExecutorService.addEvent(TEST_DOMAIN_2, new EmptyEvent());
        theEvents = theEventRegistry.listen(getLongPollingListener(), TEST_USER_ID);
View Full Code Here

        List<DomainEvent> theEvents = theEventRegistry.listen(getLongPollingListener(), TEST_USER_ID);
        assertNotNull(theEvents);
        assertTrue(theEvents.isEmpty());

        myEventExecutorService.addEvent(TEST_DOMAIN_2, new EmptyEvent());
        theEvents = theEventRegistry.listen(getLongPollingListener(), TEST_USER_ID);
        assertNotNull(theEvents);
        assertTrue(theEvents.isEmpty());
    }

    @Test
View Full Code Here

    @Test
    public void testAddEventUserSpecific() {
        final EventRegistry theEventRegistry = EventRegistryFactory.getInstance().getEventRegistry();
        theEventRegistry.registerUser(TEST_DOMAIN, TEST_USER_ID, null);

        List<DomainEvent> theEvents = theEventRegistry.listen(getLongPollingListener(), TEST_USER_ID);
        assertNotNull(theEvents);
        assertTrue(theEvents.isEmpty());

        myEventExecutorService.addEventUserSpecific(new EmptyEvent());
        theEvents = theEventRegistry.listen(getLongPollingListener(), TEST_USER_ID);
View Full Code Here

        List<DomainEvent> theEvents = theEventRegistry.listen(getLongPollingListener(), TEST_USER_ID);
        assertNotNull(theEvents);
        assertTrue(theEvents.isEmpty());

        myEventExecutorService.addEventUserSpecific(new EmptyEvent());
        theEvents = theEventRegistry.listen(getLongPollingListener(), TEST_USER_ID);
        assertNotNull(theEvents);
        assertFalse(theEvents.isEmpty());
        assertEquals(1, theEvents.size());
    }
View Full Code Here

    @Test
    public void testAddEventUserSpecific_2() {
        final EventRegistry theEventRegistry = EventRegistryFactory.getInstance().getEventRegistry();

        List<DomainEvent> theEvents = theEventRegistry.listen(getLongPollingListener(), TEST_USER_ID);
        assertNull(theEvents);

        myEventExecutorService.addEventUserSpecific(new EmptyEvent());
        theEvents = theEventRegistry.listen(getLongPollingListener(), TEST_USER_ID); //the user is not registered
        assertNull(theEvents);
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.