Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JUnit Testing Error

Status
Not open for further replies.

brent123

MIS
Mar 21, 2006
29
US
I am new to java and I'm starting to learn the language. I'm trying to test a class using JUnit, but everytime I try I get an error "There are no open JUnit test cases..." Does anyone know what this error is and what do I need to do to resolve it?

Thanks
 
What did you do and how are you trying to run it?

Cheers,
Dian
 
Yes, the method is call testsomething. Just like yo have it Christian. I'm taking this java class as a prerequisite to a graduate degree I'm working on. We are using Dr.Java to create classes and test them. Here's my test class:

package c1581.lab7 ;

import junit.framework.* ;
import java.awt.Color;


public class HitCheckerTester extends TestCase {

private Location recLoc;
private Rectangle rec;
private HitChecker checker;
private Location hit1;
private Location hit2;

public HitCheckerTester(String name){
super(name);
}

public void setUp(){
recLoc = new Location(100,100);
rec = new Rectangle( recLoc, 20, 10, Color.BLUE);
checker = new HitChecker();
hit1 = new Location( 105, 105);
hit2 = new Location(50,50);
checker = new HitChecker();
}

public void testHitPoints(){

}

public void testRectangleHit(){
assertTrue(checker.hit(rec,hit1));
}
}

I'm trying to test the testRectangleHit, but I get the error. All the other classes that this class interacts with have been given to us. This test works when it is run on the class lab machines, but won't work on my laptop. I must be missing something in the Java setup, but I can't figure out what it is.
 
JUnit questions should go to the JUnit forum948

Tim
 
Ok. I didn't know there was a JUnit forum.

Thanks,
 
Me either. But they have a forum for everything here. Even for the strange and wonderfull.

Christiaan Baes
Belgium

"My new site" - Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top