use of org.apache.tapestry5.commons.Resource 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.commons.Resource 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.commons.Resource 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.commons.Resource 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();
}
use of org.apache.tapestry5.commons.Resource in project tapestry-5 by apache.
the class MutableComponentModelImplTest method libraryName_property.
@Test
public void libraryName_property() {
Resource r = mockResource();
Logger logger = mockLogger();
replay();
MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null, false, "superduper");
assertEquals(model.getLibraryName(), "superduper");
verify();
}
Aggregations