Package com.asakusafw.testtools

Examples of com.asakusafw.testtools.TestUtils


     */
    @Test
    public void executeTest01() throws Exception {
        // テストデータを指定
        File testDataDir = new File("src/test/data/recoverer/executeTest01");
        TestUtils util = new TestUtils(testDataDir);
        // テストデータをセット
        util.storeToDatabase(false);

        // 処理の実行
        String[] args = new String[]{targetName, executionId};
        Recoverer recoverer = new StubRecoverer();
        int result = recoverer.execute(args);

        // 実行結果の検証
        assertEquals(0, result);

        // DBの結果を検証
        util.loadFromDatabase();
        if (!util.inspect()) {
            for (Cause cause : util.getCauses()) {
                System.out.println(cause.getMessage());
            }
            fail(util.getCauseMessage());
        }
    }
View Full Code Here


     */
    @Test
    public void executeTest02() throws Exception {
        // テストデータを指定
        File testDataDir = new File("src/test/data/recoverer/executeTest02");
        TestUtils util = new TestUtils(testDataDir);
        // テストデータをセット
        util.storeToDatabase(false);

        // 処理の実行
        String[] args = new String[]{targetName, executionId};
        Recoverer recoverer = new StubRecoverer();
        int result = recoverer.execute(args);

        // 実行結果の検証
        assertEquals(2, result);

        // DBの結果を検証
        util.loadFromDatabase();
        if (!util.inspect()) {
            for (Cause cause : util.getCauses()) {
                System.out.println(cause.getMessage());
            }
            fail(util.getCauseMessage());
        }
    }
View Full Code Here

     */
    @Test
    public void executeTest03() throws Exception {
        // テストデータを指定
        File testDataDir = new File("src/test/data/recoverer/executeTest03");
        TestUtils util = new TestUtils(testDataDir);
        // テストデータをセット
        util.storeToDatabase(false);

        // 処理の実行
        String[] args = new String[]{targetName, executionId};
        Recoverer recoverer = new StubRecoverer();
        int result = recoverer.execute(args);

        // 実行結果の検証
        assertEquals(2, result);

        // DBの結果を検証
        util.loadFromDatabase();
        if (!util.inspect()) {
            for (Cause cause : util.getCauses()) {
                System.out.println(cause.getMessage());
            }
            fail(util.getCauseMessage());
        }
    }
