ManifestUtils { public static String findManifestProperty( String propertyName ) { String result = null; InputStream is = null; try { is = ManifestUtils.class.getResourceAsStream( "/META-INF/MANIFEST.MF" ); Properties props = new Properties(); props.load( is ); result = findManifestProperty( props, propertyName ); } catch( IOException e ) { Logger logger = Logger.getLogger( ManifestUtils.class.getName()); logger.warning( "Could not read the bundle manifest. " + e.getMessage()); } finally { Utils.closeQuietly( is ); } return result; } private  ManifestUtils(); static String findMavenVersion( String bundleVersion ); static String findBundleVersion(); static String findManifestProperty( String propertyName ); static String findManifestProperty( Properties props, String propertyName );  }
@Test public void testFindManifestProperty() { Properties props = new Properties(); Assert.assertNull( ManifestUtils.findManifestProperty( props, BUNDLE_VERSION )); String version = "1.2"; props.put( BUNDLE_VERSION, version ); Assert.assertEquals( version, ManifestUtils.findManifestProperty( props, BUNDLE_VERSION )); }