@Test public void testGetTableBlockWhenMacroContentDoesntContainTable() throws Exception { try { this.source.getTableBlock("not a table", Collections.<String, String>emptyMap()); Assert.fail("Should have thrown an exception"); } catch (MacroExecutionException expected) { Assert.assertEquals("Unable to locate a suitable data table.", expected.getMessage()); } }
@Test public void testGetTableBlockWhenEmptyMacroContent() throws Exception { try { this.source.getTableBlock("", Collections.<String, String>emptyMap()); Assert.fail("Should have thrown an exception"); } catch (MacroExecutionException expected) { Assert.assertEquals( "A Chart Macro using an inline source must have a data table defined in its content.", expected.getMessage()); } }