Package com.asakusafw.bulkloader.bean

Examples of com.asakusafw.bulkloader.bean.ImportTargetTableBean


    public void update_cache_inconsistent_model() throws Exception {
        ImportBean bean = createBean();

        Map<String, ImportTargetTableBean> targetTable = new HashMap<String, ImportTargetTableBean>();

        final ImportTargetTableBean tb1 = new ImportTargetTableBean();
        tb1.setCacheId("tb1");
        tb1.setDfsFilePath("tb1");
        tb1.setImportTargetType(ImportTarget1.class);
        tb1.setImportTargetColumns(Arrays.asList("A"));
        tb1.setSearchCondition("");
        targetTable.put("__TG_TEST1", tb1);

        Connection conn = DBConnection.getConnection();
        try {
            LocalCacheInfoRepository repo = new LocalCacheInfoRepository(conn);
            repo.putCacheInfo(new LocalCacheInfo(
                    tb1.getCacheId(),
                    null,
                    null,
                    "__TG_TEST1",
                    tb1.getDfsFilePath()));

        } finally {
            DBConnection.closeConn(conn);
        }

        bean.setTargetTable(targetTable);
        ImportProtocolDecide service = new ImportProtocolDecide() {
            @Override
            protected Map<String, CacheInfo> collectRemoteCacheInfo(ImportBean _)
                    throws BulkLoaderSystemException {
                return Collections.singletonMap("tb1", new CacheInfo(
                        CacheInfo.FEATURE_VERSION,
                        tb1.getCacheId(),
                        offset(-1),
                        "__TG_TEST1",
                        tb1.getImportTargetColumns(),
                        tb1.getImportTargetType().getName(),
                        new ImportTarget1().__tgc__DataModelVersion() + 1));
            }
        };
        service.execute(bean);

        assertThat(tb1.getImportProtocol().getKind(), is(FileProtocol.Kind.CREATE_CACHE));
    }
View Full Code Here


     */
    @Test
    public void conflict_lock() throws Exception {
        ImportBean bean1 = createBean();
        Map<String, ImportTargetTableBean> targetTable1 = new HashMap<String, ImportTargetTableBean>();
        ImportTargetTableBean tb1 = new ImportTargetTableBean();
        tb1.setCacheId("tb1");
        tb1.setDfsFilePath("tb1");
        tb1.setImportTargetType(ImportTarget1.class);
        tb1.setImportTargetColumns(Arrays.asList("A"));
        tb1.setSearchCondition("");
        targetTable1.put("__TG_TEST1", tb1);
        bean1.setTargetTable(targetTable1);

        ImportBean bean2 = createBean();
        Map<String, ImportTargetTableBean> targetTable2 = new HashMap<String, ImportTargetTableBean>();
        ImportTargetTableBean tb2 = new ImportTargetTableBean();
        tb2.setCacheId("tb1");
        tb2.setDfsFilePath("tb1");
        tb2.setImportTargetType(ImportTarget1.class);
        tb2.setImportTargetColumns(Arrays.asList("A"));
        tb2.setSearchCondition("");
        targetTable2.put("__TG_TEST1", tb2);
        bean2.setTargetTable(targetTable2);

        ImportProtocolDecide service = new ImportProtocolDecide() {
            @Override
View Full Code Here

     */
    @Test
    public void release_lock() throws Exception {
        ImportBean bean1 = createBean();
        Map<String, ImportTargetTableBean> targetTable1 = new HashMap<String, ImportTargetTableBean>();
        ImportTargetTableBean tb1 = new ImportTargetTableBean();
        tb1.setCacheId("tb1");
        tb1.setDfsFilePath("tb1");
        tb1.setImportTargetType(ImportTarget1.class);
        tb1.setImportTargetColumns(Arrays.asList("A"));
        tb1.setSearchCondition("");
        targetTable1.put("__TG_TEST1", tb1);
        bean1.setTargetTable(targetTable1);

        ImportBean bean2 = createBean();
        Map<String, ImportTargetTableBean> targetTable2 = new HashMap<String, ImportTargetTableBean>();
        ImportTargetTableBean tb2 = new ImportTargetTableBean();
        tb2.setCacheId("tb1");
        tb2.setDfsFilePath("tb1");
        tb2.setImportTargetType(ImportTarget1.class);
        tb2.setImportTargetColumns(Arrays.asList("A"));
        tb2.setSearchCondition("");
        targetTable2.put("__TG_TEST1", tb2);
        bean2.setTargetTable(targetTable2);

        ImportProtocolDecide service = new ImportProtocolDecide() {
            @Override
View Full Code Here

//        // テストデータの指定
//        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();
View Full Code Here

//        // テストデータの指定
//        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();
View Full Code Here

        //        // テストデータの指定
//        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();
View Full Code Here

TOP

Related Classes of com.asakusafw.bulkloader.bean.ImportTargetTableBean

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.