Package de.novanic.eventservice.service.registry

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


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

        theEventRegistry.addEvent(TEST_DOMAIN, new EmptyEvent());
        assertEquals(1, theEventRegistry.listen(getLongPollingListener(), TEST_USER_ID).size());

        assertNull(myEventExecutorService.getEventFilter(TEST_DOMAIN));

        final EmptyEventFilter theEventFilter = new EmptyEventFilter(0);
        myEventExecutorService.setEventFilter(TEST_DOMAIN, new EmptyEventFilter(0));
View Full Code Here


        assertNotNull(myEventExecutorService.getEventFilter(TEST_DOMAIN));
        assertEquals(theEventFilter, myEventExecutorService.getEventFilter(TEST_DOMAIN));

        theEventRegistry.addEvent(TEST_DOMAIN, new EmptyEvent());
        assertEquals(0, theEventRegistry.listen(getLongPollingListener(), TEST_USER_ID).size());

        myEventExecutorService.setEventFilter(TEST_DOMAIN, null);

        theEventRegistry.addEvent(TEST_DOMAIN, new EmptyEvent());
        assertEquals(1, theEventRegistry.listen(getLongPollingListener(), TEST_USER_ID).size());
View Full Code Here

        assertEquals(0, theEventRegistry.listen(getLongPollingListener(), TEST_USER_ID).size());

        myEventExecutorService.setEventFilter(TEST_DOMAIN, null);

        theEventRegistry.addEvent(TEST_DOMAIN, new EmptyEvent());
        assertEquals(1, theEventRegistry.listen(getLongPollingListener(), TEST_USER_ID).size());
    }

    private static class EmptyEvent implements Event {}

    private static class EmptyEventFilter implements EventFilter
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.