Package com.github.joschi.jadconfig

Examples of com.github.joschi.jadconfig.JadConfig


    @Test
    public void testGetMongoDBReplicaSetServers() throws RepositoryException, ValidationException {
        validProperties.put("mongodb_replica_set", "127.0.0.1:27017,127.0.0.1:27018");

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

        Assert.assertEquals(2, configuration.getMongoReplicaSet().size());
    }
View Full Code Here


    @Test
    public void testGetMongoDBReplicaSetServersIPv6() throws RepositoryException, ValidationException {
        validProperties.put("mongodb_replica_set", "fe80::221:6aff:fe6f:6c88,[fe80::221:6aff:fe6f:6c89]:27018,127.0.0.1:27019");

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

        Assert.assertEquals(3, configuration.getMongoReplicaSet().size());
    }
View Full Code Here

    }

    @Test
    public void testDefaultMessageCacheSpoolDir() throws RepositoryException, ValidationException {
        Configuration configuration = new Configuration();
        new JadConfig(new InMemoryRepository(validProperties), configuration).process();

        Assert.assertEquals(configuration.getMessageCacheSpoolDir(), "spool", "Default message_cache_spool_dir is not 'spool'");
    }
View Full Code Here

    public void testMessageCacheSpoolDir() throws RepositoryException, ValidationException {
        final HashMap<String, String> properties = Maps.newHashMap(validProperties);
        properties.put("message_cache_spool_dir", "wat?/a/spool/dir");

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

        Assert.assertEquals(configuration.getMessageCacheSpoolDir(), "wat?/a/spool/dir");
    }
View Full Code Here

    }

    @Test
    public void testDefaultMessageCacheCommitInterval() throws RepositoryException, ValidationException {
        Configuration configuration = new Configuration();
        new JadConfig(new InMemoryRepository(validProperties), configuration).process();

        Assert.assertEquals(configuration.getMessageCacheCommitInterval(), 1000, "Default message_cache_commit_interval is not '1000'");
    }
View Full Code Here

    public void testMessageCacheCommitInterval() throws RepositoryException, ValidationException {
        final HashMap<String, String> properties = Maps.newHashMap(validProperties);
        properties.put("message_cache_commit_interval", "4000");

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

        Assert.assertEquals(configuration.getMessageCacheCommitInterval(), 4000);
    }
View Full Code Here

    }

    @Test
    public void testDefaultMessageCacheOffHeap() throws RepositoryException, ValidationException {
        Configuration configuration = new Configuration();
        new JadConfig(new InMemoryRepository(validProperties), configuration).process();

        Assert.assertEquals(configuration.isMessageCacheOffHeap(), true, "Default message_cache_off_heap is not 'true'");
    }
View Full Code Here

    public void testMessageCacheOffHeap() throws RepositoryException, ValidationException {
        final HashMap<String, String> properties = Maps.newHashMap(validProperties);
        properties.put("message_cache_off_heap", "false");

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

        Assert.assertEquals(configuration.isMessageCacheOffHeap(), false);
    }
View Full Code Here

            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);
        }

        if (configuration.getPasswordSecret().isEmpty()) {
            LOG.error("No password secret set. Please define password_secret in your graylog2.conf.");
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.