Package de.novanic.eventservice.config

Examples of de.novanic.eventservice.config.EventServiceConfigurationFactory


        assertEquals(0, theEventService.getActiveListenDomains().size());
    }

    @Test
    public void testInit_2() throws Exception {
        final EventServiceConfigurationFactory theEventServiceConfigurationFactory = EventServiceConfigurationFactory.getInstance();
        //remove the PropertyConfigurationLoaders, because there is a eventservice.properties in the classpath and that prevents the WebDescriptorConfigurationLoader from loading.
        theEventServiceConfigurationFactory.removeConfigurationLoader(new PropertyConfigurationLoader());

        myEventService = new DummyEventServiceImpl(new DummyServletConfig());
        super.setUp(myEventService);

        assertEquals(0, myEventService.getActiveListenDomains().size());

        //Configuration of WebDescriptorConfigurationLoader (see DummyServletConfig). That configuration and ConfigurationLoader
        //was initialized with the init-method of EventServiceImpl.
        EventServiceConfiguration theConfiguration = theEventServiceConfigurationFactory.loadEventServiceConfiguration();
        assertEquals(Integer.valueOf(40000), theConfiguration.getMaxWaitingTime());
        assertEquals(Integer.valueOf(5000), theConfiguration.getMinWaitingTime());
        assertEquals(Integer.valueOf(120000), theConfiguration.getTimeoutTime());
    }
View Full Code Here


        assertEquals(Integer.valueOf(120000), theConfiguration.getTimeoutTime());
    }

    @Test
    public void testInitEventService() throws Exception {
        final EventServiceConfigurationFactory theEventServiceConfigurationFactory = EventServiceConfigurationFactory.getInstance();
        //remove the PropertyConfigurationLoaders, because there is a eventservice.properties in the classpath and that prevents the WebDescriptorConfigurationLoader from loading.
        theEventServiceConfigurationFactory.removeConfigurationLoader(new PropertyConfigurationLoader());

        myEventService = new DummyEventServiceImpl(new DummyServletConfig(SessionConnectionIdGenerator.class.getName()));
        super.setUp(myEventService);

        EventServiceConfigurationTransferable theEventServiceConfigurationTransferable = myEventService.initEventService();
View Full Code Here

        } catch(Exception e) {}
    }

    @Test
    public void testDestroyEventService() throws Exception {
        final EventServiceConfigurationFactory theEventServiceConfigurationFactory = EventServiceConfigurationFactory.getInstance();
        //remove the PropertyConfigurationLoaders, because there is a eventservice.properties in the classpath and that prevents the WebDescriptorConfigurationLoader from loading.
        theEventServiceConfigurationFactory.removeConfigurationLoader(new PropertyConfigurationLoader());

        myEventService = new DummyEventServiceImpl(new DummyServletConfig(SessionConnectionIdGenerator.class.getName()));
        super.setUp(myEventService);

        EventRegistry theEventRegistry = EventRegistryFactory.getInstance().getEventRegistry();
View Full Code Here

        when(theSessionMock.getId()).thenReturn(TEST_USER_ID);

        ServletOutputStream theOutputStream = new DummyServletOutputStream(new ByteArrayOutputStream());
        when(theResponseMock.getOutputStream()).thenReturn(theOutputStream);

        final EventServiceConfigurationFactory theEventServiceConfigurationFactory = EventServiceConfigurationFactory.getInstance();
        //remove the PropertyConfigurationLoaders, because there is a eventservice.properties in the classpath and that prevents the WebDescriptorConfigurationLoader from loading.
        theEventServiceConfigurationFactory.removeConfigurationLoader(new PropertyConfigurationLoader());

        myEventService = new DummyEventServiceImpl(new DummyServletConfig());
        super.setUp(myEventService);

        myEventService.doGet(theRequestMock, theResponseMock);
View Full Code Here

    /**
     * Loads the {@link de.novanic.eventservice.config.EventServiceConfiguration} with {@link de.novanic.eventservice.config.EventServiceConfigurationFactory}.
     * @return configuration ({@link de.novanic.eventservice.config.EventServiceConfiguration})
     */
    private EventServiceConfiguration getEventServiceConfiguration() {
        EventServiceConfigurationFactory theConfigurationFactory = EventServiceConfigurationFactory.getInstance();
        return theConfigurationFactory.loadEventServiceConfiguration();
    }
View Full Code Here

     * @param aConfig servlet configuration
     * @return initialized {@link de.novanic.eventservice.service.registry.EventRegistry}
     */
    private EventRegistry initEventRegistry(ServletConfig aConfig) {
        final WebDescriptorConfigurationLoader theWebDescriptorConfigurationLoader = new WebDescriptorConfigurationLoader(aConfig);
        final EventServiceConfigurationFactory theEventServiceConfigurationFactory = EventServiceConfigurationFactory.getInstance();
        theEventServiceConfigurationFactory.addConfigurationLoader(ConfigLevelFactory.DEFAULT, theWebDescriptorConfigurationLoader);

        final EventRegistryFactory theEventRegistryFactory = EventRegistryFactory.getInstance();
        EventRegistry theEventRegistry = theEventRegistryFactory.getEventRegistry();

        if(theWebDescriptorConfigurationLoader.isAvailable()) {
            theEventServiceConfigurationFactory.loadEventServiceConfiguration();
        }
        return theEventRegistry;
    }
View Full Code Here

TOP

Related Classes of de.novanic.eventservice.config.EventServiceConfigurationFactory

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.