View Full Code Here

     */
    @Test
    public void executeTest04() throws Exception {
        // テストデータを指定
        File testDataDir = new File("src/test/data/recoverer/executeTest04");
        TestUtils util = new TestUtils(testDataDir);
        // テストデータをセット
        util.storeToDatabase(false);
        // テンポラリテーブルを作成
        String tempTable1 = "TEMP_6";
        String dropSql1 = "DROP TABLE IF EXISTS TEMP_6";
        String createSql1 = "CREATE  TABLE `TEMP_6` (`TEMP_SID` BIGINT AUTO_INCREMENT,`SID` BIGINT NULL,`VERSION_NO` BIGINT NULL DEFAULT 1,`TEXTDATA1` VARCHAR(45) NULL ,`INTDATA1` INT NULL ,`DATEDATA1` DATETIME NULL ,`RGST_DATE` DATETIME NULL ,`UPDT_DATE` DATETIME NULL ,`DUPLICATE_FLG` CHAR(1) NULL ,PRIMARY KEY (`TEMP_SID`) ) ENGINE=InnoDB;";
        String tempTable2 = "TEMP_7";
        String dropSql2 = "DROP TABLE IF EXISTS TEMP_7";
        UnitTestUtil.executeUpdate(dropSql1);
        UnitTestUtil.executeUpdate(createSql1);
        UnitTestUtil.executeUpdate(dropSql2);

        // 処理の実行
        String[] args = new String[]{targetName, executionId};
        Recoverer recoverer = new StubRecoverer();
        int result = recoverer.execute(args);

        // 実行結果の検証
        assertEquals(2, result);

        // DBの結果を検証
        util.loadFromDatabase();
        if (!util.inspect()) {
            for (Cause cause : util.getCauses()) {
                System.out.println(cause.getMessage());
            }
            fail(util.getCauseMessage());
        }

        // テンポラリテーブルが存在しない事を確認
        assertFalse(UnitTestUtil.isExistTable(tempTable1));
        assertFalse(UnitTestUtil.isExistTable(tempTable2));
View Full Code Here

     */
    @Test
    public void executeTest05() throws Exception {
        // テストデータを指定
        File testDataDir = new File("src/test/data/recoverer/executeTest04");
        TestUtils util = new TestUtils(testDataDir);
        // テストデータをセット
        util.storeToDatabase(false);
        // テンポラリテーブルを作成
        String tempTable1 = "TEMP_6";
        String dropSql1 = "DROP TABLE IF EXISTS TEMP_6";
        String createSql1 = "CREATE  TABLE `TEMP_6` (`TEMP_SID` BIGINT AUTO_INCREMENT,`SID` BIGINT NULL,`VERSION_NO` BIGINT NULL DEFAULT 1,`TEXTDATA1` VARCHAR(45) NULL ,`INTDATA1` INT NULL ,`DATEDATA1` DATETIME NULL ,`RGST_DATE` DATETIME NULL ,`UPDT_DATE` DATETIME NULL ,`DUPLICATE_FLG` CHAR(1) NULL ,PRIMARY KEY (`TEMP_SID`) ) ENGINE=InnoDB;";
        String tempTable2 = "TEMP_7";
        String dropSql2 = "DROP TABLE IF EXISTS TEMP_7";
        String createSql2 = "CREATE  TABLE `TEMP_7` (`TEMP_SID` BIGINT AUTO_INCREMENT,`SID` BIGINT NULL,`VERSION_NO` BIGINT NULL DEFAULT 1,`TEXTDATA2` VARCHAR(45) NULL ,`INTDATA2` INT NULL ,`DATEDATA2` DATETIME NULL ,`RGST_DATE` DATETIME NULL ,`UPDT_DATE` DATETIME NULL ,`DUPLICATE_FLG` CHAR(1) NULL ,PRIMARY KEY (`TEMP_SID`) ) ENGINE=InnoDB;";
        UnitTestUtil.executeUpdate(dropSql1);
        UnitTestUtil.executeUpdate(createSql1);
        UnitTestUtil.executeUpdate(dropSql2);
        UnitTestUtil.executeUpdate(createSql2);

        // 処理の実行
        String[] args = new String[]{targetName, executionId};
        Recoverer recoverer = new StubRecoverer();
        int result = recoverer.execute(args);

        // 実行結果の検証
        assertEquals(2, result);

        // DBの結果を検証
        util.loadFromDatabase();
        if (!util.inspect()) {
            for (Cause cause : util.getCauses()) {
                System.out.println(cause.getMessage());
            }
            fail(util.getCauseMessage());
        }

        // テンポラリテーブルが存在しない事を確認
        assertFalse(UnitTestUtil.isExistTable(tempTable1));
        assertFalse(UnitTestUtil.isExistTable(tempTable2));
View Full Code Here

        UnitTestUtil.executeUpdate(createSql1);
        UnitTestUtil.executeUpdate(dropSql2);
        UnitTestUtil.executeUpdate(createSql2);
        // テストデータを指定
        File testDataDir = new File("src/test/data/recoverer/executeTest06");
        TestUtils util = new TestUtils(testDataDir);
        // テストデータをセット
        util.storeToDatabase(false);

        // 処理の実行
        String[] args = new String[]{targetName, executionId};
        Recoverer recoverer = new StubRecoverer();
        int result = recoverer.execute(args);

        // 実行結果の検証
        assertEquals(2, result);

        // DBの結果を検証
        util = new TestUtils(new File("src/test/data/recoverer/executeTest06_assert"));
        util.loadFromDatabase();
        if (!util.inspect()) {
            for (Cause cause : util.getCauses()) {
                System.out.println(cause.getMessage());
            }
            fail(util.getCauseMessage());
        }

        // テンポラリテーブルが存在しない事を確認
        assertFalse(UnitTestUtil.isExistTable(tempTable1));
        assertFalse(UnitTestUtil.isExistTable(tempTable2));
View Full Code Here

        UnitTestUtil.executeUpdate(createSql1);
        UnitTestUtil.executeUpdate(dropSql2);
        UnitTestUtil.executeUpdate(createSql2);
        // テストデータを指定
        File testDataDir = new File("src/test/data/recoverer/executeTest07");
        TestUtils util = new TestUtils(testDataDir);
        // テストデータをセット
        util.storeToDatabase(false);

        // 処理の実行
        String[] args = new String[]{targetName, executionId};
        Recoverer recoverer = new StubRecoverer();
        int result = recoverer.execute(args);

        // 実行結果の検証
        assertEquals(2, result);

        // DBの結果を検証
        util = new TestUtils(new File("src/test/data/recoverer/executeTest07_assert"));
        util.loadFromDatabase();
        if (!util.inspect()) {
            for (Cause cause : util.getCauses()) {
                System.out.println(cause.getMessage());
            }
            fail(util.getCauseMessage());
        }

        // テンポラリテーブルが存在しない事を確認
        assertFalse(UnitTestUtil.isExistTable(tempTable1));
        assertFalse(UnitTestUtil.isExistTable(tempTable2));
View Full Code Here

        UnitTestUtil.executeUpdate(createSql1);
        UnitTestUtil.executeUpdate(dropSql2);
        UnitTestUtil.executeUpdate(createSql2);
        // テストデータを指定
        File testDataDir = new File("src/test/data/recoverer/executeTest08");
        TestUtils util = new TestUtils(testDataDir);
        // テストデータをセット
        util.storeToDatabase(false);

        // 処理の実行
        String[] args = new String[]{targetName, executionId};
        Recoverer recoverer = new StubRecoverer();
        int result = recoverer.execute(args);

        // 実行結果の検証
        assertEquals(2, result);

        // DBの結果を検証
        util = new TestUtils(new File("src/test/data/recoverer/executeTest08_assert"));
        util.loadFromDatabase();
        if (!util.inspect()) {
            for (Cause cause : util.getCauses()) {
                System.out.println(cause.getMessage());
            }
            fail(util.getCauseMessage());
        }

        // テンポラリテーブルが存在しない事を確認
        assertFalse(UnitTestUtil.isExistTable(tempTable1));
        assertFalse(UnitTestUtil.isExistTable(tempTable2));
View Full Code Here

                            break;
                        }
                    }
                }
                try {
                    testUtils = new TestUtils(inFileList);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                createInput(tablename, excelFileName);
            }
View Full Code Here

        UnitTestUtil.executeUpdate(createSql1);
        UnitTestUtil.executeUpdate(dropSql2);
        UnitTestUtil.executeUpdate(createSql2);
        // テストデータを指定
        File testDataDir = new File("src/test/data/recoverer/executeTest09");
        TestUtils util = new TestUtils(testDataDir);
        // テストデータをセット
        util.storeToDatabase(false);

        // 処理の実行
        String[] args = new String[]{targetName, executionId};
        Recoverer recoverer = new StubRecoverer();
        int result = recoverer.execute(args);

        // 実行結果の検証
        assertEquals(2, result);

        // DBの結果を検証
        util = new TestUtils(new File("src/test/data/recoverer/executeTest09_assert"));
        util.loadFromDatabase();
        if (!util.inspect()) {
            for (Cause cause : util.getCauses()) {
                System.out.println(cause.getMessage());
            }
            fail(util.getCauseMessage());
        }

        // テンポラリテーブルが存在しない事を確認
        assertFalse(UnitTestUtil.isExistTable(tempTable1));
        assertFalse(UnitTestUtil.isExistTable(tempTable2));
View Full Code Here

TOP

Related Classes of com.asakusafw.testtools.TestUtils

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.