-
1. Re: SeamTest + JUnit
pmuir Jul 27, 2008 7:18 PM (in response to blabno)This sounds more like a problem with your classpath than with using JUnit. You need to use a directory structure ala seam-gen.
I documented how to use JUnit rather than TestNG in trunk (you need to run trunk too as I refactored SeamTest to allow this)
-
2. Re: SeamTest + JUnit
blabno Jul 28, 2008 11:03 AM (in response to blabno)Thanks for reply Pete. Indeed it was classpath. I do not understand third sentence. What do you mean in trunk? In svn trunk? If so then where exactly. I've looked at
http://anonsvn.jboss.org/repos/seam/trunk/doc/Seam_Reference_Guide/en-US/Testing.xml
and found nothing on JUnit.
I've managed to lunch JUnit4 test in NetBeans6.1 for jboss-seam-2.0.1.CR1. I have some minor problem like messages do not get injected or values not loaded from messages.properties. But test gets executed. I will document my work this week. I've managed with NetBeans directory structure.
-
3. Re: SeamTest + JUnit
blabno Jul 30, 2008 9:10 AM (in response to blabno)My mistake. Found changes and docs in 2.1.0.A1.
Problem with JUnit4 is that @BeforeClass method must be public static and AbstractSeamTest.setupClass() is not static. Should I call it from constructor ?
Other thing is that if I have several test classes, would JBossEmbedded start several, am I right ? Can't this be optimized somehow ? -
4. Re: SeamTest + JUnit
pmuir Jul 30, 2008 11:38 AM (in response to blabno)Read the javadoc, it tells you when to run the setup and cleanup methods (before/after each instance). startSeam() and stopSeam() cause embedded to boot/stop - so run them once per suite.
-
5. Re: SeamTest + JUnit
blabno Jul 30, 2008 12:35 PM (in response to blabno)I've read javadoc Pete ! I know what those methods do.
But in JUnit method that needs to be run once per class must be static, and both setupClass() and startSeam() are not static, so I must call them from some else place. Constructor seems to me the only choice and I was curious if you see any cons.
By the way, when you say suite, do you mean single class ?Although, when you answer me I often have a feeling of getting reprimand, Than You for valuable attention.
-
6. Re: SeamTest + JUnit
pmuir Jul 30, 2008 1:31 PM (in response to blabno)JUnit still seems to be lacking in this regard (no way to run a method just after an instance is instantiated, just before it is destroyed, no way to run a method before running a suite, after running a suite). A suite is multiple classes.
Complain to them, not us ;-)
I can make the start/stop Seam methods static but not the setup/cleanup Class. File a feature request in JIRA.
-
7. Re: SeamTest + JUnit
blabno Aug 14, 2008 8:48 AM (in response to blabno)Finally I've managed to integrate SeamTest with JUnit on NetBeans and wrote tutorial on that.
You can read it here : seamtest4junit.bernard.labno.pl. -
8. Re: SeamTest + JUnit
newlukai Aug 21, 2008 8:57 AM (in response to blabno)
Pete Muir wrote on Jul 27, 2008 19:18:
I documented how to use JUnit rather than TestNG in trunk (you need to run trunk too as I refactored SeamTest to allow this)Sounds nice. Since I'm trying to write JUnit tests for my application this doc would be very helpful. But I'm not the best in finding things, so could you please tell me where to find this doc?
Thanks in advance
Newlukai -
9. Re: SeamTest + JUnit
sjmenden Aug 21, 2008 3:37 PM (in response to blabno)Can you add that link and a short description in our knowledge base? http://www.seamframework.org/Documentation/KnowledgeBase
-
10. Re: SeamTest + JUnit
pksiv Sep 14, 2009 10:25 PM (in response to blabno)
Bernard Labno wrote on Aug 14, 2008 08:48:
Finally I've managed to integrate SeamTest with JUnit on NetBeans and wrote tutorial on that.
You can read it here : seamtest4junit.bernard.labno.pl.This link doesn't appear to be work anymore. Any help running SeamTest with JUnit ?