org.codehaus.mojo.gwt.shell
Class TestMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.gwt.AbstractGwtMojo
          extended by org.codehaus.mojo.gwt.AbstractGwtModuleMojo
              extended by org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo
                  extended by org.codehaus.mojo.gwt.shell.TestMojo
All Implemented Interfaces:
ContextEnabled, Mojo, GwtModuleReader
Direct Known Subclasses:
EclipseTestMojo

public class TestMojo
extends AbstractGwtShellMojo

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

Version:
$Id: TestMojo.java 9466 2009-04-16 12:03:15Z ndeloof $
Author:
Nicolas De Loof
See Also:
http://code.google.com/intl/fr/webtoolkit/doc/latest/DevGuideTesting.html
Is bound to the specified phase of the standard build lifecycle:
integration-test
Requires the dependencies in this specified scope:
test
Is defined by the goal name:
test

Nested Class Summary
 
Nested classes/interfaces inherited from class org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo
AbstractGwtShellMojo.JavaCommand
 
Field Summary
protected  String excludes
          Comma separated list of ant-style exclusion patterns for GWT integration tests
protected  String includes
          Comma separated list of ant-style inclusion patterns for GWT integration tests.
 
Fields inherited from class org.codehaus.mojo.gwt.AbstractGwtModuleMojo
GWT_MODULE_EXTENSION
 
Fields inherited from class org.codehaus.mojo.gwt.AbstractGwtMojo
artifactFactory, classpathBuilder, GWT_GROUP_ID, gwtSdkFirstInClasspath, localRepository, remoteRepositories, resolver, warSourceDirectory
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
TestMojo()
           
 
Method Summary
protected  void addCompileSourceRoot(File path)
           
protected  URL[] addProjectClasspathElements(URL[] originalUrls)
          Add project classpath element to a classpath URL set
 void doExecute()
           
protected  ClassLoader getClassLoader()
          Need this to run both pre- and post- PLX-220 fix.
protected  String getGwtArgs()
           
protected  ClassLoader getProjectClassLoader()
           
protected  void postProcessClassPath(Collection<File> classpath)
          hook to post-process the dependency-based classpath
 void setTestTimeOut(int testTimeOut)
           
 
Methods inherited from class org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo
execute, getExtraJvmArgs, getGen, getJvm, getLogLevel, getStyle, setTimeOut
 
Methods inherited from class org.codehaus.mojo.gwt.AbstractGwtModuleMojo
getGwtModules, getModules, readModule
 
Methods inherited from class org.codehaus.mojo.gwt.AbstractGwtMojo
addClasspathElements, getClasspath, getGenerateDirectory, getGwtDevJar, getGwtUserJar, getLocalRepository, getOutputDirectory, getProject, getProjectArtifacts, getRemoteRepositories, resolve
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

includes

protected String 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.

Is defined by:
default-value:
**\/GwtTest*.java,**\/Gwt*Suite.java

excludes

protected String excludes
Comma separated list of ant-style exclusion patterns for GWT integration tests

Is defined by:
Constructor Detail

TestMojo

public TestMojo()
Method Detail

doExecute

public void doExecute()
               throws MojoExecutionException,
                      MojoFailureException
Specified by:
doExecute in class AbstractGwtShellMojo
Throws:
MojoExecutionException
MojoFailureException

getGwtArgs

protected String getGwtArgs()

postProcessClassPath

protected void postProcessClassPath(Collection<File> classpath)
                             throws MojoExecutionException
Description copied from class: AbstractGwtShellMojo
hook to post-process the dependency-based classpath

Overrides:
postProcessClassPath in class AbstractGwtShellMojo
Throws:
MojoExecutionException

getProjectClassLoader

protected ClassLoader getProjectClassLoader()
                                     throws DependencyResolutionRequiredException,
                                            MalformedURLException
Returns:
the project classloader
Throws:
DependencyResolutionRequiredException - failed to resolve project dependencies
MalformedURLException - configuration issue ?

addCompileSourceRoot

protected void addCompileSourceRoot(File path)
Overrides:
addCompileSourceRoot in class AbstractGwtModuleMojo
Parameters:
path - file to add to the project compile directories

addProjectClasspathElements

protected URL[] addProjectClasspathElements(URL[] originalUrls)
                                     throws MojoExecutionException
Add project classpath element to a classpath URL set

Parameters:
originalUrls - the initial URL set
Returns:
full classpath URL set
Throws:
MojoExecutionException - some error occured

getClassLoader

protected ClassLoader getClassLoader()
                              throws MojoExecutionException
Need this to run both pre- and post- PLX-220 fix.

Returns:
a ClassLoader including plugin dependencies and project source foler
Throws:
MojoExecutionException - failed to configure ClassLoader

setTestTimeOut

public void setTestTimeOut(int testTimeOut)
Parameters:
testTimeOut - the testTimeOut to set


Copyright © 2007-2012 Codehaus. All Rights Reserved.