Fixed properties load

master
Stuart Boston 11 years ago
parent 85eb7a5a4a
commit f908794e2b

@ -98,6 +98,7 @@ public class TestLogger {
InputStream is = null; InputStream is = null;
try { try {
is = new FileInputStream(f); is = new FileInputStream(f);
props.load(is);
} catch (Exception ex) { } catch (Exception ex) {
LOG.warn("Failed to load properties file", ex); LOG.warn("Failed to load properties file", ex);
} finally { } finally {

@ -107,7 +107,6 @@ public class TheMovieDbApiTest {
@BeforeClass @BeforeClass
public static void setUpClass() throws Exception { public static void setUpClass() throws Exception {
TestLogger.Configure(); TestLogger.Configure();
tmdb = new TheMovieDbApi(API_KEY);
Properties props = new Properties(); Properties props = new Properties();
File f = new File(PROP_FIlENAME); File f = new File(PROP_FIlENAME);
@ -118,7 +117,6 @@ public class TheMovieDbApiTest {
API_KEY = props.getProperty("API_Key"); API_KEY = props.getProperty("API_Key");
SESSION_ID_APITESTS = props.getProperty("Account_ID"); SESSION_ID_APITESTS = props.getProperty("Account_ID");
ACCOUNT_ID_APITESTS = NumberUtils.toInt(props.getProperty("Session_ID"), 0); ACCOUNT_ID_APITESTS = NumberUtils.toInt(props.getProperty("Session_ID"), 0);
} else { } else {
LOG.info("Property file '{}' not found, creating dummy file.", PROP_FIlENAME); LOG.info("Property file '{}' not found, creating dummy file.", PROP_FIlENAME);
@ -130,6 +128,7 @@ public class TheMovieDbApiTest {
fail("Failed to get key information from properties file '" + PROP_FIlENAME + "'"); fail("Failed to get key information from properties file '" + PROP_FIlENAME + "'");
} }
tmdb = new TheMovieDbApi(API_KEY);
} }
@AfterClass @AfterClass

Loading…
Cancel
Save