Package org.ow2.easybeans.tests.common.db

Examples of org.ow2.easybeans.tests.common.db.TableManager


     * @param dbName is the name of the database in the registry.
     * @throws SQLException if a databse error occurs.
     * @throws NamingException if a lookup error occurs.
     */
    private void insertTable(final String dbName) throws SQLException, NamingException {
        TableManager tableManager = new TableManager(dbName);
        tableManager.insertTable(TABLE);
    }
View Full Code Here


    public Object intercept(final InvocationContext ic) throws Exception{
        if (ic.getMethod().toString().contains("accessJNDI")) {

            //JNDI Access
            DataSource dsViaJNDI = (DataSource) JNDIHelper.getJavaCompEnvResource("jdbc/jdbc_1");
            TableManager cTest = new TableManager(dsViaJNDI);
            cTest.test("tmpTable" + cTest.hashCode());

        } else if (ic.getMethod().toString().contains("accessEJB")) {

            //EJB Access
            assertTrue(bean.getBool());

        } else if (ic.getMethod().toString().contains("accessResManager")) {

            //ResourceManager Access
            TableManager cTest = new TableManager(ds);
            cTest.test("tmpTable" + cTest.hashCode());

        } else if (ic.getMethod().toString().contains("accessEntityManager")) {

            //EntityManager Access
            UserTransaction utx;
View Full Code Here

     * Inserts the table test the database.
     * @param dbName is the name of the database in the registry.
     * @throws Exception if an error occurs.
     */
    protected void insertTable(final String dbName) throws Exception {
        TableManager tableManager = new TableManager(dbName);
        tableManager.insertTable(TABLE);
    }
View Full Code Here

     * Creates an instance of the tableManager.
     * @param dbName the database name.
     * @throws NamingException if a lookup error occurs.
     */
    public void startup(final String dbName) throws NamingException{
        tableManager = new TableManager(dbName);
    }
View Full Code Here

     * @throws NamingException if a lookup error occurs.
     * @throws SQLException if a database error occurs.
     */
    public void deleteTable(final String dbName, final String tableName) throws NamingException, SQLException {
         // deletes the table
        TableManager tableManager = new TableManager(dbName);
        tableManager.deleteTable(tableName);
    }
View Full Code Here

     * @throws NamingException if a lookup error occurs.
     * @throws SQLException if a database error occurs.
     */
    public void verifyTable(final String dbName, final String tableName) throws NamingException, SQLException {
        // verifies the table
        TableManager tableManager = new TableManager(dbName);
        tableManager.verifyTable(tableName);
    }
View Full Code Here

     * @throws Exception if a problem occurs.
     */
    public void access00() throws Exception {
        // JNDI Access
        DataSource ds = (DataSource) JNDIHelper.getJavaCompEnvResource("jdbc/jdbc_1");
        TableManager cTest = new TableManager(ds);
        cTest.test("tmpTable" + ds.hashCode());
    }
View Full Code Here

     * @param tableName name in the database.
     * @throws NamingException if a lookup error occurs.
     * @throws SQLException if a database error occurs.
     */
    public void insertTable(final String dbName, final String tableName) throws NamingException, SQLException {
        TableManager tableManager = new TableManager(dbName);
        tableManager.insertTable(tableName);
    }
View Full Code Here

     * @throws NamingException if a lookup error occurs.
     */
    public void startup(final boolean callOnlyTransaction, final String dbName) throws NamingException, SQLException {
        utx = TransactionHelper.getUserTransaction();
        bolOnlyCreateTrans = callOnlyTransaction;
        tableManager = new TableManager(dbName);

    }
View Full Code Here

     * @throws NotSupportedException if the resquest cannot be made.
     * @throws SQLException if a database error occurs.
     */
    public void createTableWithAppException(final String dbName) throws NamingException, NotSupportedException,
            SystemException, SQLException {
        TableManager tableManager = new TableManager(dbName);
        tableManager.insertTable(TABLE);
        throw new CustomException01("The bean threw an application exception defined in the deployment descriptor.");
    }
View Full Code Here

TOP

Related Classes of org.ow2.easybeans.tests.common.db.TableManager

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.