Package org.apache.harmony.pack200

Examples of org.apache.harmony.pack200.CpBands


            assertTrue(true);
        }
    }

    public void testByte1Signed() throws Exception {
        Codec BYTE1S2 = new BHSDCodec(1, 256, 2);
        decode(BYTE1S2, new byte[] { 0 }, 0, 0);
        decode(BYTE1S2, new byte[] { 1 }, 1, 0);
        decode(BYTE1S2, new byte[] { 2 }, 2, 0);
        decode(BYTE1S2, new byte[] { 3 }, -1, 0);
        decode(BYTE1S2, new byte[] { 4 }, 3, 0);
View Full Code Here


*
*/
public class CodecEncodingTest extends TestCase {

    public void testCanonicalEncodings() throws IOException, Pack200Exception {
        Codec defaultCodec = new BHSDCodec(2, 16, 0, 0);
        assertEquals(defaultCodec, CodecEncoding
                .getCodec(0, null, defaultCodec));
        Map map = new HashMap();
        // These are the canonical encodings specified by the Pack200 spec
        map.put(new Integer(1), "(1,256)");
View Full Code Here

*/
public class SegmentConstantPoolTest extends TestCase {

    public class MockSegmentConstantPool extends SegmentConstantPool {
        public MockSegmentConstantPool() {
          super(new CpBands(new Segment()));
        };
View Full Code Here

*/
public class SegmentConstantPoolTest extends TestCase {

    public class MockSegmentConstantPool extends SegmentConstantPool {
        public MockSegmentConstantPool() {
          super(new CpBands(new Segment()));
        };
View Full Code Here

     * @throws Pack200Exception
     *             if the minor version is not 7
     */
    private void setArchiveMinorVersion(int version) throws Pack200Exception {
        if (version != 7)
            throw new Pack200Exception("Invalid segment minor version");
        archiveMinor = version;
    }
View Full Code Here

     * @throws Pack200Exception
     *             if the major version is not 150
     */
    private void setArchiveMajorVersion(int version) throws Pack200Exception {
        if (version != 150)
            throw new Pack200Exception("Invalid segment major version: "
                    + version);
        archiveMajor = version;
    }
View Full Code Here

    public void testSQL() throws IOException, Pack200Exception, URISyntaxException {
        in = new JarFile(new File(Archive.class.getResource(
                "/org/apache/harmony/pack200/tests/sqlUnpacked.jar").toURI()));
        file = File.createTempFile("sql", ".pack");
        out = new FileOutputStream(file);
        PackingOptions options = new PackingOptions();
        options.setGzip(false);
        Archive ar = new Archive(in, out, options);
        ar.pack();
        in.close();
        out.close();
View Full Code Here

        in = new JarFile(new File(Archive.class.getResource(
                "/org/apache/harmony/pack200/tests/largeClassUnpacked.jar")
                .toURI()));
        file = File.createTempFile("largeClass", ".pack");
        out = new FileOutputStream(file);
        PackingOptions options = new PackingOptions();
        options.setGzip(false);
        new Archive(in, out, options).pack();
        in.close();
        out.close();

        // now unpack
View Full Code Here

    public void testJNDI() throws IOException, Pack200Exception, URISyntaxException {
        in = new JarFile(new File(Archive.class.getResource(
                "/org/apache/harmony/pack200/tests/jndi.jar").toURI()));
        file = File.createTempFile("jndi", ".pack");
        out = new FileOutputStream(file);
        PackingOptions options = new PackingOptions();
        options.setGzip(false);
        new Archive(in, out, options).pack();
        in.close();
        out.close();

        // now unpack
View Full Code Here

            URISyntaxException {
        in = new JarFile(new File(Archive.class.getResource(
                "/org/apache/harmony/pack200/tests/hw.jar").toURI()));
        file = File.createTempFile("helloworld", ".pack.gz");
        out = new FileOutputStream(file);
        PackingOptions options = new PackingOptions();
        options.setSegmentLimit(0);
        Archive archive = new Archive(in, out, options);
        archive.pack();
        in.close();
        out.close();

        in = new JarFile(new File(Archive.class.getResource(
                "/org/apache/harmony/pack200/tests/hw.jar").toURI()));
        file = File.createTempFile("helloworld", ".pack.gz");
        out = new FileOutputStream(file);
        options = new PackingOptions();
        options.setSegmentLimit(-1);
        archive = new Archive(in, out, options);
        archive.pack();
        in.close();
        out.close();

        in = new JarFile(new File(Archive.class.getResource(
                "/org/apache/harmony/pack200/tests/hw.jar").toURI()));
        file = File.createTempFile("helloworld", ".pack.gz");
        out = new FileOutputStream(file);
        options = new PackingOptions();
        options.setSegmentLimit(5000);
        archive = new Archive(in, out, options);
        archive.pack();
        in.close();
        out.close();
    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.pack200.CpBands

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.