On Friday 26 Sep 2003 07:24, Joshi, Yogesh (Cognizant) wrote:
> I am using Maven for the first time for 'Unit Testing'. I am not very clear
> about how it exactly works. As far as I know, Maven has a in built plugin
> for JUnit and we need to provide the <unitTestSourceDirectory> in
> Project.xml. However if for,e.g., SampleTest.java is expected to test
> SampleMaven.java, then how the individual methods are going to be tested ?
> How are we going to pass the parameters ? shall we call every method
> individually ?

I'd suggest that you familiarise yourself with JUnit. ... www.junit.org. What 
you basically need is to define your test files to contain methods called
testXYZ(). The name XYZ has does not need to have any relation to the 
class(es) you are testing ... it is a name only.

Any method called that will be called by JUnit. You can include methods 
setUp() and tearDown() in the Test class as well to set up things that you 
need in your testXYZ() methods. It is customary to terminate each testXYZ 
method with an assert(status) to return to Junit what the result of the test 
is.



-- 
Andy


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

Reply via email to