/** * checkEnvのテストケース 異常系:"ASAKUSA_HOME"の設定が不正のケース * * @throws Exception */ @Test public void checkEnvTest04() throws Exception { ConfigurationLoader.init(properties_db, true, false); Map<String, String> m = new HashMap<String, String>(); m.put(Constants.ASAKUSA_HOME, "J:\temp"); m.put( Constants.THUNDER_GATE_HOME, ConfigurationLoader.getEnvProperty(Constants.THUNDER_GATE_HOME)); ConfigurationLoader.setEnv(m); Properties p = System.getProperties(); p.setProperty(Constants.ASAKUSA_HOME, "J:\temp"); p.setProperty(Constants.THUNDER_GATE_HOME, "src/test"); ConfigurationLoader.setSysProp(p); System.setProperties(p); try { ConfigurationLoader.checkEnv(); fail(); } catch (Exception e) { assertTrue(e instanceof Exception); System.out.println(e.getMessage()); e.printStackTrace(); } }
/** * 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(); } }