/**
   * testAllocateConnectionWrongMCF.
   *
   * @throws ResourceException for exception
   */
  @Test(expected = ResourceException.class)
  public void testAllocateConnectionWrongMCF() throws ResourceException {
    AbstractConnectionManager connectionManager = new MockConnectionManager();

    PoolConfiguration pc = new PoolConfiguration();
    PoolFactory pf = new PoolFactory();

    Pool pool =
        pf.create(PoolStrategy.ONE_POOL, new MockManagedConnectionFactory(), pc, false, true);
    pool.setConnectionListenerFactory(connectionManager);

    connectionManager.setPool(pool);
    connectionManager.allocateConnection(new MockManagedConnectionFactory(), null);
  }
  /** testPoolNotNull. */
  @Test
  public void testPoolNotNull() {
    AbstractConnectionManager connectionManager = new MockConnectionManager();
    assertNull(connectionManager.getPool());

    PoolConfiguration pc = new PoolConfiguration();
    PoolFactory pf = new PoolFactory();

    Pool pool =
        pf.create(PoolStrategy.ONE_POOL, new MockManagedConnectionFactory(), pc, false, true);
    pool.setConnectionListenerFactory(connectionManager);
    connectionManager.setPool(pool);

    assertNotNull(connectionManager.getPool());
  }