Re: Inject into Test Class

2008-02-27 Thread Mark W. Shead
On Feb 27, 2008, at 2:27 PM, Davor Hrg wrote: feel free to add a jira requesting addition of method getSerivice(Class) to page tester and describe your use case :) Thanks. I just wanted to make sure there wasn't an easy way to do it that I was overlooking. I took a look at JIRA and it seem

Re: Inject into Test Class

2008-02-27 Thread Davor Hrg
just create a page that does the testing and outputs result, then check the result from that test page ... you said: 1. Grab the mock datasource from ioc and count how many items are there. 2. Using PageTester navigate through some pages and add another item. 3. check the datasource to verify that

Re: Inject into Test Class

2008-02-27 Thread Mark W. Shead
On Feb 27, 2008, at 1:18 PM, Davor Hrg wrote: pass your module PageTester(String appPackage, String appName, String contextPath, Class... moduleClasses) create a test page and use @Inject inside it to access any service you wish... OR. example how to start ioc manualy is here: http://wiki

Re: Inject into Test Class

2008-02-27 Thread Davor Hrg
use: org.apache.tapestry.test.use PageTester pass your module PageTester(String appPackage, String appName, String contextPath, Class... moduleClasses) same as you setup the app in web.xml create a test page and use @Inject inside it to access any service you wish... OR. if you want to man

Re: Inject into Test Class

2008-02-27 Thread Mark W. Shead
On Feb 26, 2008, at 11:13 PM, Angelo Chen wrote: @Inject is only for pages and components. That makes sense. But I'm still looking for a way to get something from the ioc container into a test class. Any suggestions? Mark -

Re: Inject into Test Class

2008-02-26 Thread Angelo Chen
Hi Mark, @Inject is only for pages and components. Mark W. Shead-2 wrote: > > > @Inject > Logger _logger; > > -- View this message in context: http://www.nabble.com/Inject-into-Test-Class-tp15705386p15706258.html Sent from the Tapestry - User maili

Inject into Test Class

2008-02-26 Thread Mark W. Shead
I have a test class using TestNG. I would like to get access to some of my services. For example, I have a datasource that I'd like to use to verify tests and I'd like to be able to use the logging service. I can't seem to find a way to inject services into the Test class. I have tried d