private Properties loadTestProperties() throws IOException {
  FileInputStream fis=null;
  try {
    String testEnv=System.getProperty("TEST_ENV") != null ? System.getProperty("TEST_ENV") : "local";
    File envFile=new File("config/" + testEnv + "/environment.properties");
    Properties properties=new Properties();
    fis=new FileInputStream(envFile);
    properties.load(fis);
    return properties;
  }
  finally {
    try {
      if (fis != null) {
        fis.close();
      }
    }
 catch (    IOException e) {
      throw new IOException("could not load the test environment properties");
    }
  }
}

private Properties loadTestProperties ( ) throws IOException { FileInputStream fis = null ; try { String testEnv = System . getProperty ( "TEST_ENV" ) != null ? System . getProperty ( "TEST_ENV" ) : "local" ; File envFile = new File ( "config/" + testEnv + "/environment.properties" ) ; Properties properties = new Properties ( ) ; fis = new FileInputStream ( envFile ) ; properties . load ( fis ) ; return properties ; } finally { try { if ( fis != null ) { fis . close ( ) ; } } catch ( IOException e ) { throw new IOException ( "could not load the test environment properties" ) ; } } }
load properties from a property file
