It might make sense to have a "hit" annotation for Testify that follows @Inject which allows the injection to be beforeMethod or beforeClass. Unfortunately, we can't re-use the jUnit ones because (if I recall correctly) they are not suitable for Field annotation, just method. But something similar would be good. Maybe @InjectBeforeTest and @InjectBeforeSuite could do it.

Christian.

On Jul 13, 2009, at 4:59 AM, Paul Field wrote:

Hi Juan,

I have been playing with Testng and the Testify library but i am
having a small issue. It seems that the injection of services occurs
after the @BeforeSuite.

That's true - Testify was processing @Inject annotations before every test method, mainly because that's the natural way for things to work in JUnit.

To setup services or data that is shared by all the tests, I would take
the approach described at
http://tapestry.formos.com/nightly/tapestry-testify/#Integration_testing
and create a "fake" IOC module that contained fake services and fake data
for the entire suite of tests

However, it does seem reasonable to process the @Inject annotations at the start of the TestNG suite, so the latest Testify snapshot does that and you should find that the code you were trying will now work. I'm not very clear about how all the TestNG features interact and exactly what happens with instances of test classes so I don't know if there are any unpleasant
side effects of this change - so please let me know!


One other change in the snapshot release that applies to JUnit 3/4 as
well:
I have deprecated setUpForAllTestClasses() and instead you should override
setUpForAllTestMethods() - the name change attempts to make it clearer
when that setup method is run.

Paul



---

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e- mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.

Christian Edward Gruber
christianedwardgru...@gmail.com
http://www.geekinasuit.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to