[jboss-user] [JBoss Seam] - Love the test support in seam except for...

andrew.rw.robinson do-not-reply at jboss.com
Fri Dec 21 12:24:22 EST 2007


Seam's TestNG support is quite nice, but there is one major design flaw that really affects test case design. 

The test classes are designed to be used as a black box. The init and cleanup methods are made to be used at the class instance level. Ramping up Seam is very slow. My project, which is still small takes a long time to initialize mainly because of: seam deployment, hibernate configuration, drools rule parsing.

Having each test class ramp up all of the full stack is not feasible for time reasons. This means that it is best to put all unit tests in one class with hundreds of methods.  I really don't like that design. I would prefer to build a test class for each entity bean and for each managed bean.

What would be great is to re-architect the test classes so that the init and cleanup are annotated with @BeforeSuite and @AfterSuite respectively. The variables that these classes should be either static or made in such a way that there is only one instance per test suite. 

If they could be made in such a way that they could also be run in parallel in one JVM instance (forkMode of once) that would be great as well, as then the tests could simulate a server with many requests at once.

I can probably hack this behavior into my test cases, but it would most likely break with changes to the source as I may have to use reflection to set the private variables.

Any chance at getting this type of functionality in the provided test classes?

Thanks,
Andrew

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115057#4115057

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115057



More information about the jboss-user mailing list