0

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.

Krishna Kumar
  • 7,841
  • 14
  • 49
  • 61
  • What exactly is the question? What is going on that tells you your tests are being treated like 3.x? – Kelly S. French Nov 03 '09 at 13:55
  • Question: why is TestRunner treating my test case as 3.x. I could figure this out as tests with @Test annotation were not executed but the ones starting with "test" were. – Krishna Kumar Nov 03 '09 at 19:09

1 Answers1

1

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.

Michael Lloyd Lee mlk
  • 14,561
  • 3
  • 44
  • 81
  • 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 Nov 03 '09 at 19:10