• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The source attachment does not contain the source for the file testCase.class

 
joseph cooper
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to figure out how to write a JUnit test case.

The source attachment does not contain the source for the file testCase.class. This happens on a Class File Editor screen. It also
give me the option to change attached the source. When I try to change
the attached source (workspace, external file, or external folder), I
get the same error.

I am running on WSAD 5.1.2

What needs to be done??


[ April 12, 2006: Message edited by: Lasse Koskela ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34071
331
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joseph,
Do you have junit.jar in the classpath for that WSAD project?

You don't need the junit source to be available - just the .class files in the jar.
 
joseph cooper
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I have junit jar in the class path.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How does the source attachment and viewing the junit.framework.TestCase class relate to trying to write a JUnit test class? Are you trying to "read the source, Luke" in order to figure out what you need to do?

Anyway, what you've got is mostly correct. Just remove the constructor and you're all set... Except that you also don't want that try-catch in there. Just declare your test* methods to throw an Exception like so:

[ April 12, 2006: Message edited by: Lasse Koskela ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic