Example #1
0
 private void verifyAssembly(String templateName) throws Exception {
   StringWriter output = new StringWriter();
   assembler.assemble(
       createClassPathUrl("templates/" + templateName + ".xhtml"), namespace, output);
   String expectedOutput = loadText(createClassPathUrl("solutions/" + templateName + ".html"));
   assertEquals(expectedOutput, output.toString());
 }
Example #2
0
  @Test
  public void testMinimalTemplate() throws Exception {
    final String INPUT = "<html xmlns=\"http://www.w3.org/1999/xhtml\"/>";
    final String EXPECTED_OUTPUT =
        "<!DOCTYPE html>\n" + "<html xmlns=\"http://www.w3.org/1999/xhtml\"/>";

    StringWriter output = new StringWriter();
    assembler.assemble(createLiteralUrl(INPUT), output);
    assertEquals(EXPECTED_OUTPUT, output.toString());
  }