use of org.apache.tapestry5.model.MutableComponentModel in project tapestry-5 by apache.
the class MutableComponentModelImplTest method child_meta_overrides_parent_meta.
@Test
public void child_meta_overrides_parent_meta() {
Resource r = mockResource();
Logger logger = mockLogger();
replay();
MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, logger, r, null, false, null);
MutableComponentModel child = new MutableComponentModelImpl(CLASS_NAME, logger, r, parent, false, null);
parent.setMeta("fred", "flintstone");
child.setMeta("fred", "mcmurray");
assertEquals(parent.getMeta("fred"), "flintstone");
assertEquals(child.getMeta("fred"), "mcmurray");
verify();
}
use of org.apache.tapestry5.model.MutableComponentModel in project tapestry-5 by apache.
the class MutableComponentModelImplTest method get_order_for_mixin_with_parent_model.
@Test
public void get_order_for_mixin_with_parent_model() {
Resource r = mockResource();
Logger logger = mockLogger();
replay();
MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, logger, r, null, false, null);
parent.addMixinClassName("Wilma", "before:Fred");
MutableComponentModel child = new MutableComponentModelImpl(CLASS_NAME, logger, r, parent, false, null);
child.addMixinClassName("Fred", "after:Barney");
child.addMixinClassName("Barney");
assertEquals(child.getOrderForMixin("Wilma"), new String[] { "before:Fred" });
assertEquals(child.getOrderForMixin("Fred"), new String[] { "after:Barney" });
assertEquals(child.getOrderForMixin("Barney"), null);
verify();
}
use of org.apache.tapestry5.model.MutableComponentModel in project tapestry-5 by apache.
the class MutableComponentModelImplTest method default_for_supports_informal_parameters_is_false.
@Test
public void default_for_supports_informal_parameters_is_false() {
Resource r = mockResource();
Logger logger = mockLogger();
replay();
MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null, false, null);
assertFalse(model.getSupportsInformalParameters());
model.enableSupportsInformalParameters();
assertTrue(model.getSupportsInformalParameters());
verify();
}
use of org.apache.tapestry5.model.MutableComponentModel in project tapestry-5 by apache.
the class MutableComponentModelImplTest method mixin_order_remembered.
@Test
public void mixin_order_remembered() {
Resource r = mockResource();
Logger logger = mockLogger();
replay();
MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null, false, null);
MutableEmbeddedComponentModel fred = model.addEmbeddedComponent("fred", "Fred", COMPONENT_CLASS_NAME, false, null);
fred.addMixin("zip.zop.Zoom", "before:*", "after:foo.bar.Baz");
fred.addMixin("foo.bar.Baz");
assertEquals(fred.getConstraintsForMixin("zip.zop.Zoom"), new String[] { "before:*", "after:foo.bar.Baz" });
assertEquals(fred.getConstraintsForMixin("foo.bar.Baz"), new String[0]);
verify();
}
use of org.apache.tapestry5.model.MutableComponentModel in project tapestry-5 by apache.
the class MutableComponentModelImplTest method get_parameter_by_name_with_no_parameters_defined.
@Test
public void get_parameter_by_name_with_no_parameters_defined() {
Resource r = mockResource();
Logger logger = mockLogger();
replay();
MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null, false, null);
assertNull(model.getParameterModel("foo"));
verify();
}
Aggregations