Package br.com.caelum.tubaina.chunk

Examples of br.com.caelum.tubaina.chunk.ImageChunk


        END, result);
  }
 
  @Test
  public void testImageTagWithPath() {
    ImageChunk chunk = makeChunk("some/path/image.png", "w=42");
    String result = getContent(chunk);
    assertEquals(
        BEGIN +
        "\\includegraphics[width=73.5mm]{image.png}\n" +
        NO_CAPTION +
View Full Code Here


 
  @Test
  public void imageTagWithoutDefinedImageProportionShouldConstrainToPageWidthWhenImageIsTooBig() {
    int tooLargeImageWidthInPixels = 2250;
    ImageChunk chunk = makeChunk("image.png", "[" + tooLargeImageWidthInPixels + "]");
    String result = getContent(chunk);
    assertEquals(
        BEGIN +
        "\\includegraphics[width=\\textwidth]{image.png}\n" +
        NO_CAPTION +
View Full Code Here

        END, result);
  }
 
  @Test
  public void shouldParseLabelEvenWithStrangeChars() throws Exception {
    ImageChunk chunk = makeChunk("image.png", "label=name-with-strange_chars");
    String result = getContent(chunk);
    assertEquals(
        BEGIN +
        "\\includegraphics[width=\\textwidth]{image.png}\n" +
        NO_CAPTION +
View Full Code Here

        END, result);
  }
 
  @Test
  public void shouldParseTagsInsideSubtitle() {
    ImageChunk chunk = makeChunk("blabla.png", "\"lala **bold text** http://caelum.com.br/ \"");
    String output = getContent(chunk);
    assertTrue(output.contains("\\url"));
    assertTrue(output.contains("\\definition"));
  }
View Full Code Here

    assertTrue(output.contains("\\url"));
    assertTrue(output.contains("\\definition"));
  }
 
  private ImageChunk makeChunk(String path, String options) {
    ImageChunk chunk = new ImageChunk(path, options, 100, 1, new SectionsManager());
    return chunk;
  }
View Full Code Here

public class ImageTagTest extends AbstractTagTest {

  @Test(expected=TubainaException.class)
  public void shouldThrowExceptionWhenTagContainsLabel() {
    ImageChunk chunk = new ImageChunk("image.png", "label=someLabel", 100, 1, new SectionsManager());
    getContent(chunk);
  }
View Full Code Here

    if(dpi == 0)
      dpi = 72;
    width = image.getPlainWidth();
   
    resources.add(new ImageResource(imageFile, matcher.group(2)));
    return new ImageChunk(path, matcher.group(2), width, dpi, sectionsManager);
  }
View Full Code Here

TOP

Related Classes of br.com.caelum.tubaina.chunk.ImageChunk

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.