Tuesday, February 24, 2015

Re: GWT 2.7/GwtMockito: History support


Thanks for your answer. I'll look into putting a layer between GWT (at least the parts that use static helpers) and our application code then. For now the ugliness works, and I guess I'll be able to use it also in similar other situations.


On Tuesday, February 17, 2015 at 11:19:54 AM UTC+1, Jens wrote:

 is there any specific reason not to make HistoryImpl accessible?

 Its good practice for a library to hide implementation details because you do not want developers to accidentally or knowingly depend on these details. I am pretty sure other features of GwtMockito look equally "ugly", because GwtMockito itself is a huge hack to circumvent GWT.create() and JSNI in unit tests.

Often you can also just refactor your app a bit so it does not directly call such GWT methods. You can wrap them in helper classes like HistoryTokenEncoder that you can swap out during testing or wrap them using a helper method that can be overwritten in tests (anonymously or by sub classing)

-- J.

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment