Examples of BoxChunk


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

    if (options == null || options.trim().length() == 0) {
      throw new TubainaException("Boxes must have a non-empty title");
    }
    String title = options.trim();
    List<Chunk> body = new ChunkSplitter(resources, "box").splitChunks(content);
    return new BoxChunk(title, body);
  }
View Full Code Here

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

public class BoxTagTest extends AbstractTagTest {

    @Test
    public void testBox() {
        BoxChunk chunk = new BoxChunk("Título do Box", text("Texto do Box"));
    String result = getContent(chunk);
        Assert.assertEquals(BoxTag.BEGIN + BoxTag.TITLE_BEGIN + "T&iacute;tulo do Box" + BoxTag.TITLE_END
                + "Texto do Box" + BoxTag.END, result);
    }
View Full Code Here

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

                + "Texto do Box" + BoxTag.END, result);
    }

    @Test
    public void testBoxWithMultilineContent() {
      BoxChunk chunk = new BoxChunk("Título do Box", text("Texto do Box\n blablabla"));
        String result = getContent(chunk);
        Assert.assertEquals(BoxTag.BEGIN + BoxTag.TITLE_BEGIN + "T&iacute;tulo do Box"
                + BoxTag.TITLE_END + "Texto do Box\n blablabla" + BoxTag.END, result);
    }
View Full Code Here

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

public class BoxTagTest extends AbstractTagTest {

  @Test
  public void testBox() {
    String result = getContent(new BoxChunk("Titulo do Box", text("Texto do Box")));
    Assert.assertEquals("\\begin{tubainabox}{Titulo do Box}\nTexto do Box\n\\end{tubainabox}", result);
  }
View Full Code Here

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

    Assert.assertEquals("\\begin{tubainabox}{Titulo do Box}\nTexto do Box\n\\end{tubainabox}", result);
  }
 
  @Test
  public void testBoxWithMultilineContent() {
    String result = getContent(new BoxChunk("Titulo do Box", text("Texto do Box\n blablabla\n")));
    Assert.assertEquals("\\begin{tubainabox}{Titulo do Box}\nTexto do Box\n blablabla\n\n\\end{tubainabox}", result);
  }
View Full Code Here

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

    Assert.assertEquals("\\begin{tubainabox}{Titulo do Box}\nTexto do Box\n blablabla\n\n\\end{tubainabox}", result);
  }
 
  @Test
  public void testChangeTitleToEmptyStringIfItsNull(){
    String result = getContent(new BoxChunk(null, text("Text")));
    Assert.assertEquals("\\begin{tubainabox}{}\nText\n\\end{tubainabox}", result);
  }
View Full Code Here

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

  @Override
  public Chunk createChunk(String options, String content) {
    String title = options.trim();
    List<Chunk> body = new ChunkSplitter(resources, "box").splitChunks(content);
    return new BoxChunk(title, body);
  }
View Full Code Here

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

public class BoxTagTest extends AbstractTagTest {
 
  @Test
  public void testBox() {
    BoxChunk chunk = new BoxChunk("Titulo do Box", text("Texto do Box"));
    String result = getContent(chunk);
    Assert.assertEquals("<div class=\"box\"><h4>Titulo do Box</h4>\nTexto do Box</div>", result);
  }
View Full Code Here

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

    Assert.assertEquals("<div class=\"box\"><h4>Titulo do Box</h4>\nTexto do Box</div>", result);
  }
 
  @Test
  public void testBoxWithMultilineContent() {
    BoxChunk chunk = new BoxChunk("Titulo do Box", text("Texto do Box\n blablabla"));
    String result = getContent(chunk);   
    Assert.assertEquals("<div class=\"box\"><h4>Titulo do Box</h4>\nTexto do Box\n blablabla</div>", result);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.