Package com.proofpoint.configuration

Examples of com.proofpoint.configuration.ConfigurationFactory


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

        ConfigurationFactory configFactory = new ConfigurationFactory(ImmutableMap.<String, String>of("node.environment", "environment"));
        Injector injector = Guice.createInjector(new NodeModule(), new ConfigurationModule(configFactory), new ApplicationNameModule("test-application"));
        NodeInfo nodeInfo = injector.getInstance(NodeInfo.class);
        Assert.assertNotNull(nodeInfo);
        Assert.assertEquals(nodeInfo.getApplication(), "test-application");
        Assert.assertEquals(nodeInfo.getEnvironment(), "environment");
View Full Code Here


        String location = "location";
        String binarySpec = "binary";
        String configSpec = "config";
        String publicIp = "10.0.0.22";
        String internalHostname = "internal.hostname";
        ConfigurationFactory configFactory = new ConfigurationFactory(ImmutableMap.<String, String>builder()
                .put("node.environment", environment)
                .put("node.pool", pool)
                .put("node.id", nodeId)
                .put("node.ip", publicIp)
                .put("node.hostname", internalHostname)
View Full Code Here

    }


    private static <T> T newInstance(Class<T> configClass, Map<String, String> properties)
    {
        ConfigurationFactory configurationFactory = new ConfigurationFactory(properties);
        return configurationFactory.build(configClass);
    }
View Full Code Here

    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(),
                new DiscoveryModule()
View Full Code Here

        Guice.createInjector(
                new ApplicationNameModule("test-application"),
                new TestingNodeModule(),
                new TestingDiscoveryModule(),
                new TestingMBeanModule(),
                new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
                new JsonModule(),
                new ReportingModule(),
                new ReportingClientModule());
    }
View Full Code Here

        createInjector(properties, new H2EmbeddedDataSourceModule(constructionPrefix, MainBinding.class));
    }

    private static Injector createInjector(Map<String, String> properties, Module... modules)
    {
        ConfigurationFactory configurationFactory = new ConfigurationFactory(properties);

        // Required to bind a configuration module and an MBean server when binding an H2EmbeddedDataSourceModule
        List<Module> moduleList = ImmutableList.<Module>builder()
                .add(modules)
                .add(new ConfigurationModule(configurationFactory))
View Full Code Here

                    .withSystemProperties();
        }
        else {
            builder = builder.withRequiredProperties(requiredConfigurationProperties);
        }
        ConfigurationFactory configurationFactory = builder.build();

        if (logging != null) {
            // initialize logging
            log.info("Initializing logging");
            LoggingConfiguration configuration = configurationFactory.build(LoggingConfiguration.class);
            logging.configure(configuration);
        }

        // create warning logger now that we have logging initialized
        final List<String> warnings = new ArrayList<>();
View Full Code Here

{
    @Test
    public void testCanConstruct()
    {
        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(),
View Full Code Here

    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(),
                new Module()
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(),
                new Module()
View Full Code Here

TOP

Related Classes of com.proofpoint.configuration.ConfigurationFactory

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.