/** * set up. * @throws Exception if failed */ @Before public void setUp() throws Exception { BulkLoaderInitializer.initDBServer(testJobflowId, testExecutionId, properties, "target1"); UnitTestUtil.setUpDB(); UnitTestUtil.startUp(); Connection connection = DBConnection.getConnection(); Statement statement = null; try { statement = connection.createStatement(); statement.execute("DROP TABLE IF EXISTS __TG_TEST1"); statement.execute("DROP TABLE IF EXISTS __TG_TEST2"); statement.execute("CREATE TABLE __TG_TEST1 ( VALUE DATETIME ) ENGINE=InnoDB"); statement.execute("CREATE TABLE __TG_TEST2 ( VALUE VARCHAR(200) ) ENGINE=InnoDB"); } finally { connection.close(); } }
/** * checkEnvのテストケース 異常系:"BULKLOADER_HOME"が設定されていないケース * * @throws Exception */ @Test public void checkEnvTest01() throws Exception { ConfigurationLoader.init(properties_db, true, false); Map<String, String> m = new HashMap<String, String>(); m.put(Constants.ASAKUSA_HOME, ConfigurationLoader.getEnvProperty(Constants.ASAKUSA_HOME)); m.put(Constants.THUNDER_GATE_HOME, null); ConfigurationLoader.setEnv(m); UnitTestUtil.tearDownEnv(); try { ConfigurationLoader.checkEnv(); fail(); } catch (Exception e) { assertTrue(e instanceof Exception); System.out.println(e.getMessage()); e.printStackTrace(); } }
@Before public void setUp() throws Exception { UnitTestUtil.setUpEnv(); ConfigurationLoader.cleanProp(); }
@AfterClass public static void tearDownAfterClass() throws Exception { UnitTestUtil.tearDownAfterClass(); }
@BeforeClass public static void setUpBeforeClass() throws Exception { UnitTestUtil.setUpBeforeClass(); UnitTestUtil.setUpEnv(); }