Package com.asakusafw.testtools

Examples of com.asakusafw.testtools.TestUtils


        String dropSql2 = "DROP TABLE IF EXISTS TEMP_IMPORT_TARGET2";
        UnitTestUtil.executeUpdate(dropSql1);
        UnitTestUtil.executeUpdate(dropSql2);
        // テストデータを指定
        File testDataDir = new File("src/test/data/recoverer/executeTest24");
        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());
        }

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


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

        //        // テストデータの指定
//        String pattern = "patternL12";

        // ImportBeanを生成
        Map<String, ImportTargetTableBean> targetTable = new LinkedHashMap<String, ImportTargetTableBean>();
        ImportTargetTableBean tableBean = new ImportTargetTableBean();
        tableBean.setImportTargetColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", "DATEDATA1"}));
        tableBean.setSearchCondition("INTDATA1=11");
        tableBean.setUseCache(false);
        tableBean.setLockType(ImportTableLockType.RECORD);
        tableBean.setLockedOperation(ImportTableLockedOperation.ERROR);
        tableBean.setImportTargetType(null);
        tableBean.setDfsFilePath(null);
        targetTable.put("IMPORT_TARGET1", tableBean);
        ImportBean bean = createBean(new String[]{jobflowId, executionId, "20101021221015", "3", "1"}, targetTable);

        // テスト対象クラス実行
        TargetDataLock lock = new TargetDataLock();
        try {
            lock.lock(bean);
            fail();
        } catch (BulkLoaderReRunnableException e) {
            // ok.
        }

        // 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 lockTest13() throws Exception {
        // テストデータを指定
        File testDataDir = new File("src/test/data/importer/TargetDataLockTest/lockTest13");
        TestUtils util = new TestUtils(testDataDir);
        // テストデータをセット
        util.storeToDatabase(false);

//        // テストデータの指定
//        String pattern = "patternL11";

        // ImportBeanを生成
        Map<String, ImportTargetTableBean> targetTable = new LinkedHashMap<String, ImportTargetTableBean>();
        ImportTargetTableBean tableBean = new ImportTargetTableBean();
        tableBean.setImportTargetColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", "DATEDATA1"}));
        tableBean.setSearchCondition("INTDATA1=11");
        tableBean.setUseCache(false);
        tableBean.setLockType(ImportTableLockType.NONE);
        tableBean.setLockedOperation(ImportTableLockedOperation.ERROR);
        tableBean.setImportTargetType(null);
        tableBean.setDfsFilePath(null);
        targetTable.put("IMPORT_TARGET1", tableBean);
        ImportBean bean = createBean(new String[]{jobflowId, executionId, "20101021221015", "3", "1"}, targetTable);

        // テスト対象クラス実行
        TargetDataLock lock = new TargetDataLock();
        try {
            lock.lock(bean);
            fail();
        } catch (BulkLoaderReRunnableException e) {
            // ok.
        }

        // 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 lockTest14() throws Exception {
        // テストデータを指定
        File testDataDir = new File("src/test/data/importer/TargetDataLockTest/lockTest14");
        TestUtils util = new TestUtils(testDataDir);
        // テストデータをセット
        util.storeToDatabase(false);

//        // テストデータの指定
//        String pattern = "patternL12";

        // ImportBeanを生成
        Map<String, ImportTargetTableBean> targetTable = new LinkedHashMap<String, ImportTargetTableBean>();
        ImportTargetTableBean tableBean = new ImportTargetTableBean();
        tableBean.setImportTargetColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", "DATEDATA1"}));
        tableBean.setSearchCondition("INTDATA1=11");
        tableBean.setUseCache(false);
        tableBean.setLockType(ImportTableLockType.NONE);
        tableBean.setLockedOperation(ImportTableLockedOperation.ERROR);
        tableBean.setImportTargetType(null);
        tableBean.setDfsFilePath(null);
        targetTable.put("IMPORT_TARGET1", tableBean);
        ImportBean bean = createBean(new String[]{jobflowId, executionId, "20101021221015", "3", "1"}, targetTable);

        // テスト対象クラス実行
        TargetDataLock lock = new TargetDataLock();
        try {
            lock.lock(bean);
            fail();
        } catch (BulkLoaderReRunnableException e) {
            // ok.
        }

        // 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 lockTest15() throws Exception {
        // テストデータを指定
        File testDataDir = new File("src/test/data/importer/TargetDataLockTest/lockTest15");
        TestUtils util = new TestUtils(testDataDir);
        // テストデータをセット
        util.storeToDatabase(false);

        //        // テストデータの指定
//        String pattern = "patternL13";

        // テスト対象クラス実行
        TargetDataLock lock = new TargetDataLock();
        String result = lock.insertRunningJobFlow("target1", "BATCH01", jobflowId, executionId, new Date());

        // 実行結果の検証
       assertNotNull(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 lockTest16() throws Exception {
        // テストデータを指定
        File testDataDir = new File("src/test/data/importer/TargetDataLockTest/lockTest16");
        TestUtils util = new TestUtils(testDataDir);
        // テストデータをセット
        util.storeToDatabase(false);

        //        // テストデータの指定
//        String pattern = "patternL09";

        // ImportBeanを生成
        Map<String, ImportTargetTableBean> targetTable = new LinkedHashMap<String, ImportTargetTableBean>();
        ImportTargetTableBean tableBean = new ImportTargetTableBean();
        tableBean.setImportTargetColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", "DATEDATA1"}));
        tableBean.setSearchCondition(null);
        tableBean.setUseCache(false);
        tableBean.setLockType(ImportTableLockType.RECORD);
        tableBean.setLockedOperation(ImportTableLockedOperation.OFF);
        tableBean.setImportTargetType(null);
        tableBean.setDfsFilePath(null);
        targetTable.put("IMPORT_TARGET1", tableBean);
        ImportBean bean = createBean(new String[]{jobflowId, executionId, "20101021221015", "3", "1"}, targetTable);

        // テスト対象クラス実行
        TargetDataLock lock = new TargetDataLock();
        boolean result = lock.lock(bean);

        // 実行結果の検証
       assertTrue(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 receiveFileTest01() throws Exception {
        // テストデータを指定
        File testDataDir = new File("src/test/data/exporter/ExportFileReceiveTest");
        TestUtils util = new TestUtils(testDataDir);
        // テストデータをセット
        util.storeToDatabase(false);

        // ExportBeanを生成
        Map<String, ExportTargetTableBean> targetTable = new LinkedHashMap<String, ExportTargetTableBean>();
        ExportTargetTableBean table1 = new ExportTargetTableBean();
        targetTable.put("EXP_TARGET1", table1);
View Full Code Here

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

        // ExportBeanを生成
        Map<String, ExportTargetTableBean> targetTable = new LinkedHashMap<String, ExportTargetTableBean>();
        ExportTargetTableBean table1 = new ExportTargetTableBean();
        targetTable.put("EXP_TARGET1", table1);
View Full Code Here

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

        // ExportBeanを生成
        Map<String, ExportTargetTableBean> targetTable = new LinkedHashMap<String, ExportTargetTableBean>();
        ExportTargetTableBean table1 = new ExportTargetTableBean();
        targetTable.put("EXP_TARGET1", table1);
View Full Code Here

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

//        // テストデータの指定
//        String pattern = "patternR01";

        // ExportBeanを生成
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.