1

The goal is to provide different variations of the very same test methods (just like parameterized testing). The problem is that the actual number of necessary test runs depends and is discovered on the go.

The original idea was to create subelements (children) of the test (using the description object of the test metthod addChild).

When running the code Eclipse View shows that all the discovered and executed tests are placed under "Unrooted Tests". The tests are described using the description.getTestClass() method the test method's Description instance.

Does anyone can explain what is happening and if possible give a solution?

I extend the BlockJUnit4ClassRunner. Also by using Description.addChild one adds a child.

Martin Kersten
  • 5,127
  • 8
  • 46
  • 77
  • Have you looked at http://stackoverflow.com/questions/120889/unrooted-tests? – maksimov Dec 11 '15 at 23:11
  • Yes. This problem is different. The problem might be related to dynamically extending the suite of the test case. It seams an edge case that is barely documented. I will conduct simulated test runs (just reporting something using different data structures) and see if it displays correctly or not. Maybe I get further insides. I have hoped for avoiding this. – Martin Kersten Dec 14 '15 at 08:51

1 Answers1

1

The test runner of eclipse is a custom implementation called RemoteTestRunner. From its source code I learned that the listener mechanism is not responsible for creating the tree of test cases but the actual Runner structure (getDescription) and the actual children. But again not the children of the description but the children of each of the Runner instance.

All in all the code was harder to read and understand than it should be.

So Unrooted testcases are just tests that were reported by the listener process but could not match properly to the actual Runner structure.

Martin Kersten
  • 5,127
  • 8
  • 46
  • 77