* </BLOCK>
* </card>
* <wml>
*/
Document document = domFactory.createDocument();
Element wml = domFactory.createElement();
Element card = domFactory.createElement();
Element p1 = domFactory.createElement();
Element dissectable = domFactory.createElement();
Element p2 = domFactory.createElement();
Text text = domFactory.createText();
Element shardLinkGroup = domFactory.createElement();
Element p3 = domFactory.createElement();
Element shardLink1 = domFactory.createElement();
Element a1 = domFactory.createElement();
Text link1 = domFactory.createText();
Element shardLinkConditional = domFactory.createElement();
Element br = domFactory.createElement();
Element shardLink2 = domFactory.createElement();
Element a2 = domFactory.createElement();
Text link2 = domFactory.createText();
wml.setName("wml");
card.setName("card");
p1.setName("BLOCK");
dissectable.setName(DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT);
p2.setName("BLOCK");
text.append("some content");
shardLinkGroup.setName(DissectionConstants.SHARD_LINK_GROUP_ELEMENT);
p3.setName("BLOCK");
p3.setAttribute("mode", "wrap");
shardLink1.setName(DissectionConstants.SHARD_LINK_ELEMENT);
a1.setName("a");
a1.setAttribute("href", "url1");
a1.addTail(link1);
link1.append("link1");
shardLinkConditional.setName(
DissectionConstants.SHARD_LINK_CONDITIONAL_ELEMENT);
br.setName("br");
shardLink2.setName(DissectionConstants.SHARD_LINK_ELEMENT);
a2.setName("a");
a2.setAttribute("href", "url2");
a2.addTail(link2);
link2.append("link2");
document.addNode(wml);
wml.addTail(card);
card.addTail(p1);
p1.addTail(dissectable);
dissectable.addTail(p2);
p2.addTail(text);
p1.addTail(shardLinkGroup);
shardLinkGroup.addTail(p3);
p3.addTail(shardLink1);
shardLink1.addTail(a1);
p3.addTail(shardLinkConditional);
shardLinkConditional.addTail(br);
p3.addTail(shardLink2);
shardLink2.addTail(a2);
String expected =
"<wml>" +
"<card>"+
"<"+DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT+">" +
"<p>" +
"some content" +
"</p>" +
"</"+DissectionConstants.DISSECTABLE_CONTENTS_ELEMENT+">" +
"<"+DissectionConstants.SHARD_LINK_GROUP_ELEMENT+">" +
"<p mode=\"wrap\">" +
"<"+DissectionConstants.SHARD_LINK_ELEMENT+">" +
"<a href=\"url1\">link1</a>" +
"</"+DissectionConstants.SHARD_LINK_ELEMENT+">" +
"<"+DissectionConstants.SHARD_LINK_CONDITIONAL_ELEMENT+">" +
"<br/>" +
"</"+DissectionConstants.SHARD_LINK_CONDITIONAL_ELEMENT+">" +
"<"+DissectionConstants.SHARD_LINK_ELEMENT+">" +
"<a href=\"url2\">link2</a>" +
"</"+DissectionConstants.SHARD_LINK_ELEMENT+">" +
"</p>" +
"</"+DissectionConstants.SHARD_LINK_GROUP_ELEMENT+">" +
"</card>"+
"</wml>";
// Transform dom from original so we can check against expected
Document transformed = transformer.transform(protocol, document);
String domAsString = DOMUtilities.toString(transformed);
assertEquals("Shard Link Group not on same level as dissecting pane",
expected, domAsString);
}