Examples of ExportTargetTableBean


Examples of com.asakusafw.bulkloader.bean.ExportTargetTableBean

    public void checkExportParamTest14() throws Exception {
        JobFlowParamLoader loader = new JobFlowParamLoader();

        // 設定
        Map<String, ExportTargetTableBean> targetTable = new LinkedHashMap<String, ExportTargetTableBean>();
        ExportTargetTableBean table1 = new ExportTargetTableBean();
        // 重複チェックを行うか否か
        table1.setDuplicateCheck(false);
        // Export対象テーブルに対応する異常データテーブル
        table1.setErrorTableName(null);
        // Export中間TSVファイルに対応するカラム名
        table1.setExportTsvColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", "DATEDATA1"}));
        // Export対象テーブルのカラム名
        table1.setExportTableColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", "DATEDATA2"}));
        // 異常データテーブルのカラム名
        table1.setErrorTableColumns(Arrays.asList(new String[]{}));
        // キー項目のカラム名
        table1.setKeyColumns(Arrays.asList(new String[]{}));
        // エラーコードを格納するカラム名
        table1.setErrorCodeColumn(null);
        // 重複チェックエラーのエラーコードの値
        table1.setErrorCode(null);
        // Export対象テーブルに対応するJavaBeanのクラス名
        table1.setExportTargetType(this.getClass());
        // Export対象テーブルのデータをHDFS上に書き出す際のファイルパス
        List<String> list1 = new ArrayList<String>();
        list1.add("hdfs://localhost/user/asakusa/import/11/XXX_1");
        table1.setDfsFilePaths(list1);
        targetTable.put("EXP_TARGET1", table1);

        // テスト実行
        boolean result = loader.checkExportParam(targetTable, targetName, "1", "dummyFileName");
        assertFalse(result);
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ExportTargetTableBean

        // テストデータをセット
        util1.storeToDatabase(false);

        // ExportBeanを生成
        Map<String, ExportTargetTableBean> targetTable = new LinkedHashMap<String, ExportTargetTableBean>();
        ExportTargetTableBean table1 = new ExportTargetTableBean();
        table1.setDuplicateCheck(false);
        table1.addExportFile(new File(new File ("src/test/data/exporter/EXP_EXP_TARGET1_1.tsv").getAbsolutePath()));
        table1.addExportFile(new File(new File ("src/test/data/exporter/EXP_EXP_TARGET1_2.tsv").getAbsolutePath()));
        table1.setExportTsvColumns(Arrays.asList(new String[]{"SID", "VERSION_NO", "TEXTDATA1", "INTDATA1", "DATEDATA1"}));
        targetTable.put("IMPORT_TARGET1", table1);
        ExportTargetTableBean table2 = new ExportTargetTableBean();
        table2.setDuplicateCheck(false);
        table2.addExportFile(new File(new File ("src/test/data/exporter/EXP_EXP_TARGET2_1.tsv").getAbsolutePath()));
        table2.setExportTsvColumns(Arrays.asList(new String[]{"TEXTDATA2", "DATEDATA2"}));
        targetTable.put("IMPORT_TARGET2", table2);
        ExporterBean bean = new ExporterBean();
        bean.setExportTargetTable(targetTable);
        bean.setJobflowSid("11");
        bean.setJobflowId(jobflowId);
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ExportTargetTableBean

        // テストデータをセット
        util1.storeToDatabase(false);

        // ExportBeanを生成
        Map<String, ExportTargetTableBean> targetTable = new LinkedHashMap<String, ExportTargetTableBean>();
        ExportTargetTableBean table1 = new ExportTargetTableBean();
        table1.setDuplicateCheck(true);
        table1.addExportFile(new File(new File ("src/test/data/exporter/EXP_EXP_TARGET1_4.tsv").getAbsolutePath()));
        table1.setExportTsvColumns(Arrays.asList(new String[]{"SID", "VERSION_NO", "TEXTDATA1", "INTDATA1", "DATEDATA1"}));
        table1.setExportTableColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", "DATEDATA1"}));
        table1.setKeyColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1"}));
        table1.setErrorTableName("IMPORT_TARGET1_ERROR");
        table1.setErrorTableColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", "DATEDATA1"}));
        targetTable.put("IMPORT_TARGET1", table1);
        ExporterBean bean = new ExporterBean();
        bean.setExportTargetTable(targetTable);
        bean.setJobflowSid("11");
        bean.setJobflowId(jobflowId);
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ExportTargetTableBean

    public void checkExportParamTest15() throws Exception {
        JobFlowParamLoader loader = new JobFlowParamLoader();

        // 設定
        Map<String, ExportTargetTableBean> targetTable = new LinkedHashMap<String, ExportTargetTableBean>();
        ExportTargetTableBean table1 = new ExportTargetTableBean();
        // 重複チェックを行うか否か
        table1.setDuplicateCheck(false);
        // Export対象テーブルに対応する異常データテーブル
        table1.setErrorTableName(null);
        // Export中間TSVファイルに対応するカラム名
        table1.setExportTsvColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", "DATEDATA1"}));
        // Export対象テーブルのカラム名
        table1.setExportTableColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1"}));
        // 異常データテーブル名
        table1.setErrorTableName("ERROR_TABLE");
        // 重複チェック有り
        table1.setDuplicateCheck(true);
        // 異常データテーブルのカラム名
        table1.setErrorTableColumns(Arrays.asList(new String[]{"TEXTDATA1", "INTDATA1", "ERROR_INFO"}));
        // キー項目のカラム名
        table1.setKeyColumns(Arrays.asList(new String[]{}));
        // エラーコードを格納するカラム名
        table1.setErrorCodeColumn(null);
        // 重複チェックエラーのエラーコードの値
        table1.setErrorCode(null);
        // Export対象テーブルに対応するJavaBeanのクラス名
        table1.setExportTargetType(this.getClass());
        // Export対象テーブルのデータをHDFS上に書き出す際のファイルパス
        List<String> list1 = new ArrayList<String>();
        list1.add("hdfs://localhost/user/asakusa/import/11/XXX_1");
        table1.setDfsFilePaths(list1);
        targetTable.put("EXP_TARGET1", table1);

        // テスト実行
        boolean result = loader.checkExportParam(targetTable, targetName, "1", "dummyFileName");
        assertFalse(result);
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ExportTargetTableBean

        // テストデータをセット
        util1.storeToDatabase(false);

        // ExportBeanを生成
        Map<String, ExportTargetTableBean> targetTable = new LinkedHashMap<String, ExportTargetTableBean>();
        ExportTargetTableBean table1 = new ExportTargetTableBean();
        table1.setDuplicateCheck(true);
        table1.addExportFile(new File(new File ("src/test/data/exporter/EXP_EXP_TARGET1_1.tsv").getAbsolutePath()));
        table1.addExportFile(new File(new File ("src/test/data/exporter/EXP_EXP_TARGET1_2.tsv").getAbsolutePath()));
        table1.setExportTsvColumns(Arrays.asList(new String[]{"SID", "VERSION_NO", "TEXTDATA1", "INTDATA1", "DATEDATA1"}));
        table1.setExportTableColumns(Arrays.asList(new String[]{"SID", "VERSION_NO", "TEXTDATA1"}));
        table1.setErrorTableColumns(Arrays.asList(new String[]{"INTDATA1"}));
        targetTable.put("IMPORT_TARGET1", table1);
        ExporterBean bean = new ExporterBean();
        bean.setExportTargetTable(targetTable);
        bean.setJobflowSid("11");
        bean.setJobflowId(jobflowId);
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ExportTargetTableBean

        // HDFS上の出力パス
        assertEquals("/asakusa/import/11/ZZZ", impTable3.getDfsFilePath());

        // Export設定の検証
        // テーブルXXXの検証
        ExportTargetTableBean expTable1 = exportTargetTable.get("XXX");
        // 重複チェックを行うか否か
        assertTrue(expTable1.isDuplicateCheck());
        // Export対象テーブルに対応する異常データテーブル
        assertEquals("XXX_ERROR", expTable1.getErrorTableName());
        // Export中間TSVファイルに対応するカラム名
        assertEquals(5, expTable1.getExportTsvColumn().size());
        assertEquals("columnA", expTable1.getExportTsvColumn().get(0));
        assertEquals("columnB", expTable1.getExportTsvColumn().get(1));
        assertEquals("columnC", expTable1.getExportTsvColumn().get(2));
        assertEquals("columnD", expTable1.getExportTsvColumn().get(3));
        assertEquals("columnE", expTable1.getExportTsvColumn().get(4));
        // Export対象テーブルのカラム名
        assertEquals(2, expTable1.getExportTableColumns().size());
        assertEquals("columnA", expTable1.getExportTableColumns().get(0));
        assertEquals("columnB", expTable1.getExportTableColumns().get(1));
        // 異常データテーブルのカラム名
        assertEquals(5, expTable1.getErrorTableColumns().size());
        assertEquals("columnA", expTable1.getErrorTableColumns().get(0));
        assertEquals("columnB", expTable1.getErrorTableColumns().get(1));
        assertEquals("columnC", expTable1.getErrorTableColumns().get(2));
        assertEquals("columnD", expTable1.getErrorTableColumns().get(3));
        assertEquals("columnE", expTable1.getErrorTableColumns().get(4));
        // キー項目のカラム名
        assertEquals(1, expTable1.getKeyColumns().size());
        assertEquals("columnA", expTable1.getKeyColumns().get(0));
        // エラーコードを格納するカラム名
        assertEquals("columnF", expTable1.getErrorCodeColumn());
        // 重複チェックエラーのエラーコードの値
        assertEquals("ER01", expTable1.getErrorCode());
        // Export対象テーブルに対応するJavaBeanのクラス名
        assertEquals("com.asakusafw.bulkloader.bean.ImportTargetTableBean", expTable1.getExportTargetType().getName());
        // Export対象テーブルのデータをHDFS上に書き出す際のファイルパス
        List<String> path1 = expTable1.getDfsFilePaths();
        assertEquals(2, path1.size());
        assertEquals("/asakusa/import/11/XXX_1", path1.get(0));
        assertEquals("/asakusa/import/11/XXX_2", path1.get(1));

        // テーブルYYYの検証
        ExportTargetTableBean expTable2 = exportTargetTable.get("YYY");
        // 重複チェックを行うか否か
        assertFalse(expTable2.isDuplicateCheck());
        // Export対象テーブルに対応する異常データテーブル
        assertNull(expTable2.getErrorTableName());
        // Export中間TSVファイルに対応するカラム名
        assertEquals(3, expTable2.getExportTsvColumn().size());
        assertEquals("columnA", expTable2.getExportTsvColumn().get(0));
        assertEquals("columnB", expTable2.getExportTsvColumn().get(1));
        assertEquals("columnC", expTable2.getExportTsvColumn().get(2));
        // Export対象テーブルのカラム名
        assertEquals(3, expTable2.getExportTableColumns().size());
        assertEquals("columnA", expTable2.getExportTableColumns().get(0));
        assertEquals("columnB", expTable2.getExportTableColumns().get(1));
        assertEquals("columnC", expTable2.getExportTableColumns().get(2));
        // 異常データテーブルのカラム名
        assertEquals(0, expTable2.getErrorTableColumns().size());
        // キー項目のカラム名
        assertEquals(0, expTable2.getKeyColumns().size());
        // エラーコードを格納するカラム名
        assertNull(expTable2.getErrorCodeColumn());
        // 重複チェックエラーのエラーコードの値
        assertNull(expTable2.getErrorCode());
        // Export対象テーブルに対応するJavaBeanのクラス名
        assertEquals("com.asakusafw.bulkloader.bean.ImportBean", expTable2.getExportTargetType().getName());
        // Export対象テーブルのデータをHDFS上に書き出す際のファイルパス
        List<String> path2 = expTable2.getDfsFilePaths();
        assertEquals(1, path2.size());
        assertEquals("/asakusa/import/11/YYY", path2.get(0));

        // テーブルZZZの検証
        ExportTargetTableBean expTable3 = exportTargetTable.get("ZZZ");
        // 重複チェックを行うか否か
        assertFalse(expTable3.isDuplicateCheck());
        // Export対象テーブルに対応する異常データテーブル
        assertNull(expTable3.getErrorTableName());
        // Export中間TSVファイルに対応するカラム名
        assertEquals(1, expTable3.getExportTsvColumn().size());
        assertEquals("columnA", expTable3.getExportTsvColumn().get(0));
        // Export対象テーブルのカラム名
        assertEquals(1, expTable3.getExportTableColumns().size());
        assertEquals("columnA", expTable3.getExportTableColumns().get(0));
        // 異常データテーブルのカラム名
        assertEquals(0, expTable3.getErrorTableColumns().size());
        // キー項目のカラム名
        assertEquals(0, expTable3.getKeyColumns().size());
        // エラーコードを格納するカラム名
        assertNull(expTable3.getErrorCodeColumn());
        // 重複チェックエラーのエラーコードの値
        assertNull(expTable3.getErrorCode());
        // Export対象テーブルに対応するJavaBeanのクラス名
        assertEquals("com.asakusafw.bulkloader.bean.ExporterBean", expTable3.getExportTargetType().getName());
        // Export対象テーブルのデータをHDFS上に書き出す際のファイルパス
        List<String> path3 = expTable3.getDfsFilePaths();
        assertEquals(1, path3.size());
        assertEquals("/asakusa/import/11/ZZZ", path3.get(0));

    }
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ExportTargetTableBean

       // テストデータをセット
       util1.storeToDatabase(false);

       // ExportBeanを生成
       Map<String, ExportTargetTableBean> targetTable = new LinkedHashMap<String, ExportTargetTableBean>();
       ExportTargetTableBean table1 = new ExportTargetTableBean();
       table1.setDuplicateCheck(true);
       table1.addExportFile(new File(new File ("src/test/data/exporter/EXP_EXP_TARGET1_1.tsv").getAbsolutePath()));
       table1.addExportFile(new File(new File ("src/test/data/exporter/EXP_EXP_TARGET1_2.tsv").getAbsolutePath()));
       table1.setExportTsvColumns(Arrays.asList(new String[]{"SID", "VERSION_NO", "TEXTDATA1", "INTDATA2", "DATEDATA2"}));
       table1.setExportTableColumns(Arrays.asList(new String[] {"SID", "VERSION_NO", "TEXTDATA1"}));
       table1.setKeyColumns(Arrays.asList(new String[]{"TEXTDATA1"}));
       table1.setErrorTableName("IMPORT_TARGET2_ERROR");
       table1.setErrorTableColumns(Arrays.asList(new String[] {"SID", "VERSION_NO", "INTDATA2", "DATEDATA2"}));
       targetTable.put("IMPORT_TARGET1", table1);
       ExporterBean bean = new ExporterBean();
       bean.setExportTargetTable(targetTable);
       bean.setJobflowSid("11");
       bean.setJobflowId(jobflowId);
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ExportTargetTableBean

     */
    @Ignore
    @Test
    public void createTableSql01() throws Exception {
        // 入力値を生成
        ExportTargetTableBean tableBean = new ExportTargetTableBean();
        tableBean.setDuplicateCheck(true);
        tableBean.setErrorTableName("IMPORT_TARGET1_ERROR");
        tableBean.setExportTsvColumns(Arrays.asList(new String[]{"aaa", "SID", "VERSION_NO", "RGST_DATE", "UPDT_DATE", "TEMP_SID", "DUPLICATE_FLG", "bbb", "ccc"}));

        // テスト対象クラス実行
        ExportFileLoad load = new ExportFileLoad();
        String result = load.createTableSql("IMPORT_TARGET1", "EXPORT_TEMP_IMPORT_TARGET1_3", tableBean);

View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ExportTargetTableBean

     */
    @Ignore
    @Test
    public void createTableSql02() throws Exception {
        // 入力値を生成
        ExportTargetTableBean tableBean = new ExportTargetTableBean();
        tableBean.setDuplicateCheck(false);
        tableBean.setErrorTableName("IMPORT_TARGET1_ERROR");
        tableBean.setExportTsvColumns(Arrays.asList(new String[]{"aaa", "bbb", "ccc"}));

        // テスト対象クラス実行
        ExportFileLoad load = new ExportFileLoad();
        String result = load.createTableSql("IMPORT_TARGET1", "EXPORT_TEMP_IMPORT_TARGET1_3", tableBean);

View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ExportTargetTableBean

        ExporterBean bean = new ExporterBean();
        bean.setJobflowSid(null);
        bean.setJobflowId("jobflow1");
        bean.setExecutionId("11-1");
        Map<String, ExportTargetTableBean> targetTable = new HashMap<String, ExportTargetTableBean>();
        targetTable.put("table1", new ExportTargetTableBean());
        targetTable.put("table2", new ExportTargetTableBean());
        bean.setExportTargetTable(targetTable);

        Properties p = ConfigurationLoader.getProperty();
        p.setProperty(Constants.PROP_KEY_EXPORT_TSV_DELETE, TsvDeleteType.TRUE.getSymbol());
        ConfigurationLoader.setProperty(p);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.