Search in sources :

Example 6 with AttributeToken

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\"/>");
}
Also used : RenderCommand(org.apache.tapestry5.runtime.RenderCommand) BindingSource(org.apache.tapestry5.services.BindingSource) TypeCoercer(org.apache.tapestry5.commons.services.TypeCoercer) RenderQueue(org.apache.tapestry5.runtime.RenderQueue) AttributeToken(org.apache.tapestry5.internal.parser.AttributeToken) MarkupWriter(org.apache.tapestry5.MarkupWriter) Location(org.apache.tapestry5.commons.Location) Test(org.testng.annotations.Test)

Aggregations

Test (org.testng.annotations.Test)5 Location (org.apache.tapestry5.commons.Location)4 Resource (org.apache.tapestry5.commons.Resource)2 TapestryException (org.apache.tapestry5.commons.internal.util.TapestryException)2 TypeCoercer (org.apache.tapestry5.commons.services.TypeCoercer)2 AttributeToken (org.apache.tapestry5.internal.parser.AttributeToken)2 AbstractResource (org.apache.tapestry5.ioc.internal.util.AbstractResource)2 ClasspathResource (org.apache.tapestry5.ioc.internal.util.ClasspathResource)2 BindingSource (org.apache.tapestry5.services.BindingSource)2 QName (javax.xml.namespace.QName)1 ComponentResources (org.apache.tapestry5.ComponentResources)1 MarkupWriter (org.apache.tapestry5.MarkupWriter)1 Version (org.apache.tapestry5.internal.services.SaxTemplateParser.Version)1 RenderCommand (org.apache.tapestry5.runtime.RenderCommand)1 RenderQueue (org.apache.tapestry5.runtime.RenderQueue)1