Package com.samskivert.mustache

Examples of com.samskivert.mustache.Template$Segment


        buf.append(indent + "SearchRange  : " + getSearchRange() + "\n");
        buf.append(indent + "EntrySelector: " + getEntrySelector() + "\n");
        buf.append(indent + "RangeShift   : " + getRangeShift() + "\n");
       
        for (Iterator<Segment> i = this.segments.keySet().iterator(); i.hasNext();) {
            Segment s = i.next();
           
            buf.append(indent);
            buf.append("Segment: " + Integer.toHexString(s.startCode));
            buf.append("-" + Integer.toHexString(s.endCode) + " ");
            buf.append("hasMap: " + s.hasMap + " ");
View Full Code Here


    public int compareTo(Object o) {
            if (!(o instanceof Segment)) {
                return -1;
            }
           
            Segment s = (Segment) o;
       
            // if regions overlap at all, declare the segments equal,
            // to avoid overlap in the segment list
            if (((s.endCode >= this.startCode) && (s.endCode <= this.endCode)) ||
                ((s.startCode >= this.startCode) && (s.startCode <= this.endCode))) {
View Full Code Here

    assertTrue(throwsException("name",-1,""));
    assertTrue(throwsException("name",1234,""));
  }
  public void testLayoutRU() throws Pack200Exception {
    AttributeLayout layout = new AttributeLayout("RU",AttributeLayout.CONTEXT_CLASS,"RU", 1);
    Segment segment = new TestSegment();
    assertNull(layout.getValue(-1, segment.getConstantPool()));
    assertEquals("Zero",layout.getValue(0, segment.getConstantPool()));
    assertEquals("One",layout.getValue(1, segment.getConstantPool()));
  }
View Full Code Here

    assertEquals("Zero",layout.getValue(0, segment.getConstantPool()));
    assertEquals("One",layout.getValue(1, segment.getConstantPool()));
  }
  public void testLayoutRUN() throws Pack200Exception {
    AttributeLayout layout = new AttributeLayout("RUN",AttributeLayout.CONTEXT_CLASS,"RUN", 1);
    Segment segment = new TestSegment();
    assertNull(layout.getValue(0, segment.getConstantPool()));
    assertEquals("Zero",layout.getValue(1, segment.getConstantPool()));
    assertEquals("One",layout.getValue(2, segment.getConstantPool()));
  }
View Full Code Here

    assertEquals("Zero",layout.getValue(1, segment.getConstantPool()));
    assertEquals("One",layout.getValue(2, segment.getConstantPool()));
  }
  public void testLayoutRS() throws Pack200Exception {
    AttributeLayout layout = new AttributeLayout("RS",AttributeLayout.CONTEXT_CLASS,"RS", 1);
    Segment segment = new TestSegment();
    assertNull(layout.getValue(-1, segment.getConstantPool()));
    assertEquals("Ein",layout.getValue(0, segment.getConstantPool()));
    assertEquals("Zwei",layout.getValue(1, segment.getConstantPool()));
  }
View Full Code Here

    assertEquals("Ein",layout.getValue(0, segment.getConstantPool()));
    assertEquals("Zwei",layout.getValue(1, segment.getConstantPool()));
  }
  public void testLayoutRSN() throws Pack200Exception {
    AttributeLayout layout = new AttributeLayout("RSN",AttributeLayout.CONTEXT_CLASS,"RSN", 1);
    Segment segment = new TestSegment();
    assertNull(layout.getValue(0, segment.getConstantPool()));
    assertEquals("Ein",layout.getValue(1, segment.getConstantPool()));
    assertEquals("Zwei",layout.getValue(2, segment.getConstantPool()));
  }
View Full Code Here

    JarOutputStream out;

    public void testHelloWorld() throws Exception {
        in = Segment.class
                .getResourceAsStream("/org/apache/harmony/pack200/tests/HelloWorld.pack");
        Segment segment = Segment.parse(in);
        assertNotNull(segment);
        File file = File.createTempFile("hello", "world.jar");
        out = new JarOutputStream(new FileOutputStream(file));
        segment.writeJar(out);
        out.close();
        out = null;
        JarFile jarFile = new JarFile(file);
        JarEntry entry = jarFile.getJarEntry("org/apache/harmony/archive/tests/internal/pack200/HelloWorld.class");
        assertNotNull(entry);
View Full Code Here

    }

    public void testJustResources() throws Exception {
        in = Segment.class
                .getResourceAsStream("/org/apache/harmony/pack200/tests/JustResources.pack");
        Segment segment = Segment.parse(in);
        assertNotNull(segment);
        out = new JarOutputStream(new FileOutputStream(File.createTempFile("just", "resources.jar")));
        segment.writeJar(out);
    }
View Full Code Here

    }

     public void testInterfaceOnly() throws Exception {
        in = Segment.class
                .getResourceAsStream("/org/apache/harmony/pack200/tests/InterfaceOnly.pack");
        Segment segment = Segment.parse(in);
        assertNotNull(segment);
        out = new JarOutputStream(new FileOutputStream(File.createTempFile("Interface", "Only.jar")));
        segment.writeJar(out);
    }
View Full Code Here

    assertEquals("Zwei",layout.getValue(1, segment.getConstantPool()));
  }

    public void testLayoutRSN() throws Pack200Exception {
    AttributeLayout layout = new AttributeLayout("RSN",AttributeLayout.CONTEXT_CLASS,"RSN", 1);
    Segment segment = new TestSegment();
    assertNull(layout.getValue(0, segment.getConstantPool()));
    assertEquals("Eins",layout.getValue(1, segment.getConstantPool()));
    assertEquals("Zwei",layout.getValue(2, segment.getConstantPool()));
  }
View Full Code Here

TOP

Related Classes of com.samskivert.mustache.Template$Segment

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.