2668N/AThe files contained in the golden.jar have been harvested from many
2668N/Adifferent sources, some are hand-crafted invalid class files (odds directory),
2668N/Aor from random JDK builds.
2668N/A
2668N/AGenerally these files serve to ensure the integrity of the packer and unpacker
2668N/Aby,
2668N/A 1. maximizing the test coverage.
2668N/A 2. exercising all the Bands in the pack200 specification.
2668N/A 2. testing the behavior of the packer with invalid classes.
2668N/A 3. testing the archive integrity, ordering and description (date, sizes,
2668N/A CRC etc.)
2668N/A
2668N/ABuild:
2668N/ATo rebuild this JAR follow these steps:
2668N/A 1. unzip the golden.jar to some directory lets call it "example"
2668N/A 2. now we can add any directories with files into example.
2668N/A 2. run the script BUILDME.sh as
2668N/A % sh BUILDME.sh example
2668N/A
2668N/ANote: the BUILDME.sh is known to work on all Unix platforms as well as Windows
2668N/A using Cygwin.
2668N/A
2668N/AThe above will create two JAR files in the current directory,
2668N/Aexample.jar and example-cls.jar, now the example.jar can be used as the
2668N/Agolden.jar.
2668N/A
2668N/ATo ensure the JAR has been built correctly use jar -tvf and compare the
2668N/Aresults of the old jar and the newly built one, note that the compressed sizes
2668N/Amay differ, however the timestamps etc. should be consistent.
2668N/A
2668N/ATest:
2668N/A Basic:
2668N/A % pack200 --repack test.jar golden.jar
2668N/A
2668N/A Advanced:
2668N/A Create a pack.conf as follows:
2668N/A % cat pack.conf
2668N/A com.sun.java.util.jar.pack.dump.bands=true
2668N/A
2668N/A % pack200 --no-gzip --config-file=pack.conf \
2668N/A --verbose golden.jar.pack golden.jar
2668N/A
2668N/A This command will dump the Bands in a unique directory BD_XXXXXX,
2668N/A one can inspect the directory to ensure all of the bands are being
2668N/A generated. Familiarity of the Pack200 specification is suggested.