Esempio n. 1
0
  @Test
  public void testBadInputPath() throws Exception {
    final String BAD_PATH = "no-such";

    Throwable error = null;
    try {
      assembler.assemble(createClassPathUrl(BAD_PATH), new StringWriter());
    } catch (AssemblerException e) {
      error = e.getCause();
    }
    assertEquals(BAD_PATH, error.getMessage());
  }
Esempio n. 2
0
  @Test
  public void testMissingDocumentElement() throws Exception {
    final String INPUT = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";

    Throwable error = null;
    try {
      assembler.assemble(createLiteralUrl(INPUT), new StringWriter());
    } catch (AssemblerException e) {
      error = e.getCause();
    }
    assertNotNull(error);
  }
Esempio n. 3
0
  @Test
  public void testConflictingIncludeAndContent() throws Exception {
    final String INPUT =
        "<html xmlns=\"http://www.w3.org/1999/xhtml\""
            + " xmlns:dwc=\"http://shopximity.com/schema/dwc\""
            + " dwc:content=\"\""
            + " dwc:include=\"\"/>";

    Throwable error = null;
    try {
      assembler.assemble(createLiteralUrl(INPUT), new StringWriter());
    } catch (AssemblerException e) {
      error = e.getCause();
    }
    // TODO: assert that the error message contains meaningful information.
    assertNotNull(error);
  }