Ahmed Ibrahim
Ahmed Ibrahim

Reputation: 31

GWT Mockito and TestNG

How to use GWT Mockito found here GWT Mockito in parallel with TestNG to test GWT methods ?

Edit:8/5/2015

I have searched over the internet, and i found that GWT Mockito is only used with Junit 4, our company uses TestNG as standard, so we need to integrate GWT Mockito with TestNG to follow company's standard

Upvotes: 0

Views: 275

Answers (1)

Jake W
Jake W

Reputation: 2858

I had the same issue, and wanted to test GWT using TestNG and Mockito.

After some research, I arranged a simple framework based on GWT Mockito and I called it "GWT Mockito NG": https://github.com/jiakuan/gwtmockito-ng

It can be used for testing GWT-platform presenters layer with TestNG, without Junit dependency. It's enough for testing GWT-platform presenters.

Another improvement I can see is to use Javassist to modify GWT widget classes so that all native methods can be mocked automatically on classload. For now, gwtmockito-ng can only support mocking for GWT.create method and inject fields and constructor parameters in presenters automatically. This will force us to follow MVP pattern and better separate pure UI logic with business logic, all business logic should be put into presenters.

I hope this could be useful to someone else too.

Upvotes: 0

Related Questions