Examples of TransactionRuntimeException


Examples of org.teiid.test.framework.exception.TransactionRuntimeException

 
        try {
           debug("Autocommit: " + test.getConnectionStrategy().getAutocommit());
            test.getConnection().setAutoCommit(test.getConnectionStrategy().getAutocommit());
        } catch (SQLException e) {
            throw new TransactionRuntimeException(e);
        }       
    }
View Full Code Here

Examples of org.teiid.test.framework.exception.TransactionRuntimeException

          try {
            test.getConnection().rollback();
          } catch (Exception e) {
            // do nothing
          }
            throw new TransactionRuntimeException(se);
           
           
        } finally {
          // if an exception occurs and the autocommit is set to true - while doing a transaction
          // will generate a new exception overriding the first exception
          if (!exception) {
              try {
                  test.getConnection().setAutoCommit(true);
              } catch (SQLException e) {
                  throw new TransactionRuntimeException(e);
              }
          }
        }
    }  
View Full Code Here

Examples of org.teiid.test.framework.exception.TransactionRuntimeException

    public void validate() {
  // TODO Auto-generated method stub

  jndi_name = getEnvironment().getProperty(DS_JNDINAME);
  if (jndi_name == null || jndi_name.length() == 0) {
      throw new TransactionRuntimeException("Property " + DS_JNDINAME
        + " was not specified");
  }
    }
View Full Code Here

Examples of org.teiid.test.framework.exception.TransactionRuntimeException

    try {
        Object parm = createParmType(parmElement);
        parms[i] = parm;
        i++;
    } catch (JDOMException e) {
        throw new TransactionRuntimeException(e);
    }   
  }
 
 
 
View Full Code Here

Examples of org.teiid.test.framework.exception.TransactionRuntimeException

            lprops.load(in);
            props.putAll(lprops);
           
          }
          else {
            throw new TransactionRuntimeException("Failed to load properties from file '"+filename+ "' configuration file");
          }
      } catch (IOException e) {
          throw new TransactionRuntimeException("Error loading properties from file '"+filename+ "'" + e.getMessage());
      } finally {
    try {
        in.close();
    } catch(Exception e){
       
View Full Code Here

Examples of org.teiid.test.framework.exception.TransactionRuntimeException

    public static TransactionContainer create(ConfigPropertyLoader config) throws QueryTestFailedException {
      TransactionContainer transacton = null;
           
        String type = config.getProperty(TRANSACTION_TYPE);
        if (type == null) {
            throw new TransactionRuntimeException(TRANSACTION_TYPE + " property was not specified" );
        }
       
      
        TestLogger.logDebug("====  Create Transaction-Option: " + type);
       
        if (type.equalsIgnoreCase(TRANSACTION_TYPES.LOCAL_TRANSACTION)) {
          transacton = new LocalTransaction();
        }
        else if (type.equalsIgnoreCase(TRANSACTION_TYPES.XATRANSACTION)) {
          transacton = new XATransaction();
        }
        else if (type.equalsIgnoreCase(TRANSACTION_TYPES.JNDI_TRANSACTION)) {
          transacton = new JNDITransaction();
        }
       else if (type.equalsIgnoreCase(TRANSACTION_TYPES.OFFWRAP_TRANSACTION)) {
              transacton = new TxnAutoTransaction(TXN_AUTO_WRAP_OPTIONS.AUTO_WRAP_OFF);
        }
        else if (type.equalsIgnoreCase(TRANSACTION_TYPES.ONWRAP_TRANSACTION)) {
          transacton = new TxnAutoTransaction(TXN_AUTO_WRAP_OPTIONS.AUTO_WRAP_ON);
        }
            else if (type.equalsIgnoreCase(TRANSACTION_TYPES.AUTOWRAP_TRANSACTION)) {
          transacton = new TxnAutoTransaction(TXN_AUTO_WRAP_OPTIONS.AUTO_WRAP_AUTO);

        } else {
          throw new TransactionRuntimeException("Invalid property value of " + type + " for " + TRANSACTION_TYPE );
        }

        TestLogger.log("====  TransactionContainer: " + transacton.getClass().getName() + " option:" + type);
        return transacton;
    }
View Full Code Here

Examples of org.teiid.test.framework.exception.TransactionRuntimeException

  QueryScenario scenario;
  try {
      scenario = (QueryScenario) ReflectionHelper.create(clzzname, args, null);
  } catch (Exception e) {
      e.printStackTrace();
      throw new TransactionRuntimeException(e);
  }
  return scenario;
    }
View Full Code Here

Examples of org.teiid.test.framework.exception.TransactionRuntimeException

  QueryReader reader;
  try {
      reader = (QueryReader) ReflectionHelper.create(clzzname, args, null);
  } catch (Exception e) {
      e.printStackTrace();
      throw new TransactionRuntimeException(e);
 

  return reader;
    }
View Full Code Here

Examples of org.teiid.test.framework.exception.TransactionRuntimeException

 
  ResultsGenerator resultsgen;
  try {
      resultsgen = (ResultsGenerator) ReflectionHelper.create(clzzname, args, null);
  } catch (Exception e) {
      throw new TransactionRuntimeException(e.getMessage());
 

  return resultsgen;
    }
View Full Code Here

Examples of org.teiid.test.framework.exception.TransactionRuntimeException

 
  ExpectedResults expResults;
  try {
      expResults = (ExpectedResults) ReflectionHelper.create(clzzname, args, null);
  } catch (Exception e) {
      throw new TransactionRuntimeException(e.getMessage());
 

  return expResults;
    }
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.