gwt:test

Full name:

org.codehaus.mojo:gwt-maven-plugin:2.4.0:test

Description:

Mimic surefire to run GWTTestCases during integration-test phase, until SUREFIRE-508 is fixed

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: test.
  • Binds by default to the lifecycle phase: integration-test.

Required Parameters

Name Type Since Description
generateDirectory File - Folder where generated-source will be created (automatically added to compile classpath).
Default value is: ${project.build.directory}/generated-sources/gwt.

Optional Parameters

Name Type Since Description
compileSourcesArtifacts String[] - Artifacts to be included as source-jars in GWTCompiler Classpath. Removes the restriction that source code must be bundled inside of the final JAR when dealing with external utility libraries not designed exclusivelly for GWT. The plugin will download the source.jar if necessary. This option is a workaround to avoid packaging sources inside the same JAR when splitting and application into modules. A smaller JAR can then be used on server classpath and distributed without sources (that may not be desirable).
deploy File 2.3.0-1 The directory into which deployable but not servable output files will be written (defaults to 'WEB-INF/deploy' under the webappDirectory directory/jar, and may be the same as the extra directory/jar)
excludes String - Comma separated list of ant-style exclusion patterns for GWT integration tests
extraJvmArgs String - Extra JVM arguments that are passed to the GWT-Maven generated scripts (for compiler, shell, etc - typically use -Xmx512m here, or -XstartOnFirstThread, etc).

Can be set from command line using '-Dgwt.extraJvmArgs=...', defaults to setting max Heap size to be large enough for most GWT use cases.


Default value is: -Xmx512m.
gen File - Location on filesystem where GWT will write generated content for review (-gen option to GWTCompiler).

Can be set from command line using '-Dgwt.gen=...'


Default value is: ${project.build.directory}/.generated.
gwtSdkFirstInClasspath boolean 2.1.0-1 The forked command line will use gwt sdk jars first in classpath. see issue http://code.google.com/p/google-web-toolkit/issues/detail?id=5290
Default value is: false.
htmlunit String - Configure options to run tests with HTMLUnit. The value must descrivbe the browser emulation to be used, FF2, FF3, IE6, IE7, or IE8 (possible multiple values separated by comas).
Default value is: FF3.
includes String - Comma separated list of ant-style inclusion patterns for GWT integration tests. For example, can be set to **\/*GwtTest.java to match all test class following this naming convention. Surefire plugin may then ne configured to exclude such tests.

It is recommended to use a TestSuite to run GwtTests, as they require some huge setup and are very slow. Running inside a suite allow to execute the setup only once. The default value is defined with this best practice in mind.


Default value is: **/GwtTest*.java,**/Gwt*Suite.java.
inplace boolean - Select the place where GWT application is built. In inplace mode, the warSourceDirectory is used to match the same use case of the war:inplace http://maven.apache.org/plugins/maven-war-plugin/inplace-mojo.html goal.
Default value is: false.
jvm String 1.1 Option to specify the jvm (or path to the java executable) to use with the forking scripts. For the default, the jvm will be the same as the one used to run Maven.
logLevel String - GWT logging level (-logLevel ERROR, WARN, INFO, TRACE, DEBUG, SPAM, or ALL).

Can be set from command line using '-Dgwt.logLevel=...'


Default value is: INFO.
mode String - Configure test mode. Can be set to "manual", "htmlunit", "selenium" or "remoteweb".
Default value is: manual.
module String - A single GWT module. Shortcut for <modules> or option to specify a single module from command line
modules String[] - The project GWT modules. If not set, the plugin will scan the project for .gwt.xml files.
out String - output directory for code generated by GWT for tests
Default value is: target/www-test.
productionMode boolean - run tests using production mode rather than development (a.k.a. hosted) mode.
Default value is: false.
remoteweb String - Configure options to run tests RemoteWebBrowser. The value must describe remote web URL, like "rmi://myhost/ie8"

You must start BrowserManagerServer before running tests with this option (gwt:browser).


