use of org.apache.tapestry5.commons.internal.services.StringInternerImpl in project tapestry-5 by apache.
the class BindingFactoryTest method translate_binding.
@Test
public void translate_binding() {
FieldTranslator translator = mockFieldTranslator();
FieldTranslatorSource source = newMock(FieldTranslatorSource.class);
ComponentResources resources = mockComponentResources();
Location l = mockLocation();
String description = "foo bar";
String expression = "mock";
expect(source.createTranslator(resources, expression)).andReturn(translator);
replay();
BindingFactory factory = new TranslateBindingFactory(source, new StringInternerImpl());
Binding binding = factory.newBinding(description, resources, resources, expression, l);
assertSame(binding.get(), translator);
assertSame(InternalUtils.locationOf(binding), l);
verify();
}
Aggregations