dcsimg
Can't compile a Test
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Wednesday, February 12, 2003 03:21 PM

I have problem compilling JUnit test class. I use gentoo Linux version. I have an relatively up-to-date JDK : 1.4.1_01. My classpath is set corectly to use the junit package. When I try to compile the test, it always say to me : SimpleMathTest.java:11: TestCase() is not public in unit.framework.TestCase; cannot be accessed from outside package public class SimpleMathTest extends TestCase My package begin with : import junit.framework.*; public class SimpleMathTest extends TestCase So, I don't understand, I have followed all the How-to that I found and try what the cookbook say, b   More>>

I have problem compilling JUnit test class. I use gentoo Linux version. I have an relatively up-to-date JDK : 1.4.1_01. My classpath is set corectly to use the junit package.


When I try to compile the test, it always say to me :

SimpleMathTest.java:11: TestCase() is not public in
unit.framework.TestCase; cannot be accessed from outside
package

public class SimpleMathTest extends TestCase





My package begin with :

import junit.framework.*;

public class SimpleMathTest extends TestCase




So, I don't understand, I have followed all the How-to that I found and try what the cookbook say, but, nothing more have ever happen.


Thanks in advance for the answer.

   <<Less

Re: Can't compile a Test

Posted By:   Jeanne_Boyarsky  
Posted On:   Wednesday, February 12, 2003 05:35 PM

If you are using JUnit 3.7 or earlier, the default constructor is package-private. You need to use the one argument constructor instead. For example:

public SimpleMathTest(String name) {
super(name);
}
About | Sitemap | Contact