Closed GoogleCodeExporter closed 9 years ago
Original comment by gael.laz...@gmail.com
on 7 Aug 2012 at 5:51
The patcher API is expecting the "this" object as the first parameter when you
use @PatchMethod for non static method. This is explained here :
http://code.google.com/p/gwt-test-utils/wiki/HowToWriteCustomPatchers#Writing_a_
custom_patcher
Your @PatchMethod getInt() is right since the MainClass.getInt() is static. The
@PatchMethod getSimpleJS() is not right since the MainClass.getSimpleJS() is
not static. Your patch method should be like this :
@PatchMethod
static SimpleJS getSimpleJS(MainClass mainClass) {
SimpleJS js = JavaScriptObject.createObject().cast();
return js;
}
I will improve the thrown Exception to have something more explicit than the
ArrayOutOfBoundException you get !
Original comment by gael.laz...@gmail.com
on 7 Aug 2012 at 9:52
Original issue reported on code.google.com by
shivakum...@gmail.com
on 6 Aug 2012 at 7:38