assertNotNull(h.getClassResolver());
}
public void testAutowire()
{
BuilderFactory factory = new BuilderFactory();
BuilderParameter p = new BuilderParameter();
p.setClassName(AutowireTarget.class.getName());
p.addProperty(new BuilderLogFacet());
p.addProperty(new BuilderClassResolverFacet());
p.addProperty(new BuilderMessagesFacet());
p.addProperty(new BuilderErrorHandlerFacet());
p.addProperty(new BuilderServiceIdFacet());
MockControl c = newControl(Module.class);
Module module = (Module) c.getMock();
ErrorHandler eh = new DefaultErrorHandler();
ClassResolver cr = new DefaultClassResolver();
MockControl messagesControl = newControl(Messages.class);
Messages messages = (Messages) messagesControl.getMock();
module.getClassResolver();
c.setReturnValue(cr);
module.getClassResolver();
c.setReturnValue(cr);
module.getMessages();
c.setReturnValue(messages);
module.getErrorHandler();
c.setReturnValue(eh);
replayControls();
AutowireTarget t =
(AutowireTarget) factory.createCoreServiceImplementation(
"foo.bar.Baz",
Runnable.class,
LogFactory.getLog("hivemind.BuilderFactory"),
module, Collections.singletonList(p));