I made a wrapper class MyClassFixture
for a pojo MyClass
by extending it, to made the initialization of its fields more user friendly. Eg. I want to use my own date format on wiki pages, and parse that date in the overloading setters. So instead of invoking setWorkDay(long millis)
from MyClass
I want to invoke setWorkDay(String formatedDate)
from MyClassFixture
and parse the formatedDate string and then invoke setWorkDay(long)
of the parent MyClass
.
This is working nicely when I run the test from the wiki page, but not working when I run it with JUnit runner. The error message I got:
Can't convert 2016-03-05 to long. Tried to invoke: foo.bar.MyClass.setWorkDay(long) -> void. On instance of: foo.bar.MyClassFixture
I've tried it with different String arguments, but always the setWorkDay(long) method gets invoked. Why is this?
Thanks!