Package org.apache.harmony.unpack200

Examples of org.apache.harmony.unpack200.AttributeLayoutMap


import org.apache.harmony.pack200.Pack200Exception;

public class AttributeLayoutMapTest extends TestCase {
  public void testRepeatable() throws Pack200Exception {
    // Check we can retrieve a default layout
    AttributeLayoutMap a = new AttributeLayoutMap();
    AttributeLayout layout = a.getAttributeLayout("SourceFile", AttributeLayout.CONTEXT_CLASS);
    assertNotNull(layout);
    assertEquals("RUNH",layout.getLayout());
    // and that we can change it
    a.add(new AttributeLayout("SourceFile",AttributeLayout.CONTEXT_CLASS,"FROG",15));
    layout = a.getAttributeLayout("SourceFile", AttributeLayout.CONTEXT_CLASS);
    assertNotNull(layout);
    assertEquals("FROG",layout.getLayout());
    assertTrue(layout.matches(1<<15));
    assertFalse(layout.matches(1<<16));
    assertTrue(layout.matches(-1));
    assertFalse(layout.matches(0));
    // and that changes don't affect subsequent defaults
    AttributeLayoutMap b = new AttributeLayoutMap();
    layout = b.getAttributeLayout("SourceFile", AttributeLayout.CONTEXT_CLASS);
    assertNotNull(layout);
    assertEquals("RUNH",layout.getLayout());
   
  }
View Full Code Here


            super(segment);
        }

        public AttributeLayoutMap getAttributeDefinitionMap() {
            try {
                return new AttributeLayoutMap();
            } catch (Pack200Exception e) {
                fail(e.getLocalizedMessage());
            }
            return null;
        }
View Full Code Here

import org.apache.harmony.pack200.Pack200Exception;

public class AttributeLayoutMapTest extends TestCase {
  public void testRepeatable() throws Pack200Exception {
    // Check we can retrieve a default layout
    AttributeLayoutMap a = new AttributeLayoutMap();
    AttributeLayout layout = a.getAttributeLayout("SourceFile", AttributeLayout.CONTEXT_CLASS);
    assertNotNull(layout);
    assertEquals("RUNH",layout.getLayout());
    // and that we can change it
    a.add(new AttributeLayout("SourceFile",AttributeLayout.CONTEXT_CLASS,"FROG",15));
    layout = a.getAttributeLayout("SourceFile", AttributeLayout.CONTEXT_CLASS);
    assertNotNull(layout);
    assertEquals("FROG",layout.getLayout());
    assertTrue(layout.matches(1<<15));
    assertFalse(layout.matches(1<<16));
    assertTrue(layout.matches(-1));
    assertFalse(layout.matches(0));
    // and that changes don't affect subsequent defaults
    AttributeLayoutMap b = new AttributeLayoutMap();
    layout = b.getAttributeLayout("SourceFile", AttributeLayout.CONTEXT_CLASS);
    assertNotNull(layout);
    assertEquals("RUNH",layout.getLayout());

  }
View Full Code Here

import org.apache.harmony.pack200.Pack200Exception;

public class AttributeLayoutMapTest extends TestCase {
  public void testRepeatable() throws Pack200Exception {
    // Check we can retrieve a default layout
    AttributeLayoutMap a = new AttributeLayoutMap();
    AttributeLayout layout = a.getAttributeLayout("SourceFile", AttributeLayout.CONTEXT_CLASS);
    assertNotNull(layout);
    assertEquals("RUNH",layout.getLayout());
    // and that we can change it
    a.add(new AttributeLayout("SourceFile",AttributeLayout.CONTEXT_CLASS,"FROG",15));
    layout = a.getAttributeLayout("SourceFile", AttributeLayout.CONTEXT_CLASS);
    assertNotNull(layout);
    assertEquals("FROG",layout.getLayout());
    assertTrue(layout.matches(1<<15));
    assertFalse(layout.matches(1<<16));
    assertTrue(layout.matches(-1));
    assertFalse(layout.matches(0));
    // and that changes don't affect subsequent defaults
    AttributeLayoutMap b = new AttributeLayoutMap();
    layout = b.getAttributeLayout("SourceFile", AttributeLayout.CONTEXT_CLASS);
    assertNotNull(layout);
    assertEquals("RUNH",layout.getLayout());
   
  }
View Full Code Here

            super(segment);
        }
       
        public AttributeLayoutMap getAttributeDefinitionMap() {
            try {
                return new AttributeLayoutMap();
            } catch (Pack200Exception e) {
                fail(e.getLocalizedMessage());
            }
            return null;
        }
View Full Code Here

    public void testJustResourcesGZip() throws Exception {
        in = Archive.class
                .getResourceAsStream("/org/apache/harmony/pack200/tests/JustResources.pack.gz");
        file = File.createTempFile("Just", "ResourcesGz.jar");
        out = new JarOutputStream(new FileOutputStream(file));
        Archive archive = new Archive(in, out);
        archive.unpack();
    }
View Full Code Here

    public void testWithSqlE1() throws Exception {
        in = Archive.class
                .getResourceAsStream("/org/apache/harmony/pack200/tests/sql-e1.pack.gz");
        file = File.createTempFile("sql-e1", ".jar");
        out = new JarOutputStream(new FileOutputStream(file));
        Archive archive = new Archive(in, out);
        archive.unpack();
    }
View Full Code Here

    public void testWithSql() throws Exception {
        in = Archive.class
                .getResourceAsStream("/org/apache/harmony/pack200/tests/sql.pack.gz");
        file = File.createTempFile("sql", ".jar");
        out = new JarOutputStream(new FileOutputStream(file));
        Archive archive = new Archive(in, out);
        archive.unpack();
        JarFile jarFile = new JarFile(file);
        file.deleteOnExit();

        JarFile jarFile2 = new JarFile(new File(Archive.class.getResource(
                "/org/apache/harmony/pack200/tests/sqlUnpacked.jar").toURI()));
View Full Code Here

    public void testWithPack200E1() throws Exception {
        in = Archive.class
                .getResourceAsStream("/org/apache/harmony/pack200/tests/pack200-e1.pack.gz");
        file = File.createTempFile("p200-e1", ".jar");
        out = new JarOutputStream(new FileOutputStream(file));
        Archive archive = new Archive(in, out);
        archive.unpack();
    }
View Full Code Here

    public void testWithPack200() throws Exception {
        in = Archive.class
                .getResourceAsStream("/org/apache/harmony/pack200/tests/pack200.pack.gz");
        file = File.createTempFile("p200", ".jar");
        out = new JarOutputStream(new FileOutputStream(file));
        Archive archive = new Archive(in, out);
        archive.unpack();
    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.unpack200.AttributeLayoutMap

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.