ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  Using JUnit With Eclipse IDE
Subject:   I can't create testcase without a class for testing.
Date:   2004-04-14 10:10:30
From:   jekewa
Response to: I can't create testcase without a class for testing.

That works, but goes against the idea of TDD. Should be the case that you would create the test class first, and it would fail because the class to be tested doesn't exist. This would then drive you to create the class. Small compromise to create the empty class first, but arguably still goes against TDD.

A better workaround would be to avoid the wizard and create the test class by hand--initially it'd be the package, JUnit import, and the optional main() with the TestRunner() (so you don't have to scramble for the Run As>JUnit all the time).

It'd be nicer if Eclipse made the wizard not care about the class to be tested.

1 to 1 of 1
1 to 1 of 1