public void testWithSubclass()
{
IMarkupWriter writer = newWriter();
NestedMarkupWriter nested = newNestedWriter();
IRequestCycle cycle = newCycle();
ILinkComponent component = newComponent();
ILink link = newLink();
trainGetAttribute(cycle, Tapestry.LINK_COMPONENT_ATTRIBUTE_NAME, null);
cycle.setAttribute(Tapestry.LINK_COMPONENT_ATTRIBUTE_NAME, component);
trainIsDisabled(component, false);
trainIsRewinding(cycle, false);
writer.begin("xlink");
trainGetLink(component, cycle, link);
trainGetScheme(component, null);
trainGetPort(component, null);
trainGetAnchor(component, "my-anchor");
trainGetURL(link, null, "my-anchor", "/foo/bar.baz#my-anchor");
writer.attribute("xurl", "/foo/bar.baz#my-anchor");
trainGetTarget(component, "some-target");
writer.attribute("xtarget", "some-target");
writer.print("BEFORE-BODY-RENDER");
trainGetNestedWriter(writer, nested);
component.renderBody(nested, cycle);
writer.print("AFTER-BODY-RENDER");
component.renderAdditionalAttributes(writer, cycle);
nested.close();
writer.end();