Package com.netflix.astyanax.connectionpool

Examples of com.netflix.astyanax.connectionpool.Host


        Assert.assertEquals(0,    pool.getIdleConnectionCount());
    }

    @Test
    public void testAddHostWithUncheckedException() {
        Host host = new Host("127.0.0.1",
                TestHostType.CONNECT_WITH_UNCHECKED_EXCEPTION.ordinal());

        ConnectionPoolConfiguration config = createConfig();
        CountingConnectionPoolMonitor monitor = new CountingConnectionPoolMonitor();
        SimpleHostConnectionPool<TestClient> pool = new SimpleHostConnectionPool<TestClient>(
View Full Code Here


        Assert.assertEquals(true, pool.isReconnecting());
    }

    @Test
    public void testGrowConnections() {
        Host host = new Host("127.0.0.1", TestHostType.GOOD_FAST.ordinal());

        ConnectionPoolConfiguration config = createConfig();
        CountingConnectionPoolMonitor monitor = new CountingConnectionPoolMonitor();
        SimpleHostConnectionPool<TestClient> pool = new SimpleHostConnectionPool<TestClient>(
                host, new TestConnectionFactory(config, monitor), monitor,
View Full Code Here

        Assert.assertEquals(false, pool.isReconnecting());
    }

    @Test
    public void testFailFirst() throws Exception {
        Host host = new Host("127.0.0.1", TestHostType.CONNECT_FAIL_FIRST_TWO.ordinal());

        ConnectionPoolConfigurationImpl config = createConfig();
        config.setRetryBackoffStrategy(new FixedRetryBackoffStrategy(100, 100));
        CountingConnectionPoolMonitor monitor = new CountingConnectionPoolMonitor();
        SimpleHostConnectionPool<TestClient> pool = new SimpleHostConnectionPool<TestClient>(
View Full Code Here

        Assert.assertEquals(false, pool.isReconnecting());
    }

    @Test
    public void testShutdown() {
        Host host = new Host("127.0.0.1", TestHostType.GOOD_FAST.ordinal());

        ConnectionPoolConfigurationImpl config = createConfig();
        config.setRetryBackoffStrategy(new FixedRetryBackoffStrategy(200, 2000));
        config.setMaxConnsPerHost(3);
        config.setMaxPendingConnectionsPerHost(2);
View Full Code Here

        Assert.assertEquals(3,     pool.getIdleConnectionCount());
    }

    @Test
    public void testCloseOrReturnConnection() {
        Host host = new Host("127.0.0.1", TestHostType.GOOD_FAST.ordinal());

        ConnectionPoolConfiguration config = createConfig();
        CountingConnectionPoolMonitor monitor = new CountingConnectionPoolMonitor();
        SimpleHostConnectionPool<TestClient> pool = new SimpleHostConnectionPool<TestClient>(
                host, new TestConnectionFactory(config, monitor), monitor,
View Full Code Here

        }
    }

    @Test
    public void testAsyncOpenConnection() {
        Host host = new Host("127.0.0.1", TestHostType.GOOD_FAST.ordinal());

        ConnectionPoolConfigurationImpl config = createConfig();
        config.setMaxConnsPerHost(1);

        // Open the first connection
View Full Code Here

    }

    @Test
    @Ignore
    public void testAsyncOpenConnectionWithShutdown() {
        Host host = new Host("127.0.0.1", TestHostType.GOOD_SLOW.ordinal());

        ConnectionPoolConfigurationImpl config = createConfig();
        config.setMaxConnsPerHost(1);

        // Open the first connection
View Full Code Here

        Assert.assertEquals(0,    pool.getIdleConnectionCount());
    }

    @Test
    public void testAsyncOpenConnectionWithCheckedException() {
        Host host = new Host("127.0.0.1",
                TestHostType.CONNECT_TIMEOUT.ordinal());

        ConnectionPoolConfigurationImpl config = createConfig();

        // Open the first connection
View Full Code Here

        Assert.assertEquals(false, pool.isReconnecting());
    }

    @Test
    public void testAsyncOpenConnectionWithUnCheckedException() throws Exception {
        Host host = new Host("127.0.0.1",
                TestHostType.CONNECT_WITH_UNCHECKED_EXCEPTION.ordinal());

        ConnectionPoolConfigurationImpl config = createConfig();

        // Open the first connection
View Full Code Here

        Assert.assertEquals(0,     pool.getIdleConnectionCount());
    }
   
    @Test
    public void testExcessiveTimeouts() throws Exception {
        Host host = new Host("127.0.0.1",
                TestHostType.GOOD_FAST.ordinal());

        ConnectionPoolConfigurationImpl config = createConfig();
        config.setRetryBackoffStrategy(new FixedRetryBackoffStrategy(500, 500));
View Full Code Here

TOP

Related Classes of com.netflix.astyanax.connectionpool.Host

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.