I'm assuming it would go in the same package as the class it is testing. Is that right? I just want to make sure that test classes don't get packaged with the built war file.
-
what do you use for packaging? ant or maven? – Manolo Carrasco Moñino May 28 '13 at 18:25
-
Heven't thought of that yet. I don't really know much about building projects. I have maven installed due to some dependencies on github, but I'm curious which one is easier to learn and use. – EternallyCurious May 29 '13 at 09:48
1 Answers
Since you don't have a defined idea about what to use, maven or ant, I would recommend that you go with maven.
Using maven, your tests will be in the folder src/test/java
and your app classes will be in src/main/java
. You can use the same namespaces so as you can access protected stuff. And maven will not package any test in the final artifact.
To setup a gwt maven project you can do either, create it from scratch which is a hard process, or use a tool for it.
1- In the gwt sdk there is a command to setup a new project with an example test:
webAppCreator -maven -out myproject com.example.myproject
2- You can use an archetype to setup a new project, normally I use gwtquery one because of its simplicity and it creates an example test.
mvn archetype:generate -DarchetypeGroupId=com.googlecode.gwtquery \
-DarchetypeArtifactId=gquery-archetype \
-DarchetypeVersion=1.3.3 \
-DgroupId=com.mycompany \
-DartifactId=myproject \
-DprojectName=MyProject
3- For multimodule projects you have good archetypes by tbroyer here, but unfortunately they dont setup any example test.

- 9,723
- 1
- 22
- 27
-
Thanks. One more question for you. http://stackoverflow.com/questions/16812283/how-would-you-add-maven-to-an-existing-gwt-project-in-eclipse-with-m2e-installed – EternallyCurious May 29 '13 at 11:08