reportsDirectory File - Directory for test reports, defaults to surefire one to match the surefire-report plugin
Default value is: ${project.build.directory}/surefire-reports.
selenium String - Configure options to run tests with Selenium. The value must describe the Selenium Remote Control target
skip boolean - Set this to 'true' to bypass unit tests entirely. Its use is NOT RECOMMENDED, especially if you enable it using the "maven.test.skip" property, because maven.test.skip disables both running the tests and compiling the tests. Consider using the skipTests parameter instead.
skipExec boolean - DEPRECATED This old parameter is just like skipTests, but bound to the old property maven.test.skip.exec. Use -DskipTests instead; it's shorter.
skipTests boolean - Set this to 'true' to skip running tests, but still compile them. Its use is NOT RECOMMENDED, but quite convenient on occasion.
style String - GWT JavaScript compiler output style (-style OBF[USCATED], PRETTY, or DETAILED).

Can be set from command line using '-Dgwt.style=...'


Default value is: OBF.
testFailureIgnore boolean - Set this to true to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on occasion.
testTimeOut int - Time out (in seconds) for test execution in dedicated JVM
Default value is: 60.
timeOut int - Forked process execution timeOut. Usefull to avoid maven to hang in continuous integration server.
warSourceDirectory File - Location of the web application static resources (same as maven-war-plugin parameter)
Default value is: ${basedir}/src/main/webapp.
webMode boolean - run tests using web mode rather than developer (a.k.a. hosted) mode
Default value is: false.
webappDirectory File - Location on filesystem where GWT will write output files (-out option to GWTCompiler).
Default value is: ${project.build.directory}/${project.build.finalName}.

Parameter Details

compileSourcesArtifacts:

Artifacts to be included as source-jars in GWTCompiler Classpath. Removes the restriction that source code must be bundled inside of the final JAR when dealing with external utility libraries not designed exclusivelly for GWT. The plugin will download the source.jar if necessary. This option is a workaround to avoid packaging sources inside the same JAR when splitting and application into modules. A smaller JAR can then be used on server classpath and distributed without sources (that may not be desirable).
  • Type: java.lang.String[]
  • Required: No

deploy:

The directory into which deployable but not servable output files will be written (defaults to 'WEB-INF/deploy' under the webappDirectory directory/jar, and may be the same as the extra directory/jar)
  • Type: java.io.File
  • Since: 2.3.0-1
  • Required: No

excludes:

Comma separated list of ant-style exclusion patterns for GWT integration tests
  • Type: java.lang.String
  • Required: No

extraJvmArgs:

Extra JVM arguments that are passed to the GWT-Maven generated scripts (for compiler, shell, etc - typically use -Xmx512m here, or -XstartOnFirstThread, etc).

Can be set from command line using '-Dgwt.extraJvmArgs=...', defaults to setting max Heap size to be large enough for most GWT use cases.

  • Type: java.lang.String
  • Required: No
  • Expression: ${gwt.extraJvmArgs}
  • Default: -Xmx512m

gen:

Location on filesystem where GWT will write generated content for review (-gen option to GWTCompiler).

Can be set from command line using '-Dgwt.gen=...'

  • Type: java.io.File
  • Required: No
  • Expression: ${gwt.gen}
  • Default: ${project.build.directory}/.generated

generateDirectory:

Folder where generated-source will be created (automatically added to compile classpath).
  • Type: java.io.File
  • Required: Yes
  • Default: ${project.build.directory}/generated-sources/gwt

gwtSdkFirstInClasspath:

The forked command line will use gwt sdk jars first in classpath. see issue http://code.google.com/p/google-web-toolkit/issues/detail?id=5290
  • Type: boolean
  • Since: 2.1.0-1
  • Required: No
  • Expression: ${gwt.gwtSdkFirstInClasspath}
  • Default: false

htmlunit:

Configure options to run tests with HTMLUnit. The value must descrivbe the browser emulation to be used, FF2, FF3, IE6, IE7, or IE8 (possible multiple values separated by comas).
  • Type: java.lang.String
  • Required: No
  • Expression: ${gwt.test.htmlunit}
  • Default: FF3

includes:

Comma separated list of ant-style inclusion patterns for GWT integration tests. For example, can be set to **\/*GwtTest.java to match all test class following this naming convention. Surefire plugin may then ne configured to exclude such tests.

It is recommended to use a TestSuite to run GwtTests, as they require some huge setup and are very slow. Running inside a suite allow to execute the setup only once. The default value is defined with this best practice in mind.

  • Type: java.lang.String
  • Required: No
  • Default: **/GwtTest*.java,**/Gwt*Suite.java

inplace:

