Package org.apache.harmony.pack200

Examples of org.apache.harmony.pack200.Archive$PackingFile


        File inputFile = new File(folder, children[i]);
        in = new JarFile(inputFile);
        file = File.createTempFile("temp", ".pack.gz");
            out = new FileOutputStream(file);
//            System.out.println("packing " + children[i]);
            new Archive(in, out, true).pack();
            in.close();
            out.close();

            // unpack and compare
View Full Code Here


    public void testHelloWorld() throws IOException, Pack200Exception, 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);
        new Archive(in, out, true).pack();
        in.close();
        out.close();

        // now unpack
        InputStream in2 = new FileInputStream(file);
View Full Code Here

    public void testStripDebug() throws IOException, Pack200Exception, URISyntaxException {
        in = new JarInputStream(Archive.class
                .getResourceAsStream("/org/apache/harmony/pack200/tests/sqlUnpacked.jar"));
        file = File.createTempFile("sql", ".pack");
        out = new FileOutputStream(file);
        Archive archive = new Archive(in, out, false);
        archive.stripDebugAttributes();
        archive.pack();
        in.close();
        out.close();

        // now unpack
        InputStream in2 = new FileInputStream(file);
View Full Code Here

        in = new JarInputStream(
                Archive.class
                        .getResourceAsStream("/org/apache/harmony/pack200/tests/annotationsUnpacked.jar"));
        file = File.createTempFile("annotations", ".pack");
        out = new FileOutputStream(file);
        new Archive(in, out, false).pack();
        in.close();
        out.close();

        // now unpack
        InputStream in2 = new FileInputStream(file);
View Full Code Here

        in = new JarInputStream(
                Archive.class
                        .getResourceAsStream("/org/apache/harmony/pack200/tests/hw.jar"));
        file = File.createTempFile("helloworld", ".pack.gz");
        out = new FileOutputStream(file);
        new Archive(in, out, true).pack();
        in.close();
        out.close();

        // now unpack
        InputStream in2 = new FileInputStream(file);
View Full Code Here

    public void testSQL() throws IOException, Pack200Exception, URISyntaxException {
        in = new JarInputStream(Archive.class
                .getResourceAsStream("/org/apache/harmony/pack200/tests/sqlUnpacked.jar"));
        file = File.createTempFile("sql", ".pack");
        out = new FileOutputStream(file);
        new Archive(in, out, false).pack();
        in.close();
        out.close();

        // now unpack
        InputStream in2 = new FileInputStream(file);
View Full Code Here

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

        // now unpack
        InputStream in2 = new FileInputStream(file);
View Full Code Here

        in = new JarInputStream(
                Archive.class
                        .getResourceAsStream("/org/apache/harmony/pack200/tests/hw.jar"));
        file = File.createTempFile("helloworld", ".pack.gz");
        out = new FileOutputStream(file);
        Archive archive = new Archive(in, out, true);
        archive.setSegmentLimit(0);
        archive.pack();
        in.close();
        out.close();

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

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

public class CodecTest extends TestCase {

    public void testInvalidCodings() {
        for (int i = 0; i < 256; i++) {
            try {
                new BHSDCodec(1, i);
                fail("b=1 -> h=256");
            } catch (IllegalArgumentException e) {
                assertTrue(true);
            }
        }
        for (int i = 1; i <= 5; i++) {
            try {
                new BHSDCodec(i, 256);
                if (i == 5)
                    fail("h=256 -> b!=5");
            } catch (IllegalArgumentException e) {
                assertTrue(true);
            }
View Full Code Here

        for (int i = 0; i < 255; i++)
            decode(Codec.BYTE1, new byte[] { (byte) i }, i, 0);
    }

    public void testByte1Delta() throws Exception {
        Codec BYTE1D = new BHSDCodec(1, 256, 0, 1);
        long last = 0;
        for (int i = 1; i < 255; i++)
            last = decode(BYTE1D, new byte[] { (byte) 1 }, i, last);
    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.pack200.Archive$PackingFile

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.