Re: SpringComponentInjector and non null fields

2012-02-14 Thread Robert K├╝hne
There is a remark on this here: https://cwiki.apache.org/WICKET/spring.html When doing this it is important to remember not to initialize dependencies, to null or any other value, e.g.private ContactDao dao=null;. Don't do this because the injector will run before the subclass initializes its

Re: SpringComponentInjector and non null fields

2012-02-14 Thread martin.dilger
Hi, thanks, this is true, but I dont think this is the Point I refer to, since I call Injector.get().inject(this) in our Test, so I explicitely request SpringBean-injection. The Problem is this Line in Class Injector: if (field.get(object) == null) {

Re: SpringComponentInjector and non null fields

2012-02-14 Thread Igor Vaynberg
that is there to give users a chance at test time to override injection partially, as in component c=new mycomponent(); c.service1=mock(service.class); injector.inject(c); injector will inject everything but service1. key here is to make sure service doesnt have to be defined in the test's

Re: SpringComponentInjector and non null fields

2012-02-14 Thread martin.dilger
ok, understood, thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/SpringComponentInjector-and-non-null-fields-tp4386918p4387545.html Sent from the Users forum mailing list archive at Nabble.com.