Package com.proofpoint.node

Examples of com.proofpoint.node.ApplicationNameModule


    @Test
    public void testBinding()
            throws Exception
    {
        Injector injector = Guice.createInjector(
                new ApplicationNameModule("test-application"),
                new ConfigurationModule(new ConfigurationFactory(ImmutableMap.of("testing.discovery.uri", "fake://server"))),
                new JsonModule(),
                new TestingNodeModule(),
                new TestingMBeanModule(),
                new ReportingModule(),
View Full Code Here


{
    @Test
    public void testReportingModule()
    {
        Guice.createInjector(
                new ApplicationNameModule("test-application"),
                new TestingNodeModule(),
                new TestingDiscoveryModule(),
                new TestingMBeanModule(),
                new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
                new JsonModule(),
View Full Code Here

        // system modules
        Builder<Module> moduleList = ImmutableList.builder();
        moduleList.add(new LifeCycleModule());
        moduleList.add(new ConfigurationModule(configurationFactory));
        moduleList.add(new ApplicationNameModule(applicationName));
        if (!messages.isEmpty()) {
            moduleList.add(new ValidationErrorModule(messages));
        }
        moduleList.add(new Module()
        {
View Full Code Here

    {
        Map<String, String> properties = ImmutableMap.of();
        ConfigurationFactory configFactory = new ConfigurationFactory(properties);
        Injector injector = Guice.createInjector(Stage.PRODUCTION,
                new JmxModule(),
                new ApplicationNameModule("test-application"),
                new TestingNodeModule(),
                new MBeanModule(),
                new ConfigurationModule(configFactory));
        injector.getInstance(JmxAgent.class);
    }
View Full Code Here

    @Test
    public void testTestingNode()
    {
        long testStartTime = System.currentTimeMillis();

        Injector injector = Guice.createInjector(new TestingNodeModule(), new ApplicationNameModule("test-application"));
        NodeInfo nodeInfo = injector.getInstance(NodeInfo.class);

        assertNotNull(nodeInfo);
        assertEquals(nodeInfo.getApplication(), "test-application");
        assertTrue(nodeInfo.getEnvironment().matches("test\\d+"));
View Full Code Here

    }

    @Test
    public void testTestingNodeExplicitEnvironment()
    {
        Injector injector = Guice.createInjector(new TestingNodeModule("foo"), new ApplicationNameModule("test-application"));
        NodeInfo nodeInfo = injector.getInstance(NodeInfo.class);

        assertNotNull(nodeInfo);
        assertEquals(nodeInfo.getEnvironment(), "foo");
    }
View Full Code Here

    }

    @Test
    public void testTestingNodePresentEnvironment()
    {
        Injector injector = Guice.createInjector(new TestingNodeModule(Optional.of("foo")), new ApplicationNameModule("test-application"));
        NodeInfo nodeInfo = injector.getInstance(NodeInfo.class);

        assertNotNull(nodeInfo);
        assertEquals(nodeInfo.getEnvironment(), "foo");
    }
View Full Code Here

    }

    @Test
    public void testTestingNodeAbsentEnvironment()
    {
        Injector injector = Guice.createInjector(new TestingNodeModule(Optional.<String>absent()), new ApplicationNameModule("test-application"));
        NodeInfo nodeInfo = injector.getInstance(NodeInfo.class);

        assertNotNull(nodeInfo);
        assertTrue(nodeInfo.getEnvironment().matches("test\\d+"));
    }
View Full Code Here

    @BeforeMethod
    public void setUp()
            throws Exception
    {
        injector = Guice.createInjector(
                new ApplicationNameModule("test-application"),
                new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
                new TestingNodeModule(),
                new TestingDiscoveryModule(),
                new TestingMBeanModule(),
                new ReportingModule(),
View Full Code Here

    @Test
    public void testHttpSelectorAnnotation()
    {
        injector = Guice.createInjector(
                new ApplicationNameModule("test-application"),
                new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
                new TestingNodeModule(),
                new TestingDiscoveryModule(),
                new TestingMBeanModule(),
                new ReportingModule(),
View Full Code Here

TOP

Related Classes of com.proofpoint.node.ApplicationNameModule

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.