use of org.apache.tapestry5.internal.InternalComponentResources in project tapestry-5 by apache.
the class InternalComponentResourcesImplTest method render_informal_parameters_no_bindings.
@Test
public void render_informal_parameters_no_bindings() {
ComponentPageElement element = mockComponentPageElement();
Component component = mockComponent();
Instantiator ins = mockInstantiator(component);
MarkupWriter writer = mockMarkupWriter();
TypeCoercer coercer = mockTypeCoercer();
ComponentModel model = mockComponentModel();
train_getModel(ins, model);
replay();
InternalComponentResources resources = new InternalComponentResourcesImpl(null, element, null, elementResources, null, null, ins, false);
resources.renderInformalParameters(writer);
verify();
}
use of org.apache.tapestry5.internal.InternalComponentResources in project tapestry-5 by apache.
the class InternalComponentResourcesImplTest method render_an_informal_parameter.
@Test
public void render_an_informal_parameter() {
ComponentPageElement element = mockComponentPageElement();
Component component = mockComponent();
Instantiator ins = mockInstantiator(component);
MarkupWriter writer = mockMarkupWriter();
ComponentModel model = mockComponentModel();
Binding binding = mockBinding();
Object rawValue = new Long(97);
train_getModel(ins, model);
train_getParameterModel(model, "fred", null);
train_get(binding, rawValue);
writer.attributes("fred", "97");
replay();
InternalComponentResources resources = new InternalComponentResourcesImpl(null, element, null, elementResources, "Foo.bar", null, ins, false);
resources.bindParameter("fred", binding);
resources.renderInformalParameters(writer);
verify();
}
use of org.apache.tapestry5.internal.InternalComponentResources in project tapestry-5 by apache.
the class InternalComponentResourcesImplTest method get_property_name_internal_prop_binding.
@Test
public void get_property_name_internal_prop_binding() {
Component component = mockComponent();
Instantiator ins = mockInstantiator(component);
ComponentModel model = mockComponentModel();
ComponentPageElement element = mockComponentPageElement();
Page page = mockPage();
InternalPropBinding binding = newMock(InternalPropBinding.class);
train_getModel(ins, model);
expect(binding.getPropertyName()).andReturn("foo");
replay();
InternalComponentResources resources = new InternalComponentResourcesImpl(page, element, null, null, null, null, ins, false);
resources.bindParameter("bar", binding);
assertEquals(resources.getPropertyName("bar"), "foo");
verify();
}
Aggregations