-Igor
On 12/12/05,
Igor Vaynberg <[EMAIL PROTECTED]> wrote:
My version of the mock is very small still. so far it only supports pulling out beans by name, i need to add by class when i have a bit of time - soon though.
Yes those 3 lines are repetitive. I will probably subclass the mock app context and roll those into the constructor. I think it will be nice to have a standalone app context that doesnt do any of those things for you, and one that does.
Thanks for the ideas :)
-IgorOn 12/12/05, Joni Suominen < [EMAIL PROTECTED]> wrote:Very good! I started to use mock version of application context too. The
version which i did looks probably very similar than
ApplicationContextMock (couldn't get it from anoncvs yet). The only
visible difference is that I had put these lines:
SpringContextLocatorMock ctxLocator=new SpringContextLocatorMock(appctx);
AnnotSpringInjector injector=new AnnotSpringInjector(ctxLocator);
// 3. set our mock injection environment as active
InjectorHolder.setInjector(injector);
to the constructor of the mock.
--
Joni Suominen <[EMAIL PROTECTED]>
On Mon, 2005-12-12 at 00:09 -0800, Igor Vaynberg wrote:
> i just refactored the wicket-contrib-spring project, here are the
> changes
>
> * all jdk 5 stuff has been factored out into
> wicket-contrib-spring-jdk5 project so wicket-contrib-spring can
> compile with 1.4
>
> * the injector for automatic dependencies is now aquired through a
> static methods of the InjectorHolder class. this makes it very easy to
> substitute your own injector, say for unit testing.
>
> * SpringWebPage has been generalized and renamed to InjectableWebPage
>
> * there is now an AnnotSpringWebApplication which automatically puts
> the AnnotSpringInjector into the holder class at startup so you dont
> have to. what this means is that in order to setup automatic injection
> of pages you need to do two things: let your application object extend
> the AnnotSpringWebApplication and let any pages you want to be
> injected extend InjectableWebPage.
>
> * SpringWebApplication now has a few helper methods for creating
> spring proxies in case you do not want to use the injector mechanism
>
> * There is a beginning of the ApplicationContextMock class that can be
> used to simplify unit testing ( this needs a lot more work maybe
> somone has some time )
>
> * http://www.wicket-wiki.org.uk/wiki/index.php/Spring has been updated
> to reflect these changes as well as show an example of a unit test for
> a page that uses automatic injetion
>
> ====== migration guide for automatic injection users ======
> extend AnnotSpringWebApplication instead of SpringWebApplication
> change all references to SpringWebPage to InjectableWebPage
> =============================================
>
> thoughts, comments, ideas ?
>
> -Igor
>
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
