This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Testing and the fly likes noobie junit issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "noobie junit issue" Watch "noobie junit issue" New topic
Author

noobie junit issue

jay vas
Ranch Hand

Joined: Aug 30, 2005
Posts: 407
1) My IDE (eclipse) isn't prompting me to run this class as a test.... I'm wondering why ? I've also played with putting
annotations above the methods.

2) In general, if I'm not extending TestCase (due to multiple inheritance prevention), what is the convential way to
make a class Unit Testable ?



I'm not quite sure why....
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30130
    
150

Jay,
What do you mean by prompting you to run as test? Run as JUnit isn't an option.

Adding annotations to a JUnit 3.8 style doesn't do anything. You need either what you have or to not extend test case and add annotations.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
jay vas
Ranch Hand

Joined: Aug 30, 2005
Posts: 407
Eclipse typically offers Run As > JUnit in helios and galileo..... (see image).....

So I guess I'm confused about how / why extension of TestCase is ever necessary.... Is this just an artifact of old JUnit ?



[Thumbnail for a.jpg]

Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30130
    
150

jay vas wrote:Eclipse typically offers Run As > JUnit in helios and galileo..... (see image).....

Right. In Helios, I can run JUnit 4 style tests that way. I don't remember what version of JUnit was built into Galileo.

jay vas wrote:So I guess I'm confused about how / why extension of TestCase is ever necessary.... Is this just an artifact of old JUnit ?

In JUnit 4, you can write tests in the old style or new style. Sometimes, one is using a library that forces extending in the 3.8 style so they kept it as an option.
 
 
subject: noobie junit issue
 
Similar Threads
Java 5.0 just syntactic suger?
assertNotSame pRmeters
Behavior of Arrays.asList()
Junit Compilation errors
stupid DateFormat problem