Package org.dbunit

Examples of org.dbunit.DefaultDatabaseTester


                DatabaseConfig config = dbunitConn.getConfig();
                config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY,
                        new HsqlDataTypeFactory());
            }
            IDataSet dataSet = loadDataSet(dbunitConn);
            databaseTester = new DefaultDatabaseTester(dbunitConn);
            databaseTester.setDataSet(dataSet);
            databaseTester.setSetUpOperation(DatabaseOperation.CLEAN_INSERT);
            databaseTester.onSetup();
        } catch (Exception ex) {
            log.debug("Exception in initializing database", ex);
View Full Code Here


    try {
      em = entityManagerFactory.createEntityManager();
      Connection conn = getConnection(em);
      IDatabaseConnection dbunitConn = new DatabaseConnection(conn);
      IDataSet dataSet = loadDataSet(dbunitConn);
      databaseTester = new DefaultDatabaseTester(dbunitConn);
      databaseTester.setDataSet(dataSet);
      databaseTester.setSetUpOperation(DatabaseOperation.CLEAN_INSERT);
      databaseTester.onSetup();
    } catch (Exception ex) {
      log.debug("Exception in initializing database", ex);
View Full Code Here

    private static final String DATA_SET_FILE = "OneToMany.xml";

    protected void setUp() throws Exception {
        super.setUp();
        _jdo = (JDOManager) _context.getBean(getJDOManagerBeanName());
        _dbtester = new DefaultDatabaseTester(new DatabaseConnection(_jdo.getConnectionFactory().createConnection()));
        _dbtester.setDataSet(new XmlDataSet(new FileInputStream(
                getClass().getResource(DATA_SET_FILE).getFile())));
        _dbtester.onSetup();
    }
View Full Code Here

    private static final String DATA_SET_FILE_EMTY = "SingleEmpty.xml";

    protected void setUp() throws Exception {
        super.setUp();
        _jdo = (JDOManager) _context.getBean(getJDOManagerBeanName());
        _dbtester = new DefaultDatabaseTester(new DatabaseConnection(_jdo
                .getConnectionFactory().createConnection()));
        _dbtester.setDataSet(new XmlDataSet(new FileInputStream(getClass()
                .getResource(DATA_SET_FILE).getFile())));
        _dbtester.onSetup();
    }
View Full Code Here

    // assertDataset(DATA_SET_FILE_INSERTED_KEYGEN);
    // }

    private void assertDataset(String datasetlocation) throws Exception {
        String tablename1 = "book";
        IDataSet actualDataSet = new DefaultDatabaseTester(
                new DatabaseConnection(_jdo.getConnectionFactory()
                        .createConnection())).getConnection().createDataSet(
                new String[] { tablename1 });
        IDataSet expectedDataSet = new XmlDataSet(new FileInputStream(
                getClass().getResource(datasetlocation).getFile()));
View Full Code Here

    private static final String DATA_SET_FILE_ADDR_UPDATED = "OneToOneAddrUpdated.xml";

    protected void setUp() throws Exception {
        super.setUp();
        _jdo = (JDOManager) _context.getBean(getJDOManagerBeanName());
        _dbtester = new DefaultDatabaseTester(new DatabaseConnection(_jdo.getConnectionFactory().createConnection()));
        _dbtester.setDataSet(new XmlDataSet(new FileInputStream(
                getClass().getResource(DATA_SET_FILE).getFile())));
        _dbtester.onSetup();
    }
View Full Code Here

     */
    private void assertDataset(String datasetlocation) throws Exception{
        String tablename1 = "employee";
        String tablename2 = "address";
       
        IDataSet actualDataSet = new DefaultDatabaseTester(
                new DatabaseConnection(_jdo.getConnectionFactory()
                        .createConnection())).getConnection().createDataSet(
                new String[] { tablename1, tablename2 });
        IDataSet expectedDataSet = new XmlDataSet(new FileInputStream(
                getClass().getResource(datasetlocation).getFile()));
View Full Code Here

TOP

Related Classes of org.dbunit.DefaultDatabaseTester

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.