File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Testing and the fly likes Cross reference (function) Junit test Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Cross reference (function) Junit test" Watch "Cross reference (function) Junit test" New topic

Cross reference (function) Junit test

Adrien Ruffie
Ranch Hand

Joined: Jan 14, 2009
Posts: 92
Hello all, my problem is:

I have two functions in my class which I would like to test, start(), isRunning()

But for the function which test start() method I use isRunning() to validate my test,
and for the function which test isRunning() methid I use start() too.


public void testStart() {



Do you have an idea for best pratice and how to test cross reference in unit test ?

Thank all

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32088

Your test is fine. It is ok to call two methods in the same test when they are testing a scenario as yours is.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
subject: Cross reference (function) Junit test