SKM
SKM

Reputation: 71

how to mock/make available different event class in my test case in gwt mvp app testing?

i'm using gwtp and i'm writing some tests on my view,i have some events like ChangeEvent, clickEvent in my view so how can i obtain these objects i tried by mocking but it is not working.

the code in my view is

`@UiHandler("submit") void onClickSubmit(ClickEvent e) { doClick(); }

@UiHandler("change")
public void onChange(ChangeEvent e) {
    doChange();
}

`

Upvotes: 1

Views: 124

Answers (1)

Sydney
Sydney

Reputation: 12212

Try to reverse the MVP pattern. This way you will need to test only the presenter. Remember in MVP, the view is supposed to be "dumb". The goal is to avoid testing the view.

http://arcbees.wordpress.com/2010/09/03/reversing-the-mvp-pattern-and-using-uihandler/

Upvotes: 1

Related Questions