0

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.

EternallyCurious
  • 2,345
  • 7
  • 47
  • 78

1 Answers1

2

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.

Manolo Carrasco Moñino
  • 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