Package com.zaxxer.hikari.mocks

Examples of com.zaxxer.hikari.mocks.StubConnection


      config.setDataSourceClassName("com.zaxxer.hikari.mocks.StubDataSource");

      HikariDataSource ds = new HikariDataSource(config);
      try {
         Connection conn = ds.getConnection();
         StubConnection stubConnection = conn.unwrap(StubConnection.class);
         stubConnection.throwException = true;

         try {
            conn.createStatement();
            Assert.fail();
View Full Code Here


      config.setDataSourceClassName("com.zaxxer.hikari.mocks.StubDataSource");

      HikariDataSource ds = new HikariDataSource(config);
      try {
         Connection conn = ds.getConnection();
         StubConnection stubConnection = conn.unwrap(StubConnection.class);
         stubConnection.throwException = true;

         try {
            conn.setTransactionIsolation(Connection.TRANSACTION_NONE);
            Assert.fail();
View Full Code Here

            Assert.assertSame("Idle connections not as expected", 1, TestElf.getPool(ds).getIdleConnections());
   
            Connection connection = ds.getConnection();
            Assert.assertNotNull(connection);
   
            StubConnection unwrapped = connection.unwrap(StubConnection.class);
            Assert.assertTrue("unwrapped connection is not instance of StubConnection: " + unwrapped, (unwrapped != null && unwrapped instanceof StubConnection));
        }
        finally {
            ds.close();
        }
View Full Code Here

TOP

Related Classes of com.zaxxer.hikari.mocks.StubConnection

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.