Package org.jukito

Examples of org.jukito.OldStyleAssistedInjectTest$Configuration


    @Test
    public void defaultConfigNoEsFile() {
        // check that all ES settings will be taken from the default values in Configuration.java if nothing is specified.
        Map<String, String> minimalSettings = Maps.newHashMap();
        Configuration defaultConfig = setupConfig(minimalSettings);

        Map<String, String> settings = Maps.newHashMap();
        Configuration config = setupConfig(settings);

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

        assertEquals(defaultConfig.getEsClusterName(), nodeSettings.get("cluster.name"));
        assertEquals(defaultConfig.getEsNodeName(), nodeSettings.get("node.name"));
View Full Code Here


                "discovery.initial_state_timeout",
                "elasticsearch_discovery_initial_state_timeout",
                "5s");
        esPropNames.put("action.auto_create_index", "false");

        Configuration config = setupConfig(settings);

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

        for (Map.Entry<String, String> property : esPropNames.entrySet()) {
            // remove the setting, so we can check if someone added new ones without testing them...
View Full Code Here

    @Test
    public void testHandleMessageEmptyFilterSet() throws Exception {
        MetricRegistry metricRegistry = mock(MetricRegistry.class);
        AtomicInteger processBufferWatermark = new AtomicInteger();
        OutputBuffer outputBuffer = mock(OutputBuffer.class);
        final Configuration configuration = mock(Configuration.class);
        when(configuration.isDisableOutputCache()).thenReturn(false);

        final ServerProcessBufferProcessor emptyFilters =
                new ServerProcessBufferProcessor(metricRegistry,
                                                 Sets.<MessageFilter>newHashSet(),
                                                 configuration,
View Full Code Here

        final Map<String, String> settings = Maps.newHashMap();

        final String esConfigFilePath = new File(Resources.getResource("org/graylog2/bindings/providers/elasticsearch.yml").toURI()).getAbsolutePath();
        settings.put("elasticsearch_config_file", esConfigFilePath);

        Configuration config = setupConfig(settings);

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

        assertNotEquals("cluster.name", config.getEsClusterName(), nodeSettings.get("cluster.name"));
        assertNotEquals("node.name", config.getEsNodeName(), nodeSettings.get("node.name"));
        assertNotEquals("node.master", Boolean.toString(config.isEsIsMasterEligible()), nodeSettings.get("node.master"));
        assertNotEquals("node.data", Boolean.toString(config.isEsStoreData()), nodeSettings.get("node.data"));
        assertNotEquals("http.enabled", Boolean.toString(config.isEsIsHttpEnabled()), nodeSettings.get("http.enabled"));
        assertNotEquals("transport.tcp.port", String.valueOf(config.getEsTransportTcpPort()), nodeSettings.get("transport.tcp.port"));
        assertNotEquals("discovery.initial_state_timeout", config.getEsInitialStateTimeout(), nodeSettings.get("discovery.initial_state_timeout"));
        assertNotEquals("discovery.zen.ping.multicast.enabled", Boolean.toString(config.isEsMulticastDiscovery()),
                nodeSettings.get("discovery.zen.ping.multicast.enabled"));
        assertNotEquals("discovery.zen.ping.unicast.hosts",
                config.getEsUnicastHosts(),
                Lists.newArrayList(Splitter.on(",").split(nodeSettings.get("discovery.zen.ping.unicast.hosts"))));
    }
View Full Code Here

    @Test
    public void testHandleMessage() {
        MetricRegistry metricRegistry = new MetricRegistry();
        AtomicInteger processBufferWatermark = new AtomicInteger();
        OutputBuffer outputBuffer = mock(OutputBuffer.class);
        final Configuration configuration = mock(Configuration.class);
        when(configuration.isDisableOutputCache()).thenReturn(false);

        MessageFilter filterOnlyFirst = new MessageFilter() {
            private boolean filterOut = true;

            @Override
View Full Code Here

                "password_secret", "thisisatest",
                "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

                "password_secret", "thisisatest",
                "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

    @BeforeMethod
    public void setUp() {
        deflector = new Deflector(
                mock(SystemJobManager.class),
                new Configuration(),
                mock(ActivityWriter.class),
                mock(RebuildIndexRangesJob.Factory.class),
                mock(OptimizeIndexJob.Factory.class),
                mock(CreateNewSingleIndexRangeJob.Factory.class),
                mock(Indices.class));
View Full Code Here

        messages = mock(Messages.class);
    }

    @Test
    public void flushingBatchWritesBulk() {
        final Configuration config = new Configuration() {
            @Override
            public int getOutputBatchSize() {
                return 10;
            }
        };
View Full Code Here

        verify(messages, times(1)).bulkIndex(eq(messageList));
    }

    @Test
    public void dontFlushWritesIfElasticsearchIsUnhealthy() {
        final Configuration config = new Configuration() {
            @Override
            public int getOutputBatchSize() {
                return 10;
            }
        };
View Full Code Here

TOP

Related Classes of org.jukito.OldStyleAssistedInjectTest$Configuration

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.