HWDBTestCase5

来源:互联网 发布:https绑定域名iis 编辑:程序博客网 时间:2024/06/05 19:04

    private void backupCurrentTable(String[] tableNames, String fileName)
            throws Exception
    {
        IDatabaseConnection conn = getConnection();
        QueryDataSet backupDataSet = new QueryDataSet(conn);
        for (int i = 0; i < tableNames.length; ++i)
        {
            backupDataSet.addTable(tableNames[i]);
        }
        File file = File.createTempFile(fileName + "_backup", ".xml");
        files.add(file);// 备份文件
        XmlDataSet.write(backupDataSet, new FileWriter(file), "UTF-8");
    }

 protected final void setUp() throws Exception
    {
        firstFlag = false;
       // System.out.println("SetUp----");
        //校验该库是否允许做单元测试
        if (!checkPrevilegeFlag())
        {
            logger.error("there is no prevelige to update the database");
            System.exit(0);
        }
       
        //数据准备
        prepare();
    }

原创粉丝点击