Package org.jboss.test.jca.adapter

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


      log.info("Simulating connection error");
      try
      {
         InitialContext ctx = new InitialContext();
         ConnectionFactory cf = (ConnectionFactory) ctx.lookup("java:/JBossTestCF");
         TestConnection c = (TestConnection) cf.getConnection();
         try
         {
            c.simulateConnectionError();
         }
         finally
         {
            c.close();
         }
      }
      catch (Exception e)
      {
         if (e.getMessage().equals("Simulated exception") == false)
View Full Code Here


      log.info("Simulating connection error with two handles");
      try
      {
         InitialContext ctx = new InitialContext();
         ConnectionFactory cf = (ConnectionFactory) ctx.lookup("java:/JBossTestCFByTx");
         TestConnection c1 = (TestConnection) cf.getConnection();
         TestConnection c2 = (TestConnection) cf.getConnection();
         try
         {
            c2.simulateConnectionError();
         }
         finally
         {
            try
            {
               c1.close();
            }
            catch (Throwable ignored)
            {
            }
            try
            {
               c2.close();
            }
            catch (Throwable ignored)
            {
            }
         }
View Full Code Here

         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

         cf.setFailure(failure);
         for (int i = 0; i < count; ++i)
         {
            try
            {
               TestConnection c = (TestConnection) cf.getConnection(failure);
               c.close();
            }
            catch (ResourceException expected)
            {
            }
         }
View Full Code Here

TOP

Related Classes of org.jboss.test.jca.adapter.TestConnection

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.