Q:

Not able to execute tests with @Test annotation when my test extends TestCase(Junit) in Eclipse

Not able to execute tests with @Test annotation when my test extends TestCase(Junit) in Eclipse
It works fine when I am not extending from TestCase(jUnit), but my existing code extends from TestCase hence I would like to keep that as it is.

A:

Check that you are not using JUnit3 runner.
Open 'Run Configuration' for you test and on Test tab make sure you have JUnit 4 selected for your test runner.
IMHO, if you are retrofitting your test suite for JUnit4, just drop support for JUnit3.
BTW, if you switch to 'JUnit 4' runner it will still execute old JUnit3 classes ( you don't have to add @Test annotations to them ).

A:

Tests that extend junit.framework. TestCase are considered to be JUnit3-style tests by the JUnit4 runner. This is correct.
To @Test annotation you need NOT extend junit.framework. TestCase and @Test annotation works fine 

