Examples of DBUtils


Examples of atg.tools.dynunit.test.util.DBUtils

        // Use the DBUtils utility class to get JDBC properties for an in memory
        // HSQL DB called "testdb".
        Properties props = DBUtils.getHSQLDBInMemoryDBConnection("testdb");

        // Start up our database
        DBUtils db = initDB(props);

        boolean rollback = true;

        // Setup our testing configpath
        // RH: disabled logging (last argument to false) to get rid of the double
        // logging statements
        GSATestUtils.getGSATestUtils().initializeMinimalConfigpath(
                configpath, "/SimpleRepository", definitionFiles, props, null, null, null, false
        );

        // Start Nucleus
        Nucleus n = startNucleus(configpath);

        TransactionDemarcation td = new TransactionDemarcation();
        MutableRepository r = (MutableRepository) n.resolveName("/SimpleRepository");

        try {
            // Start a new transaction
            td.begin(((GSARepository) r).getTransactionManager());
            // Create the item
            MutableRepositoryItem item = r.createItem("simpleItem");
            item.setPropertyValue("name", "simpleName");
            // Persist to the repository
            r.addItem(item);
            // Try to get it back from the repository
            String id = item.getRepositoryId();
            RepositoryItem item2 = r.getItem(id, "simpleItem");
            assertNotNull(
                    " We did not get back the item just created from the repository.", item2
            );
            rollback = false;
        } finally {
            // End the transaction, rollback on error
            td.end(rollback);
            // shut down Nucleus
            n.stopService();
            // Shut down HSQLDB
            db.shutdown();
        }
    }
View Full Code Here

Examples of atg.tools.dynunit.test.util.DBUtils

     * @throws Exception
     * @throws SQLException
     */
    protected DBUtils initDB(Properties props)
            throws Exception {
        return new DBUtils(
                props.getProperty("URL"),
                props.getProperty("driver"),
                props.getProperty("user"),
                props.getProperty("password")
        );
View Full Code Here

Examples of atg.tools.dynunit.test.util.DBUtils

        }
        createGlobal(pRoot);
        createScreenLog(pRoot, pLogging);
        createIdSpaces(pRoot);
        if (pJDBCProperties != null) {
            createIDGeneratorTables(new DBUtils(pJDBCProperties));
        }
        else {
            createIDGeneratorTables(new DBUtils(DBUtils.getHSQLDBInMemoryDBConnection()));
        }
        createSQLRepositoryEventServer(pRoot);
        createNucleus(pRoot);

    }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.plugins.mysql.util.DBUtils

    tfTableName = new javax.swing.JTextField();
    rdStructure = new javax.swing.JRadioButton();
    rdStructureData = new javax.swing.JRadioButton();
    listFields = new javax.swing.JList(new DefaultListModel());
    chAllFields = new javax.swing.JCheckBox();
    dbUtils = new DBUtils(_session, _plugin);
    colNames = dbUtils.getColumnNames();
    oldTableName = dbUtils.getTableInfo();
    //chFields = new JCheckBox[colNames.length];
    listFields.setSelectionMode(
      ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
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.