I needed to get a class name
from my calling class. I will not make too much confusion.
I have 3 classes.
Class A{ //do something }
Class B extends Class A
{
@Test(dataProvider = "dp" , dataProviderClass = C.class)
public void methodone(String name)
{
//do something
}
}
Class C extends Class A
{
@DataProvider(name="dp")
public Object[][] getData(Method m) {
String sheetName = m.getName();
System.out.println("---"+sheetName); }
}
In the Class C
, I need the name of the calling class to be printed.
But for now it is printing the name of the calling method, which is methodone
of class B
. But I need as class B
to be printed.
Could some one help?