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.apache.org/tapestry/Tapestry5HowToIocOnly


Thanks Davor. I'm actually wanting to do both. For example my test would look something like:

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 an item was added.

My mock datasource is just a bunch off arrays in memory so I need to get a reference to the same ioc container that is being created by the PageTester.


The page tester is being built like:

        @BeforeClass
        public void init() {
                String appPackage = "net.xeric.interview";
                String appName = "Test"; //this will set it up with 
TestModule.class
                tester = new PageTester(appPackage, appName);
        }

I have the PageTester working beautifully, but I can't figure out how to get a reference to ioc inside my test file. When I try to follow the IOC only instructions I can get it to build but it appears that the manually built registry creates a new ioc container running parallel to the one being used by the PageTester. I need to get access to the same container being used by the PageTester.

is there a way to do this?

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to