@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()); }
@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); }
@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); }