public class TestBuilderPropertyFacet extends HiveMindTestCase
{
public void testCachingOfTranslatedValues() throws Exception
{
MockControl moduleControl = newControl(Module.class);
Module module = (Module) moduleControl.getMock();
MockControl translatorControl = newControl(Translator.class);
Translator translator = (Translator) translatorControl.getMock();
MockControl paramsControl = newControl(ServiceImplementationFactoryParameters.class);
ServiceImplementationFactoryParameters params = (ServiceImplementationFactoryParameters) paramsControl
.getMock();
BuilderPropertyFacet facet = new BuilderPropertyFacet();
facet.setTranslator("foo");
facet.setValue("bar");
params.getInvokingModule();
paramsControl.setDefaultReturnValue(module);
module.getTranslator("foo");
moduleControl.setDefaultReturnValue(translator);
translator.translate(module, Object.class, "bar", null);
translatorControl.setReturnValue("BAR");