protocol.setDissecting(true);
protocol.openDissectingPane(buffer, atts);
if (protocol.isDissectionSupported()) {
Element el = null;
try {
el = buffer.closeElement
(DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT);
} catch (IllegalStateException ise) {
fail(DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT +
" element not found.");
}
// check that all the attributes have been written out
assertEquals("Invalid inclusion path attribute",
el.getAttributeValue
(DissectionConstants.INCLUSION_PATH_ATTRIBUTE),
atts.getInclusionPath());
assertEquals("Invalid pane name attribute",
el.getAttributeValue
(DissectionConstants.DISSECTING_PANE_NAME_ATTRIBUTE),
atts.getDissectingPane().getName());
assertEquals("Invalid next shard shortcut attribute",
el.getAttributeValue
(DissectionConstants.NEXT_SHARD_SHORTCUT_ATTRIBUTE),
nextShortcut);
assertEquals("Invalid next shard link attribute",
el.getAttributeValue
(DissectionConstants.NEXT_SHARD_LINK_TEXT_ATTRIBUTE),
nextLink);
assertEquals("Invalid previous shortcut attribute",
el.getAttributeValue
(DissectionConstants.PREVIOUS_SHARD_SHORTCUT_ATTRIBUTE),
prevShortcut);
assertEquals("Invalid previous link attribute",
el.getAttributeValue
(DissectionConstants.PREVIOUS_SHARD_LINK_TEXT_ATTRIBUTE),
prevLink);
assertEquals("Invalid next link first attribute",
el.getAttributeValue
(DissectionConstants.GENERATE_NEXT_LINK_FIRST_ATTRIBUTE),
String.valueOf(nextLinkFirst));
assertEquals("Invalid max contents attribute",
el.getAttributeValue
(DissectionConstants.MAXIMUM_CONTENT_SIZE_ATTRIBUTE),
maxContentSize);
} else {
assertTrue("Protocol does not support dissection so no markup " +
"should have been generated", buffer.isEmpty());