protected void doWriteCloseNativeMarkupTest(
TestMarinerPageContext pageContext,
PageHead pageHead,
DeviceLayoutContext dlc,
DOMOutputBuffer buffer) throws Exception {
NativeMarkupAttributes attributes = new NativeMarkupAttributes();
super.doWriteCloseNativeMarkupTest(pageContext,
pageHead,
dlc,
buffer);
attributes.setTargetLocation("wml.deck.head");
protocol.writeOpenNativeMarkup(attributes);
assertEquals("native markup written to wrong output buffer for head",
protocol.getMarinerPageContext().getCurrentOutputBuffer(),
pageHead.getHead());
protocol.writeCloseNativeMarkup(attributes);
// Check that output buffers have been removed from stack
assertEquals("after closeNativeMarkup wrong output buffer on stack",
buffer, pageContext.getCurrentOutputBuffer());
attributes.resetAttributes();
attributes.setTargetLocation("wml.deck.template");
protocol.writeOpenNativeMarkup(attributes);
assertEquals("native markup written to wrong output buffer for head",
protocol.getMarinerPageContext().getCurrentOutputBuffer(),
pageHead.getBuffer(WMLRoot.PAGE_TEMPLATE_BUFFER_NAME, false));
protocol.writeCloseNativeMarkup(attributes);
// Check that output buffers have been removed from stack
assertEquals("after closeNativeMarkup wrong output buffer on stack",
buffer, pageContext.getCurrentOutputBuffer());
attributes.resetAttributes();
attributes.setTargetLocation("wml.card.timer");
protocol.writeOpenNativeMarkup(attributes);
assertEquals("native markup written to wrong output buffer for timer",
protocol.getMarinerPageContext().getCurrentOutputBuffer(),
dlc.getOutputBuffer(NativeMarkupAttributes.WML_CARD_TIMER, false));
protocol.writeCloseNativeMarkup(attributes);
// Check that output buffers have been removed from stack
assertEquals("after closeNativeMarkup wrong output buffer on stack",
buffer, pageContext.getCurrentOutputBuffer());
attributes.resetAttributes();
attributes.setTargetLocation("wml.card.onevent");
protocol.writeOpenNativeMarkup(attributes);
assertEquals("native markup written to wrong output buffer for onevent",
protocol.getMarinerPageContext().getCurrentOutputBuffer(),
dlc.getOutputBuffer(NativeMarkupAttributes.WML_CARD_ONEVENT, false));
protocol.writeCloseNativeMarkup(attributes);
// Check that output buffers have been removed from stack
assertEquals("after closeNativeMarkup wrong output buffer on stack",
buffer, pageContext.getCurrentOutputBuffer());
attributes.resetAttributes();
attributes.setTargetLocation("wml.card.beforebody");
protocol.writeOpenNativeMarkup(attributes);
assertEquals("native markup written to wrong output buffer for beforebody",
protocol.getMarinerPageContext().getCurrentOutputBuffer(),
dlc.getOutputBuffer(NativeMarkupAttributes.WML_CARD_BEFOREBODY, false));
protocol.writeCloseNativeMarkup(attributes);