Open GoogleCodeExporter opened 8 years ago
Hi, even am facing this issue with testng-6.8.7 and powermock-mockito-1.5.3.
I tried to pass a custom class through data provider and the test is failing
with a run time exception (Method invocation error).
Also, i tried to use the alternative option mentioned in AppendixB and then it
is executing the test method but when i tried to cast the 'Object' to the
original type is giving a ClassCastException. I think is related to some class
loader issue.
@Test (dataProvider = "getWeekday")
public void forAllWeekdaysAllClassroomsShouldBeAvailableInitially(Object p) {
CustomClass obj = (CustomClass)p
assertTrue(true);
}
Could any one please help me on this. This is a very important feature we
required in our project to write the unit test cases and is blocking us to use
Power Mock
Original comment by majetyya...@gmail.com
on 23 Jan 2014 at 12:24
AFAIK if you are using any PowerMock:PrepareForTest, you should not use the
custom class as test case input.
You can always put it like public void
forAllWeekdaysAllClassroomsShouldBeAvailableInitially(Object p) {
customClass = (CustomClass) p;
assertTrue(true);
}
Original comment by verma....@gmail.com
on 4 Sep 2014 at 4:10
Original issue reported on code.google.com by
Ignas.Tr...@gmail.com
on 1 Oct 2013 at 1:01