Integration with Jukito

247 views
Skip to first unread message

Przemyslaw Galazka

unread,
Mar 4, 2013, 12:17:13 PM3/4/13
to juk...@googlegroups.com
Hi,

I found very useful the gwt-test-utils when it comes to testing classes generated by the gwt compiler like Drivers (The Editor Framework)
The problem was to test an advanced composition of editors and proper binding it to the driver.

But when editors are a part of a bigger mvp echosystem it would be cool to mock the most of dependencies by Jukito.

So here we go :)

https://github.com/gwt-test-utils/gwt-test-utils/pull/30

check out the pull request ,

Cheers,
Przemek 

Christian Goudreau

unread,
Mar 5, 2013, 3:02:38 PM3/5/13
to Jukito
Nice! Goooood job!


--
You received this message because you are subscribed to the Google Groups "Jukito" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jukito+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Christian Goudreau

Przemyslaw Galazka

unread,
Mar 5, 2013, 5:10:46 PM3/5/13
to juk...@googlegroups.com
Thanks,

btw, I would like to start a discussion about a new feature in Jukito - @GwtCreate 

It would be great to have @GwtCreate annotation which would do GWT.create(..) automatically when discovered on injection point in tests with 
@RunWith(JukitoGwtTestRunner.class)

Christian Goudreau

unread,
Mar 6, 2013, 9:58:56 AM3/6/13
to Jukito
What would be the effect? I'm not clearly seeing how we could achieve that since GWT.create kick up a generator that generate java classes before GWT kick off its Javascript generation cycle. In a unit test, we clearly don't want any JS to be generated and generating java classes on the classes path while making sure the test are run only after it's finished seems a little challenging. 

Not impossible though, but I don't see where in JUnit we could do that? Or do you want to mock the whole process and return a mocked type of the class being GWT.create? Which would make more sense to me as a unit test should focus on the behavior of a single class?

Philippe Beaudoin

unread,
Mar 6, 2013, 10:29:50 AM3/6/13
to juk...@googlegroups.com
IMHO unit testing generators (if you want to execute them and not string-check the generated cod) is hard. It would be a very valuable tool, though (and GWTP would be a customer) but I think the best way to approach it is in a separate project that I would be happy to merge into Jukito if it made sense.

I don't even know how GWT test their generators. Anybody has taken a look?

Christian Goudreau

unread,
Mar 6, 2013, 10:38:31 AM3/6/13
to Jukito
I didn't, the way I want to test it through our samples is with cucumber though. Although it won't unit test the logic of the generated class, at least any modification made to the generator will be tested through a user perspective point of you. If the user behavior is unaffected, it's safe to assume that the changes in the ginjector have been done correctly.

Philippe Beaudoin

unread,
Mar 6, 2013, 10:56:17 AM3/6/13
to juk...@googlegroups.com
Yup, selenium tests are cool, but unit tests are cooler.
(I say it only because I know you disagree. ;))

Here, though, I was talking about GWT itself. Do they have unit tests for their generators?

Christian Goudreau

unread,
Mar 6, 2013, 11:01:15 AM3/6/13
to Jukito
But I don't... selenium tests are slow! But can touch human behavior more closely and are less likely to change in a refactor :D

Przemyslaw Galazka

unread,
Mar 6, 2013, 4:26:21 PM3/6/13
to juk...@googlegroups.com
@Christian - your selenium or cucumber tests are nice but for now I have not seen usage for it in dynamic gwt app where html structure change a lot and the id's are auto-generated.
But I really would like to see it works.. Thus I keep waiting for your cucumber fixture to be  open sourced :)  

@Philippe -  I have seen some test in GWT trunk for RequestFactory. All of them were based on GwtTestCase and that sucks totally. 

Regarding code generation.

I take a look at code generator for Drivers. Seems like AbstractEditorDriverGenerator generates your driver as normal java class. 
When debugging GwtTest you can see real implementation of your Driver which is generated by gwt-test-utils. 

To summarize. I think that gwt-test-utils can help in some use cases and is great tool. My integration is only about to bring Jukito mock injection to test based on gwt-test-utils.

Do you now understand the purpose of proposed @GwtCreate  annotation :) ?


Pozdrawiam
Przemek Gałązka


You received this message because you are subscribed to a topic in the Google Groups "Jukito" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jukito/aEUlo5LAjCA/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to jukito+un...@googlegroups.com.

Christian Goudreau

unread,
Mar 9, 2013, 10:24:43 AM3/9/13
to Jukito
I take a look at code generator for Drivers. Seems like AbstractEditorDriverGenerator generates your driver as normal java class. 
That is true and that is one of the reasons why GWT is slow. There's so much code generation behind. Which in turns will then be compiled to JS.

I would like to see if we can kick in the first phase of GWT compilation which is to create the java classes, before testing anything.

Przemyslaw Galazka

unread,
Apr 11, 2013, 2:39:24 PM4/11/13
to juk...@googlegroups.com
@Christian  how it is going with cucumber fixture to be  open sourced?

Christian Goudreau

unread,
Apr 13, 2013, 4:35:55 PM4/13/13
to Jukito
You can see in GWTP the new CarStore that is using Cucumber for tests.

Przemyslaw Galazka

unread,
Apr 16, 2013, 5:14:18 AM4/16/13
to juk...@googlegroups.com
Thanks man, 
Reply all
Reply to author
Forward
0 new messages