Package com.github.joschi.jadconfig

Examples of com.github.joschi.jadconfig.JadConfig


            System.out.println("JRE: " + Tools.getSystemInformation());
            System.exit(0);
        }

        if(commandLineArguments.isDumpDefaultConfig()) {
            final JadConfig jadConfig = new JadConfig();
            jadConfig.addConverterFactory(new JodaTimeConverterFactory());
            jadConfig.addConfigurationBean(new Configuration());
            System.out.println(dumpConfiguration(jadConfig.dump()));
            System.exit(0);
        }

        final JadConfig jadConfig = new JadConfig();
        jadConfig.addConverterFactory(new JodaTimeConverterFactory());
        final Configuration configuration = readConfiguration(jadConfig, commandLineArguments.getConfigFile());

        if (commandLineArguments.isDumpConfig()) {
            System.out.println(dumpConfiguration(jadConfig.dump()));
            System.exit(0);
        }

        // Are we in debug mode?
        Level logLevel = Level.INFO;
View Full Code Here


            System.out.println("No indices given. Use '-i graylog2_0 graylog2_1 graylog2_2' command line option.");
            jCommander.usage();
            System.exit(1);
        }

        final JadConfig jadConfig = new JadConfig();
        final Configuration configuration = readConfiguration(jadConfig, commandLineOptions);

        final GuiceInstantiationService instantiationService = new GuiceInstantiationService();
        final Injector injector = Guice.createInjector(new Bindings(configuration));
View Full Code Here

    @Test
    public void testRestTransportUriLocalhost() throws RepositoryException, ValidationException {
        validProperties.put("rest_listen_uri", "http://127.0.0.1:12900");

        Configuration configuration = new Configuration();
        new JadConfig(new InMemoryRepository(validProperties), configuration).process();

        Assert.assertEquals("http://127.0.0.1:12900", configuration.getDefaultRestTransportUri().toString());
    }
View Full Code Here

    @Test
    public void testRestTransportUriWildcard() throws RepositoryException, ValidationException {
        validProperties.put("rest_listen_uri", "http://0.0.0.0:12900");

        Configuration configuration = new Configuration();
        new JadConfig(new InMemoryRepository(validProperties), configuration).process();

        Assert.assertNotEquals("http://0.0.0.0:12900", configuration.getDefaultRestTransportUri().toString());
        Assert.assertNotNull(configuration.getDefaultRestTransportUri());
    }
View Full Code Here

    @Test
    public void testRestTransportUriCustom() throws RepositoryException, ValidationException {
        validProperties.put("rest_listen_uri", "http://10.0.0.1:12900");

        Configuration configuration = new Configuration();
        new JadConfig(new InMemoryRepository(validProperties), configuration).process();

        Assert.assertEquals("http://10.0.0.1:12900", configuration.getDefaultRestTransportUri().toString());
    }
View Full Code Here

    @Test
    public void testGetRestUriScheme() throws RepositoryException, ValidationException {
        validProperties.put("rest_enable_tls", "false");
        final Configuration configWithoutTls = new Configuration();
        new JadConfig(new InMemoryRepository(validProperties), configWithoutTls).process();

        validProperties.put("rest_enable_tls", "true");
        final Configuration configWithTls = new Configuration();
        new JadConfig(new InMemoryRepository(validProperties), configWithTls).process();

        assertEquals("http", configWithoutTls.getRestUriScheme());
        assertEquals("https", configWithTls.getRestUriScheme());
    }
View Full Code Here

        settings.put("retention_strategy", "delete");
        settings.put("root_password_sha2", "thisisatest");

        Configuration configuration = new Configuration();
        try {
            new JadConfig(new InMemoryRepository(settings), configuration).process();
        } catch (ValidationException | RepositoryException e) {
            fail(e.getMessage());
        }
        return configuration;
    }
View Full Code Here

                "retention_strategy", "delete",
                "root_password_sha2", "thisisatest",
                "elasticsearch_discovery_zen_ping_unicast_hosts", "example.com");

        final Configuration config = new Configuration();
        new JadConfig(new InMemoryRepository(settings), config).process();

        final Map<String, String> nodeSettings = EsNodeProvider.readNodeSettings(config);

        assertEquals("discovery.zen.ping.unicast.hosts", nodeSettings.get("discovery.zen.ping.unicast.hosts"), "example.com");
    }
View Full Code Here

                "retention_strategy", "delete",
                "root_password_sha2", "thisisatest",
                "elasticsearch_discovery_zen_ping_unicast_hosts", " example.com,   example.net ");

        final Configuration config = new Configuration();
        new JadConfig(new InMemoryRepository(settings), config).process();

        final Map<String, String> nodeSettings = EsNodeProvider.readNodeSettings(config);

        assertEquals("discovery.zen.ping.unicast.hosts", nodeSettings.get("discovery.zen.ping.unicast.hosts"), "example.com,example.net");
    }
View Full Code Here

        validProperties.put("mongodb_useauth", "true");
        validProperties.remove("mongodb_user");
        validProperties.remove("mongodb_password");

        Configuration configuration = new Configuration();
        new JadConfig(new InMemoryRepository(validProperties), configuration).process();
    }
View Full Code Here

TOP

Related Classes of com.github.joschi.jadconfig.JadConfig

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.