Package org.apache.commons.configuration2

Examples of org.apache.commons.configuration2.Configuration


    @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

    }

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

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

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

public class SizeBasedRotationStrategyTest {

    @Test
    public void testRotate() throws IndexNotFoundException {
        final Configuration configuration = mock(Configuration.class);
        final Indices indices = mock(Indices.class);

        final IndexStatistics stats = new IndexStatistics();
        final CommonStats commonStats = new CommonStats();
        commonStats.store = new StoreStats(1000, 0);
        stats.setPrimaries(commonStats);

        when(indices.getIndexStats("name")).thenReturn(stats);
        when(configuration.getElasticSearchMaxSizePerIndex()).thenReturn(100L);

        final SizeBasedRotationStrategy strategy = new SizeBasedRotationStrategy(configuration,
                                                                                       indices);
        final RotationStrategy.Result rotate = strategy.shouldRotate("name");
View Full Code Here

    }


    @Test
    public void testDontRotate() throws IndexNotFoundException {
        final Configuration configuration = mock(Configuration.class);
        final Indices indices = mock(Indices.class);

        final IndexStatistics stats = new IndexStatistics();
        final CommonStats commonStats = new CommonStats();
        commonStats.store = new StoreStats(1000, 0);
        stats.setPrimaries(commonStats);

        when(indices.getIndexStats("name")).thenReturn(stats);
        when(configuration.getElasticSearchMaxSizePerIndex()).thenReturn(100000L);

        final SizeBasedRotationStrategy strategy = new SizeBasedRotationStrategy(configuration,
                                                                                 indices);
        final RotationStrategy.Result rotate = strategy.shouldRotate("name");
View Full Code Here

TOP

Related Classes of org.apache.commons.configuration2.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.