On Oct 9, 1:08 pm, Cédric Beust ♔ <
cbe...@google.com> wrote:
>
> Can you post your code showing that parent's @After method are not being
> called?
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;
@Test
public class A {
public void test() {}
@AfterClass
public void destroy() {
System.out.println("Invoked A-->destroy");
}
}
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;
@Test
public class B extends A{
public void test2() {}
@AfterClass
public void destroy() {
System.out.println("Invoked B-->destroy");
}
}
[Parser] Running:
/Users/vladimir/workspace/infinispan/core/temp-testng-
customsuite.xml
Invoked B-->destroy
PASSED: test
PASSED: test2
===============================================
org.infinispan.api.B
Tests run: 2, Failures: 0, Skips: 0
===============================================
===============================================
infinispan-core
Total tests run: 2, Failures: 0, Skips: 0
===============================================
> Ah, I see, it's the fields that you are setting to null that are big
> objects.
Yes :)
>
> For what it's worth, you should be able to create a generic
> "nullifyInstanceFields()" that does this through reflection and that will
> work for any class.
Yeah that is the idea! Thanks Cedric