tags:

views:

34

answers:

1

I am trying to run my test case using junit 4.X runner, but it is treated like 3.x one when I extend from junit.framework.TestCase.

I had to this as the out current test framework base test class extends from junit.framework.TestCase.

+1  A: 

So what is your question?
Why does it work that way? As having JUnit 3 style tests running in a JUnit 4 way could easily lead to confusion. Mixing and matching in the test class is a bad idea, personally I think that JUnit (or a 3rd party tool) should display a warning if you mix them in a class.

The end result is that you need to either write the test class as JUnit 4 or JUnit 3 style test class. If you are tied to JUnit 3 due to your own test classes then look at refactoring them. If you are tied to JUnit 3 due to 3rd party tools then look at upgrading that tool.

mlk
I am not mixing 3.x with 4.x on purpose. I am not sure why jUNit should the treat the test case as 3.x once I derive my test case from TestCase class
Krishna Kumar