Package com.netflix.astyanax.test

Examples of com.netflix.astyanax.test.TestConnectionFactory


        CountingConnectionPoolMonitor monitor = new CountingConnectionPoolMonitor();

        ConnectionPoolConfiguration config = createConfig();
        SimpleHostConnectionPool<TestClient> pool = new SimpleHostConnectionPool<TestClient>(
                host, new TestConnectionFactory(config, monitor), monitor,
                config, new NoOpListener());
        Assert.assertEquals(0,      pool.getActiveConnectionCount());
        Assert.assertEquals(false,  pool.isReconnecting());
        Assert.assertEquals(0,      pool.getIdleConnectionCount());
View Full Code Here


                TestHostType.CONNECT_TIMEOUT.ordinal());

        ConnectionPoolConfiguration config = createConfig();
        CountingConnectionPoolMonitor monitor = new CountingConnectionPoolMonitor();
        SimpleHostConnectionPool<TestClient> pool = new SimpleHostConnectionPool<TestClient>(
                host, new TestConnectionFactory(config, monitor), monitor,
                config, new NoOpListener());

        try {
            pool.primeConnections(1);
            Assert.fail();
View Full Code Here

                TestHostType.CONNECT_WITH_UNCHECKED_EXCEPTION.ordinal());

        ConnectionPoolConfiguration config = createConfig();
        CountingConnectionPoolMonitor monitor = new CountingConnectionPoolMonitor();
        SimpleHostConnectionPool<TestClient> pool = new SimpleHostConnectionPool<TestClient>(
                host, new TestConnectionFactory(config, monitor), monitor,
                config, new NoOpListener());

        try {
            pool.primeConnections(1);
            Assert.fail();
View Full Code Here

        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,
                config, new NoOpListener());

        try {
            pool.primeConnections(2);
        } catch (InterruptedException e) {
View Full Code Here

        ConnectionPoolConfigurationImpl config = createConfig();
        config.setRetryBackoffStrategy(new FixedRetryBackoffStrategy(100, 100));
        CountingConnectionPoolMonitor monitor = new CountingConnectionPoolMonitor();
        SimpleHostConnectionPool<TestClient> pool = new SimpleHostConnectionPool<TestClient>(
                host, new TestConnectionFactory(config, monitor), monitor,
                config, new NoOpListener());

        try {
            pool.primeConnections(2);
            Assert.fail();
View Full Code Here

        config.setRetryBackoffStrategy(new FixedRetryBackoffStrategy(200, 2000));
        config.setMaxConnsPerHost(3);
        config.setMaxPendingConnectionsPerHost(2);
        CountingConnectionPoolMonitor monitor = new CountingConnectionPoolMonitor();
        SimpleHostConnectionPool<TestClient> pool = new SimpleHostConnectionPool<TestClient>(
                host, new TestConnectionFactory(config, monitor), monitor,
                config, new NoOpListener());

        try {
            pool.primeConnections(2);
        } catch (InterruptedException e) {
View Full Code Here

        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,
                config, new NoOpListener());

        try {
            pool.primeConnections(2);
View Full Code Here

        config.setMaxConnsPerHost(1);

        // Open the first connection
        CountingConnectionPoolMonitor monitor = new CountingConnectionPoolMonitor();
        SimpleHostConnectionPool<TestClient> pool = new SimpleHostConnectionPool<TestClient>(
                host, new TestConnectionFactory(config, monitor), monitor,
                config, new NoOpListener());

        try {
            Connection<TestClient> connection = pool
                    .borrowConnection(WAIT_TIMEOUT);
View Full Code Here

        config.setMaxConnsPerHost(1);

        // Open the first connection
        CountingConnectionPoolMonitor monitor = new CountingConnectionPoolMonitor();
        SimpleHostConnectionPool<TestClient> pool = new SimpleHostConnectionPool<TestClient>(
                host, new TestConnectionFactory(config, monitor), monitor,
                config, new NoOpListener());

        try {
            Connection<TestClient> connection = pool.borrowConnection(1);
        } catch (PoolTimeoutException e) {
View Full Code Here

        ConnectionPoolConfigurationImpl config = createConfig();

        // Open the first connection
        CountingConnectionPoolMonitor monitor = new CountingConnectionPoolMonitor();
        SimpleHostConnectionPool<TestClient> pool = new SimpleHostConnectionPool<TestClient>(
                host, new TestConnectionFactory(config, monitor), monitor,
                config, new NoOpListener());

        try {
            Connection<TestClient> connection = pool
                    .borrowConnection(WAIT_TIMEOUT);
View Full Code Here

TOP

Related Classes of com.netflix.astyanax.test.TestConnectionFactory

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.