• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Cannot find symbol constructor TestCase()

 
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The following code has this error when compiled in junit 3.8.2 & jdk 6 & Eclipse 3.3.2:
cannot find symbol
[javac] symbol : constructor TestCase()
[javac] location: class junit.framework.TestCase
[javac] public class TestProIndexBean extends TestCase {
[javac] ^
[javac] 1 error




I add the src.jar to the source path to project in Eclipse by the menu
Project->Properties->Source->Link Source

I add the junit.jar to the build path to project in Eclipse by the menu
Project->Properties->Libraries->Add External JARs

I select the build.xml by right clicking to execute "Run As"->"Ant build" menu.
build.xml is as follows:
<!-- ... -->
<target name="compile" depends="copyExtras" description="Compile the NEDD Classes">
<!-- Compile the Java classes -->
<echo message="Compiling..."/>
<mkdir dir="${classes}"/>
<exec executable="java">
<arg line="-version"/>
</exec>
<javac srcdir="${src}" destdir="${classes}" classpathref="classpath" debug="true" fork="true" memoryMaximumSize="512m"/>
</target>
 
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Every class needs a constructor. If you don't define one, the compiler will try to define one for you. One scenario when the compiler cannot do this is when your super class has a constructor with arguments. In this case, you must define your own constructor and this is what the error message is trying to tell you.
 
Ever since I found this suit I've felt strange new needs. And a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic