It's not a secret anymore!
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 Java Interview Guide this week in the Jobs Discussion 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: 33134

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]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Cross reference (function) Junit test
It's not a secret anymore!