Examples of TestConnectionFactory


Examples of com.netflix.astyanax.test.TestConnectionFactory

                TestConstants.CLUSTER_NAME + "_" + TestConstants.KEYSPACE_NAME);
        config.initialize();

        CountingConnectionPoolMonitor monitor = new CountingConnectionPoolMonitor();
        ConnectionPool<TestClient> pool = new BagOfConnectionsConnectionPoolImpl<TestClient>(
                config, new TestConnectionFactory(config, monitor), monitor);

        return pool;
    }
View Full Code Here

Examples of com.netflix.astyanax.test.TestConnectionFactory

        ConnectionPoolConfigurationImpl config = new ConnectionPoolConfigurationImpl(
                TestConstants.CLUSTER_NAME + "_" + TestConstants.KEYSPACE_NAME);
        config.initialize();

        ConnectionPool<TestClient> pool = new BagOfConnectionsConnectionPoolImpl<TestClient>(
                config, new TestConnectionFactory(config, monitor), monitor);

        pool.addHost(
                new Host("127.0.0.1", TestHostType.GOOD_IMMEDIATE.ordinal()),
                true);
View Full Code Here

Examples of com.netflix.astyanax.test.TestConnectionFactory

        config.setInitConnsPerHost(0);
        config.initialize();

       
        ConnectionPool<TestClient> pool = new BagOfConnectionsConnectionPoolImpl<TestClient>(
                config, new TestConnectionFactory(config, monitor), monitor);

        pool.addHost(new Host("127.0.0.1",
                TestHostType.CONNECT_WITH_UNCHECKED_EXCEPTION.ordinal()), true);

        OperationResult<String> result;
View Full Code Here

Examples of com.netflix.astyanax.test.TestConnectionFactory

                TestConstants.CLUSTER_NAME + "_" + TestConstants.KEYSPACE_NAME);
        config.setInitConnsPerHost(0);
        config.initialize();

        ConnectionPool<TestClient> pool = new BagOfConnectionsConnectionPoolImpl<TestClient>(
                config, new TestConnectionFactory(config, monitor), monitor);

        pool.addHost(
                new Host("127.0.0.1", TestHostType.OPERATION_TIMEOUT.ordinal()),
                true);
        pool.addHost(
View Full Code Here

Examples of com.netflix.astyanax.test.TestConnectionFactory

        ConnectionPoolConfiguration config = new ConnectionPoolConfigurationImpl(
                TestConstants.CLUSTER_NAME + "_" + TestConstants.KEYSPACE_NAME);
        CountingConnectionPoolMonitor monitor = new CountingConnectionPoolMonitor();
        try {
            ConnectionPool<TestClient> pool = new RoundRobinConnectionPoolImpl<TestClient>(
                    config, new TestConnectionFactory(config, monitor), monitor);
        } catch (Exception e) {
            e.printStackTrace();
            Assert.fail(e.getMessage());
        }
    }
View Full Code Here

Examples of org.jboss.test.jca.adapter.TestConnectionFactory

      }
      mcf.setSleepInStart(200);
      mcf.setSleepInEnd(200);
      cm.setLocalTransactions(false);
      poolingStrategy.setConnectionListenerFactory(cm);
      cf = new TestConnectionFactory(new ConnectionManagerProxy(), mcf);
   }
View Full Code Here

Examples of org.jboss.test.jca.adapter.TestConnectionFactory

    */
   public boolean testUserTxJndi()
   {
      try
      {
         TestConnectionFactory tcf = (TestConnectionFactory)new InitialContext().lookup("java:/JBossTestCF");
         TestConnection tc = (TestConnection)tcf.getConnection();
         UserTransaction ut = (UserTransaction)new InitialContext().lookup("UserTransaction");
         ut.begin();
         boolean result = tc.isInTx();
         log.info("Jndi test, inTx: " + result);
         ut.commit();
View Full Code Here

Examples of org.jboss.test.jca.adapter.TestConnectionFactory

    */
   public boolean testUserTxSessionCtx()
   {
      try
      {
         TestConnectionFactory tcf = (TestConnectionFactory)new InitialContext().lookup("java:/JBossTestCF");
         TestConnection tc = (TestConnection)tcf.getConnection();
         UserTransaction ut = ctx.getUserTransaction();
         ut.begin();
         boolean result = tc.isInTx();
         log.info("ctx test, inTx: " + result);
         ut.commit();
View Full Code Here

Examples of org.jboss.test.jca.adapter.TestConnectionFactory

   /**
    * @ejb:interface-method
    */
   public void testUnclosedError() throws Exception
   {
      TestConnectionFactory tcf = (TestConnectionFactory)new InitialContext().lookup("java:/JBossTestCF");
      tcf.getConnection(); // DONT CLOSE
   }
View Full Code Here

Examples of org.jboss.test.jca.adapter.TestConnectionFactory

      log.info(failure + " teststart");
      try
      {
         long available = getAvailableConnections();
         InitialContext ctx = new InitialContext();
         TestConnectionFactory cf = (TestConnectionFactory) ctx.lookup("java:/JBossTestCF");
         for (int i = 0; i < count; ++i)
         {
            try
            {
               TestConnection c = (TestConnection) cf.getConnection(failure);
               c.close();
            }
            catch (ResourceException expected)
            {
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.