tags:

views:

390

answers:

2

I have the following situation: I create a class with a single test method, within this test method, I create another class that contains multiple test methods.

The report shows only my initial test method, it passes IFF it passes and all the tests in the other class pass.

What I wish would happen is the report would contain my first test, and also the results of all the other tests in the other class passing, or failing.

Do you know of a way to do this?

+1  A: 

this is not possible. testNG wraps your test classes and instruments them, so making a 'new' test class in your test does not create all the extra testNG stuff with it, which is why when test methods run within it, looks like they ran inside the original test methods from which the class was instantiated.

long story short: you cant do it, unless you did some stuff with testNG under the hood. It would be easier to just proxy the test methods inside of your test class

mkoryak
A: 

There is similar question test structure using testNG where are some answers that maybe interesting for you.

Ula Karzelek