Hi,
I have a problem with sling test tool. Let me give an example about the
problem:
@TestReference
private static MyClass myClass;
@BeforeClass
public static void beforeClass(){
myClass.create();
}
@Test
.....
@AfterClass
public static void afterClass(){
myClass.remove();
}
I created a test class similar to above example. However, I cannot get
testreference
because of "static" keyword, and I also cannot remove static keyword from
myClass
since beforeclass and afterclass want to be everything static.
I decide to use create and remove inside @Before and @After annotations by
using
a counter i.e. if(counter==0) inside @Before and if(counter==TESTCOUNT)
inside
@After, and increase my counter inside each @Test.
I want to know is it possible solve my problem with BeforeClass and
AfterClass ?
Regards,
Meric.