@Mojo(name="test",
defaultPhase=TEST,
requiresDependencyResolution=TEST,
threadSafe=true)
public class JooTestMojo
extends org.apache.maven.plugin.AbstractMojo
jooUnitJettyPortLowerBound and
jooUnitJettyPortUpperBound and prints out the resulting test app URL.
Tests are executed in one of three ways:
jooUnitSeleniumRCHost with the test app URL and tries to collect the test result
through Selenium.
interactiveJooUnitTests
(mvn test -DinteractiveJooUnitTests), which simply halts Maven execution
and gives you the opportunity to load and debug the test app in a browser.
jooUnitTestExecutionTimeout (ms)
and interrupt the tests after that time, resulting in a test failure.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
debugTests
Whether to load the test application in debug mode (#joo.debug).
|
protected org.apache.maven.project.MavenProject |
project
The maven project.
|
protected org.apache.maven.repository.RepositorySystem |
repositorySystem
Used to look up Artifacts in the remote repository.
|
protected File |
testOutputDirectory
Directory whose joo/classes sub-directory contains compiled test classes.
|
protected List<org.apache.maven.model.Resource> |
testResources
the project's test resources
|
| Constructor and Description |
|---|
JooTestMojo() |
| Modifier and Type | Method and Description |
|---|---|
void |
createAppJson() |
protected void |
createWebApp(File webappDirectory)
Create the Jangaroo Web app in the given Web app directory.
|
void |
execute() |
protected String |
getJettyUrl(org.eclipse.jetty.server.Server server) |
protected String |
getTestUrl(org.eclipse.jetty.server.Server server) |
protected org.eclipse.jetty.server.Server |
jettyRunTest(boolean tryPortRange) |
void |
setSkip(boolean b) |
void |
setSkipTests(boolean b) |
void |
setTestFailureIgnore(boolean b) |
void |
setTestResources(List<org.apache.maven.model.Resource> resources) |
void |
setTestSourceDirectory(File f) |
protected void |
stopServerIgnoreException(org.eclipse.jetty.server.Server server) |
protected org.apache.maven.plugin.MojoExecutionException |
wrap(Exception e) |
@Parameter(defaultValue="${project}",
required=true,
readonly=true)
protected org.apache.maven.project.MavenProject project
@Parameter(defaultValue="${project.build.testOutputDirectory}")
protected File testOutputDirectory
@Parameter(defaultValue="false") protected boolean debugTests
@Parameter(defaultValue="${project.testResources}")
protected List<org.apache.maven.model.Resource> testResources
@Inject protected org.apache.maven.repository.RepositorySystem repositorySystem
public void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprotected void createWebApp(File webappDirectory) throws org.apache.maven.plugin.MojoExecutionException
webappDirectory - the directory where to build the Jangaroo Web app.org.apache.maven.plugin.MojoExecutionException - if anything goes wrongpublic void createAppJson()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected String getJettyUrl(org.eclipse.jetty.server.Server server)
protected org.eclipse.jetty.server.Server jettyRunTest(boolean tryPortRange)
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected org.apache.maven.plugin.MojoExecutionException wrap(Exception e)
protected void stopServerIgnoreException(org.eclipse.jetty.server.Server server)
protected String getTestUrl(org.eclipse.jetty.server.Server server) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic void setSkip(boolean b)
public void setSkipTests(boolean b)
public void setTestSourceDirectory(File f)
public void setTestResources(List<org.apache.maven.model.Resource> resources)
public void setTestFailureIgnore(boolean b)
Copyright © 2002–2017 CoreMedia AG. All rights reserved.