permaculture playing cards*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 90
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
internet detective

Joined: May 26, 2003
Posts: 30075

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

[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
I agree. Here's the link:
subject: Cross reference (function) Junit test
Similar Threads
Thread and variable value question?
Question about Games in Andorid
join() and completely stopping a thread
Removing objects (Threads)
Simulating Power Supply Unit.