use of org.apache.tapestry5.internal.parser.AttributeToken in project tapestry-5 by apache.
the class PageElementFactoryImplTest method attribute.
@Test
public void attribute() {
TypeCoercer typeCoercer = mockTypeCoercer();
BindingSource bindingSource = mockBindingSource();
MarkupWriter writer = new MarkupWriterImpl(xmlModel);
Location l = mockLocation();
RenderQueue queue = mockRenderQueue();
replay();
PageElementFactory factory = new PageElementFactoryImpl(typeCoercer, bindingSource);
AttributeToken token = new AttributeToken(null, "name", "value", l);
RenderCommand element = factory.newAttributeElement(null, token);
writer.element("root");
element.render(writer, queue);
verify();
assertEquals(writer.toString(), "<?xml version=\"1.0\"?>\n<root name=\"value\"/>");
}
Aggregations