Select the place where GWT application is built. In inplace mode, the warSourceDirectory is used to match the same use case of the war:inplace http://maven.apache.org/plugins/maven-war-plugin/inplace-mojo.html goal.
  • Type: boolean
  • Required: No
  • Expression: ${gwt.inplace}
  • Default: false

jvm:

Option to specify the jvm (or path to the java executable) to use with the forking scripts. For the default, the jvm will be the same as the one used to run Maven.
  • Type: java.lang.String
  • Since: 1.1
  • Required: No
  • Expression: ${gwt.jvm}

logLevel:

GWT logging level (-logLevel ERROR, WARN, INFO, TRACE, DEBUG, SPAM, or ALL).

Can be set from command line using '-Dgwt.logLevel=...'

  • Type: java.lang.String
  • Required: No
  • Expression: ${gwt.logLevel}
  • Default: INFO

mode:

Configure test mode. Can be set to "manual", "htmlunit", "selenium" or "remoteweb".
  • Type: java.lang.String
  • Required: No
  • Expression: ${gwt.test.mode}
  • Default: manual

module:

A single GWT module. Shortcut for <modules> or option to specify a single module from command line
  • Type: java.lang.String
  • Required: No
  • Expression: ${gwt.module}

modules:

The project GWT modules. If not set, the plugin will scan the project for .gwt.xml files.
  • Type: java.lang.String[]
  • Required: No

out:

output directory for code generated by GWT for tests
  • Type: java.lang.String
  • Required: No
  • Default: target/www-test

productionMode:

run tests using production mode rather than development (a.k.a. hosted) mode.
  • Type: boolean
  • Required: No
  • Expression: ${gwt.test.prod}
  • Default: false

remoteweb:

Configure options to run tests RemoteWebBrowser. The value must describe remote web URL, like "rmi://myhost/ie8"

You must start BrowserManagerServer before running tests with this option (gwt:browser).

  • Type: java.lang.String
  • Required: No
  • Expression: ${gwt.test.remoteweb}

reportsDirectory:

Directory for test reports, defaults to surefire one to match the surefire-report plugin
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.directory}/surefire-reports

selenium:

Configure options to run tests with Selenium. The value must describe the Selenium Remote Control target
  • Type: java.lang.String
  • Required: No
  • Expression: ${gwt.test.selenium}

skip:

Set this to 'true' to bypass unit tests entirely. Its use is NOT RECOMMENDED, especially if you enable it using the "maven.test.skip" property, because maven.test.skip disables both running the tests and compiling the tests. Consider using the skipTests parameter instead.
  • Type: boolean
  • Required: No
  • Expression: ${maven.test.skip}

skipExec:

DEPRECATED This old parameter is just like skipTests, but bound to the old property maven.test.skip.exec. Use -DskipTests instead; it's shorter.
  • Type: boolean
  • Required: No
  • Expression: ${maven.test.skip.exec}

skipTests:

Set this to 'true' to skip running tests, but still compile them. Its use is NOT RECOMMENDED, but quite convenient on occasion.
  • Type: boolean
  • Required: No
  • Expression: ${skipTests}

style:

GWT JavaScript compiler output style (-style OBF[USCATED], PRETTY, or DETAILED).

Can be set from command line using '-Dgwt.style=...'

  • Type: java.lang.String
  • Required: No
  • Expression: ${gwt.style}
  • Default: OBF

testFailureIgnore:

Set this to true to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on occasion.
  • Type: boolean
  • Required: No
  • Expression: ${maven.test.failure.ignore}

testTimeOut:

Time out (in seconds) for test execution in dedicated JVM
  • Type: int
  • Required: No
  • Default: 60

timeOut:

Forked process execution timeOut. Usefull to avoid maven to hang in continuous integration server.
  • Type: int
  • Required: No

warSourceDirectory:

Location of the web application static resources (same as maven-war-plugin parameter)
  • Type: java.io.File
  • Required: No
  • Default: ${basedir}/src/main/webapp

webMode:

run tests using web mode rather than developer (a.k.a. hosted) mode
  • Type: boolean
  • Required: No
  • Expression: ${gwt.test.web}
  • Default: false

webappDirectory:

Location on filesystem where GWT will write output files (-out option to GWTCompiler).
  • Type: java.io.File
  • Required: No
  • Expression: ${gwt.war}
  • Default: ${project.build.directory}/${project.build.finalName}