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.

2
  • What exactly is the question? What is going on that tells you your tests are being treated like 3.x? Commented Nov 3, 2009 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. Commented Nov 3, 2009 at 19:09

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.