Article:
  Using JUnit With Eclipse IDE
Subject:   I can't create testcase without a class for testing.
Date:   2004-02-25 02:09:46
From:   kondareddy
Response to: I can't create testcase without a class for testing.

Try to create the class file first.
Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • I can't create testcase without a class for testing.
    2004-04-14 10:10:30  jekewa [View]

    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.