-
1. Re: Is it possible to use Errai Annotation processes to generate code??
cristianmiranda Sep 5, 2014 1:55 PM (in response to magick93)Hi guys,
This is a very good idea, I think this can help us a lot with automated testing.
If there is not an Errai annotation that do this kind of magic, what do you recommend in order to achieve the same result? Maybe using reflection to create the Arquillian pages after scanning the original classes? It's just a thought.
I would like to here from you about this.
Thanks!
-
2. Re: Is it possible to use Errai Annotation processes to generate code??
ddadlani Sep 8, 2014 4:45 PM (in response to magick93)Hello Anton,
Currently there is no existing functionality to do this, but it may be possible. You could generate a Page Object for each of your @Pages at rebind time (see errai/NavigationGraphGenerator.java at master · errai/errai · GitHub as an example of how to generate source) and use that to test your code.
Alternatively, you could also use a Java Annotation processor to do the same.
Do let us know if you are able to implement this as other Errai users may be interested in your code.
Cheers,
Divya -
3. Re: Is it possible to use Errai Annotation processes to generate code??
csa Sep 22, 2014 1:17 PM (in response to ddadlani)Hi,
Just an addition to the comment above. You don't want to use GWT's rebind phase to generate Arquillian/Graphene page objects because they will contain non-translatable code (i.e. Selenium's WebElement). So, a custom Java annotation processor is the way to go in this case.
There has also been discussions around switching to Java annotation processors for GWT code generation in the future:
https://plus.google.com/117292705672170699891/posts/Z3q1nkfkKWK
So, for now I'd say, use GWT's and Errai's (@GenerateAsync) built-in code generation mechanisms if you want to generate GWT-translatable code, otherwise use Java annotation processors.
Cheers,
Christian