HWDBTestCase9

来源:互联网 发布:图纸打印软件 编辑:程序博客网 时间:2024/06/11 13:32

 protected final void insertTables(String fileName)
            throws DatabaseUnitException, SQLException, Exception
    {
        if (fileName != null && !fileName.equals(""))
        {
            disableForeignKey();
            IDataSet dataSet2 = new XmlDataSet(getDbXml(getClass(), fileName));
            DatabaseOperation.CLEAN_INSERT.execute(getConnection(), dataSet2);
            enableForeignKey();
        }
    }
    
      protected final void compareTable(String querySql, String tableName,
            String fileName) throws DataSetException, SQLException, Exception
    {
        ITable dbTable = getConnection().createQueryTable(tableName, querySql);
        IDataSet xmlDatas = new XmlDataSet(getDbXml(getClass(), fileName));
       
        ITable xmlTable = xmlDatas.getTable(tableName);
        Assertion.assertEquals(xmlTable, dbTable);
        System.out.println();
        System.out.println("compare table " + tableName + " successfully ");
    }

原创粉丝点击