Examples of inPoolSize()


Examples of bitronix.tm.resource.common.XAPool.inPoolSize()

        // the pool is now loaded with one connection which will throw an exception when closed
        Thread.sleep(1100); // leave enough time for the ide connections to expire
        TransactionManagerServices.getTaskScheduler().interrupt(); // wake up the task scheduler
        Thread.sleep(100); // leave enough time for the scheduled shrinking task to do its work
        assertEquals(1, pool.inPoolSize());

        MockXAConnectionFactory.setStaticCreateXAConnectionException(new JMSException("createXAConnection fails because connection factory broken"));
        Thread.sleep(1100); // leave enough time for the ide connections to expire
        TransactionManagerServices.getTaskScheduler().interrupt(); // wake up the task scheduler
        Thread.sleep(100); // leave enough time for the scheduled shrinking task to do its work
View Full Code Here

Examples of bitronix.tm.resource.common.XAPool.inPoolSize()

        MockXAConnectionFactory.setStaticCreateXAConnectionException(new JMSException("createXAConnection fails because connection factory broken"));
        Thread.sleep(1100); // leave enough time for the ide connections to expire
        TransactionManagerServices.getTaskScheduler().interrupt(); // wake up the task scheduler
        Thread.sleep(100); // leave enough time for the scheduled shrinking task to do its work
        assertEquals(0, pool.inPoolSize());

        MockXAConnectionFactory.setStaticCreateXAConnectionException(null);
        Thread.sleep(1100); // leave enough time for the ide connections to expire
        TransactionManagerServices.getTaskScheduler().interrupt(); // wake up the task scheduler
        Thread.sleep(100); // leave enough time for the scheduled shrinking task to do its work
View Full Code Here

Examples of bitronix.tm.resource.common.XAPool.inPoolSize()

        MockXAConnectionFactory.setStaticCreateXAConnectionException(null);
        Thread.sleep(1100); // leave enough time for the ide connections to expire
        TransactionManagerServices.getTaskScheduler().interrupt(); // wake up the task scheduler
        Thread.sleep(100); // leave enough time for the scheduled shrinking task to do its work
        assertEquals(1, pool.inPoolSize());
    }

    public void testPoolReset() throws Exception {
        Field poolField = pcf.getClass().getDeclaredField("pool");
        poolField.setAccessible(true);
View Full Code Here

Examples of bitronix.tm.resource.common.XAPool.inPoolSize()

    public void testPoolReset() throws Exception {
        Field poolField = pcf.getClass().getDeclaredField("pool");
        poolField.setAccessible(true);
        XAPool pool = (XAPool) poolField.get(pcf);

        assertEquals(1, pool.inPoolSize());
        assertEquals(1, pool.totalPoolSize());

        Connection c1 = pcf.createConnection();
        assertEquals(0, pool.inPoolSize());
        assertEquals(1, pool.totalPoolSize());
View Full Code Here

Examples of bitronix.tm.resource.common.XAPool.inPoolSize()

        assertEquals(1, pool.inPoolSize());
        assertEquals(1, pool.totalPoolSize());

        Connection c1 = pcf.createConnection();
        assertEquals(0, pool.inPoolSize());
        assertEquals(1, pool.totalPoolSize());

        Connection c2 = pcf.createConnection();
        assertEquals(0, pool.inPoolSize());
        assertEquals(2, pool.totalPoolSize());
View Full Code Here

Examples of bitronix.tm.resource.common.XAPool.inPoolSize()

        Connection c1 = pcf.createConnection();
        assertEquals(0, pool.inPoolSize());
        assertEquals(1, pool.totalPoolSize());

        Connection c2 = pcf.createConnection();
        assertEquals(0, pool.inPoolSize());
        assertEquals(2, pool.totalPoolSize());

        c1.close();
        c2.close();
View Full Code Here

Examples of bitronix.tm.resource.common.XAPool.inPoolSize()

        c1.close();
        c2.close();

        pcf.reset();

        assertEquals(1, pool.inPoolSize());
        assertEquals(1, pool.totalPoolSize());
    }

    public void testPoolResetErrorHandling() throws Exception {
        Field poolField = pcf.getClass().getDeclaredField("pool");
View Full Code Here

Examples of bitronix.tm.resource.common.XAPool.inPoolSize()

            MockXAConnectionFactory.setStaticCreateXAConnectionException(new JMSException("createXAConnection fails because connection factory broken"));
            pcf.reset();
            fail("expected JMSException");
        } catch (JMSException ex) {
            assertEquals("createXAConnection fails because connection factory broken", ex.getMessage());
            assertEquals(0, pool.inPoolSize());
        }

        MockXAConnectionFactory.setStaticCreateXAConnectionException(null);
        pcf.reset();
        assertEquals(1, pool.inPoolSize());
View Full Code Here

Examples of bitronix.tm.resource.common.XAPool.inPoolSize()

            assertEquals(0, pool.inPoolSize());
        }

        MockXAConnectionFactory.setStaticCreateXAConnectionException(null);
        pcf.reset();
        assertEquals(1, pool.inPoolSize());
    }
   
}
View Full Code Here

Examples of bitronix.tm.resource.common.XAPool.inPoolSize()

    public void testPoolGrowth() throws Exception {
        Field poolField = pds.getClass().getDeclaredField("pool");
        poolField.setAccessible(true);
        XAPool pool = (XAPool) poolField.get(pds);

        assertEquals(1, pool.inPoolSize());
        assertEquals(1, pool.totalPoolSize());

        Connection c1 = pds.getConnection();
        assertEquals(0, pool.inPoolSize());
        assertEquals(1, pool.totalPoolSize());
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.