BuildPropertiesParserImpl implements BuildPropertiesParser, Disposable { protected static Properties readProperties(File propsFile) { Properties properties = new Properties(); if (propsFile.canRead()) { InputStream is = null; try { try { is = new FileInputStream(propsFile); properties.load(is); } finally { if (is != null) { is.close(); } } } catch (IOException e) { } } return properties; } BuildPropertiesParserImpl(); protected  BuildPropertiesParserImpl(LegacySupport legacySupport, Logger logger); @Override BuildProperties parse(File baseDir); @Override void dispose();  }
@Test public void testReadPropertiesFileWithExistingFile() throws IOException { File baseDir = TestUtil.getBasedir("buildproperties"); Properties properties = BuildPropertiesParserImpl.readProperties(new File(baseDir, "build.properties")); Assert.assertEquals(3, properties.size()); }
@Test public void testReadPropertiesWithNonExistingFile() { Properties properties = BuildPropertiesParserImpl.readProperties(new File("MISSING_FILE")); Assert.assertEquals(0, properties.size()); }