Examples of TestConnection


Examples of com.p6spy.engine.test.TestConnection

      Connection unwrapped = proxy.unwrap(Connection.class);
      assertTrue(ProxyFactory.isProxy(unwrapped));
    }

    {
      TestConnection unwrapped = proxy.unwrap(TestConnection.class);
      assertTrue(ProxyFactory.isProxy(unwrapped));
    }

    {
      Wrapper unwrapped = proxy.unwrap(Wrapper.class);
View Full Code Here

Examples of com.p6spy.engine.test.TestConnection

    Connection proxy = ProxyFactory.createProxy(underlying, new GenericInvocationHandler<Connection>(underlying));

    // TestConnection is an interface of the actual connection but not of the proxy.  Unwrapping works
    // but a proxy is not returned
    {
      TestConnection unwrapped = proxy.unwrap(TestConnection.class);
      assertFalse(ProxyFactory.isProxy(unwrapped));
    }

    // ResultSet is not implemented at all - an exception will be thrown
    try {
View Full Code Here

Examples of l2p.gameserver.loginservercon.lspackets.TestConnection

        break;
      case 0x08:
        packet = new MoveCharToAccResponse(data, loginserver);
        break;
      case 0x09:
        packet = new TestConnection(data, loginserver);
        break;
      default:
        log.warning("LSConnection: Recieved unknown packet: " + id + ". Restarting connection.");
        //LSConnection.getInstance().shutdown();
        LSConnection.getInstance().restart();
View Full Code Here

Examples of l2p.loginserver.gameservercon.lspackets.TestConnection

  }

  private void requestPing()
  {
    pingRequested = System.currentTimeMillis();
    sendPacket(new TestConnection()); // посылаем пинг
  }
View Full Code Here

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

      log.info("----------------------");
      log.info("testAllocateConnection");
      log.info("----------------------");

      tm.begin();
      TestConnection c = null;
      try
      {
         c = (TestConnection)cm.allocateConnection(mcf, cri);
         try
         {
            assertTrue("Connection not enlisted in tx!", c.isInTx());
         }
         finally
         {
            c.close();
         }
      }
      finally
      {
         Transaction tx = tm.getTransaction();
         if (tx != null)
         {
            if (TxUtils.isActive(tx))
               tm.commit();
            else
               tm.rollback();
         }
         else
            fail("Transaction is null");
      }
      assertTrue("Connection still enlisted in tx!", !c.isInTx());
   }
View Full Code Here

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

      log.info("-------------------------------------------");

      tm.begin();
      try
      {
         TestConnection c = (TestConnection)cm.allocateConnection(mcf, cri);
         c.close();
      }
      finally
      {
         Transaction tx = tm.getTransaction();
         if (tx != null)
View Full Code Here

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

      cm.setTrackConnectionByTx(true);

      tm.begin();
      try
      {
         TestConnection c = (TestConnection)cm.allocateConnection(mcf, cri);
         c.close();
      }
      finally
      {
         Transaction tx = tm.getTransaction();
         if (tx != null)
View Full Code Here

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

      // track-by-tx = true
      cm.setTrackConnectionByTx(true);

      tm.setTransactionTimeout(2);

      TestConnection c = null;
      try
      {
         tm.begin();

         assertEquals("1", 0, cm.getPoolingStrategy().getInUseConnectionCount());

         c = (TestConnection)cm.allocateConnection(mcf, cri);
        
         assertEquals("2", 1, cm.getPoolingStrategy().getInUseConnectionCount());
        
         Thread.sleep(2500L);
        
         Transaction tx = tm.getTransaction();
         if (tx != null && TxUtils.isActive(tx))
            fail("TX is still active");
        
         c.close();
         c = null;
        
         assertEquals("3", 0, cm.getPoolingStrategy().getInUseConnectionCount());
      }
      finally
      {
         if (c != null)
         {
            c.close();
            fail("Connection wasnt closed");
         }
        
         assertNotNull(tm);
           
View Full Code Here

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

      log.info("-------------------");
      log.info("testConnectionError");
      log.info("-------------------");

      tm.begin();
      TestConnection c = (TestConnection)cm.allocateConnection(mcf, cri);
      c.fireConnectionError();
      try
      {
         c.close();
      }
      catch (Exception ignored)
      {
      }

      try
      {
         tm.commit();
         fail("Should not be here");
      }
      catch (RollbackException expected)
      {
      }

      assertTrue("Connection still enlisted in tx!", !c.isInTx());
   }
View Full Code Here

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

      // track-by-tx = true
      cm.setTrackConnectionByTx(true);

      tm.begin();
      TestConnection c = (TestConnection)cm.allocateConnection(mcf, cri);
      c.fireConnectionError();
      try
      {
         c.close();
      }
      catch (Exception ignored)
      {
      }

      try
      {
         tm.commit();
         fail("Should not be here");
      }
      catch (RollbackException expected)
      {
      }

      assertTrue("Connection still enlisted in tx!", !c.isInTx());
   }
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.