Q:

How to get @test class context in data provider

I found out that you can declare the data provider with ITestContext or java.lang.reflect. Method.  as parameters but i want to know the class name of the test class for which the dataprovider method is called.  Neither ITestContext nor java.lang.reflect. Method can provide that.  

A:

method.getDeclaringClass() should give you the method's class name in the dataprovider method.