Results 1 to 3 of 3
Thread: Junit. Pulling my HAIR OUT!
- 10-04-2010, 06:33 PM #1
Member
- Join Date
- Sep 2008
- Posts
- 40
- Rep Power
- 0
Junit. Pulling my HAIR OUT!
Hello. I've downloaded the latest JUNIT and i'm trying to get it to work with eclipse. Currently i've got a basic class and a test class. The problem i'm having is when i try and run it i get the following error:
Here is my main class:Java Code:java.lang.NoClassDefFoundError: org/junit/runner/notification/RunListener at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:41) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:31) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
My test ClassJava Code:public class rectangle { /** * @param args */ private double width; private double height; public rectangle(double width, double height) { this.width = width; this.height = height; } public double getWidth() { return width; } public double getHeight() { return height; } public void setWidth(double width) { this.width = width; } public void setHeight(double height) { this.height = height; } public double getArea() { return width * height; } public double getDiagonalLength() { return Math.sqrt(width*width + height*height); } public static void main(String[] args) { // TODO Auto-generated method stub rectangle rec = new rectangle(2,3); } }
I've imported junit via the preferencies->ant->runtime. And still i have no luck.Java Code:import static org.junit.Assert.*; import org.junit.After; import org.junit.Before; import org.junit.Test; public class rectangleTest { @Before public void setUp() throws Exception { } @After public void tearDown() throws Exception { } @Test public void testGetWidth() { fail("Not yet implemented"); } @Test public void testGetHeight() { fail("Not yet implemented"); } }
Could somebody please help me. Pleeeeeeeeease
The test case was the pre-generated test case. But i've tried it with a difference set of test cases and i still have the same error.
- 10-04-2010, 06:42 PM #2
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 780
- Rep Power
- 4
- 10-04-2010, 07:06 PM #3
Member
- Join Date
- Sep 2008
- Posts
- 40
- Rep Power
- 0
Similar Threads
-
Pulling from an Active Directory
By Sno in forum New To JavaReplies: 1Last Post: 09-24-2010, 09:15 PM -
JUnit
By cka in forum EclipseReplies: 3Last Post: 07-27-2010, 04:14 PM -
Junit on Jar Files
By mecrazycoder in forum NetBeansReplies: 0Last Post: 07-01-2009, 11:12 AM -
Junit
By Azndaddy in forum New To JavaReplies: 6Last Post: 06-15-2008, 06:47 AM -
TRying to use jUnit for Tesing
By sandor in forum New To JavaReplies: 3Last Post: 04-18-2007, 11:17 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks