*/
@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());
}
}