Index: src/test/java/org/apache/harmony/luni/tests/java/lang/PackageTest.java =================================================================== --- src/test/java/org/apache/harmony/luni/tests/java/lang/PackageTest.java (revision 488932) +++ src/test/java/org/apache/harmony/luni/tests/java/lang/PackageTest.java (working copy) @@ -407,6 +407,56 @@ } } + /** + * Tests that common info for bootstrap packages is correctly read from + * manifests. + */ + public void test_BSPackageInfoCommon() throws Throwable { + Class.forName("org.apache.harmony.luni.tests.pkg1.Bogus"); + + Package p = Package.getPackage("org.apache.harmony.luni.tests.pkg1"); + assertNotNull("missing resource?", p); + + /*Specification-Title: common spec title + Specification-Vendor: common spec vendor + Specification-Version: 1.2.3 + Implementation-Title: common impl title + Implementation-Version: 0.9.8 + Implementation-Vendor: common impl vendor */ + + assertEquals("common spec title", p.getSpecificationTitle()); + assertEquals("common spec vendor", p.getSpecificationVendor()); + assertEquals("1.2.3", p.getSpecificationVersion()); + assertEquals("common impl title", p.getImplementationTitle()); + assertEquals("common impl vendor", p.getImplementationVendor()); + assertEquals("0.9.8", p.getImplementationVersion()); + } + + /** + * Tests that individual bootstrap package info is correctly read from + * manifests. + */ + public void test_BSPackageInfoSpecific() throws Throwable { + Class.forName("org.apache.harmony.luni.tests.pkg2.Bogus"); + + Package p = Package.getPackage("org.apache.harmony.luni.tests.pkg2"); + assertNotNull("missing resource?", p); + + /*Specification-Title: spec title2 + Specification-Vendor: spec vendor2 + Specification-Version: 1.2.3.4.5 + Implementation-Title: impl title2 + Implementation-Version: 0.9.8.7.6 + Implementation-Vendor: impl vendor2*/ + + assertEquals("spec title2", p.getSpecificationTitle()); + assertEquals("spec vendor2", p.getSpecificationVendor()); + assertEquals("1.2.3.4.5", p.getSpecificationVersion()); + assertEquals("impl title2", p.getImplementationTitle()); + assertEquals("impl vendor2", p.getImplementationVendor()); + assertEquals("0.9.8.7.6", p.getImplementationVersion()); + } + @Override protected void setUp() { resources = Support_Resources.createTempFolder();