public abstract class AbstractJasmineMojo extends org.apache.maven.plugin.AbstractMojo implements JasmineConfiguration
| Modifier and Type | Field and Description |
|---|---|
protected int |
autoRefreshInterval
Automatically refresh the test runner at the given interval (specified in seconds) when using the
jasmine:bdd goal. |
protected String |
browserVersion
Determines the browser and version profile that HtmlUnit will simulate.
|
protected String |
customRunnerConfiguration
Sometimes you want to have full control over how scriptloaders are configured.
|
protected String |
customRunnerTemplate
It may be the case that the jasmine-maven-plugin doesn't currently suit all of your needs,
and as a result the generated SpecRunner HTML files are set up in a way that you can't run
your specs.
|
protected boolean |
debug
True to increase HtmlUnit output and attempt reporting on specs even if a timeout occurred.
|
protected String |
format
Determines the format that jasmine:test will print to console.
|
protected boolean |
haltOnFailure
Halt the build on test failure.
|
protected File |
jasmineTargetDir
Target directory for files created by the plugin.
|
protected String |
junitXmlReportFileName
The name of the generated JUnit XML report.
|
protected boolean |
keepServerAlive
Keep the server alive after the
jasmine:test goal exists. |
protected org.codehaus.plexus.resource.ResourceManager |
locator |
protected String |
manualSpecRunnerHtmlFileName
The name of the Manual Spec Runner.
|
protected org.apache.maven.project.MavenProject |
mavenProject |
protected List<String> |
preloadSources
JavaScript sources (typically vendor/lib dependencies) that need to be loaded
before other sources (and specs) in a particular order.
|
protected String |
scriptLoaderPath
Deprecated.
Specify script loader path using the
preloadSources parameter instead. |
protected int |
serverPort
Used by the
jasmine:bdd goal to specify port to run the server under. |
protected boolean |
skipTests
Skip the tests.
|
protected String |
sourceEncoding
The source encoding.
|
protected ScriptSearch |
sources |
protected String |
specDirectoryName
The name of the directory the specs will be deployed to on the server.
|
protected String |
specRunnerHtmlFileName
The name of the Spec Runner file.
|
protected SpecRunnerTemplate |
specRunnerTemplate
Determines the strategy to use when generation the JasmineSpecRunner.
|
protected ScriptSearch |
specs |
protected String |
srcDirectoryName
The name of the directory the sources will be deployed to on the server.
|
protected StringifiesStackTraces |
stringifiesStackTraces |
protected int |
timeout
Timeout for spec execution in seconds.
|
protected Map<String,String> |
webDriverCapabilities
Web driver capabilities used to initialize a DesiredCapabilities instance when creating a web driver.
|
protected String |
webDriverClassName
Determines the Selenium WebDriver class we'll use to execute the tests.
|
| Constructor and Description |
|---|
AbstractJasmineMojo() |
| Modifier and Type | Method and Description |
|---|---|
void |
execute() |
int |
getAutoRefreshInterval() |
File |
getBasedir() |
File |
getCustomRunnerConfiguration() |
File |
getCustomRunnerTemplate() |
File |
getJasmineTargetDir() |
org.apache.maven.project.MavenProject |
getMavenProject() |
List<String> |
getPreloadSources() |
String |
getScriptLoaderPath()
Deprecated.
|
String |
getSourceEncoding() |
ScriptSearch |
getSources() |
String |
getSpecDirectoryName() |
SpecRunnerTemplate |
getSpecRunnerTemplate() |
ScriptSearch |
getSpecs() |
String |
getSrcDirectoryName() |
abstract void |
run() |
getLog, getPluginContext, setLog, setPluginContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLog@Parameter(defaultValue="org.openqa.selenium.htmlunit.HtmlUnitDriver") protected String webDriverClassName
Some valid examples:
@Parameter protected Map<String,String> webDriverCapabilities
@Parameter(defaultValue="FIREFOX_3_6") protected String browserVersion
Determines the browser and version profile that HtmlUnit will simulate. This setting does nothing if the plugin is configured not to use HtmlUnit.
This maps 1-to-1 with the public static instances found in BrowserVersion.
Some valid examples: CHROME, FIREFOX_3_6, INTERNET_EXPLORER_7, INTERNET_EXPLORER_8, INTERNET_EXPLORER_9
@Parameter(defaultValue="documentation") protected String format
Determines the format that jasmine:test will print to console.
Valid options:
@Parameter protected List<String> preloadSources
JavaScript sources (typically vendor/lib dependencies) that need to be loaded
before other sources (and specs) in a particular order. Each source will first be
searched for relative to ${jsSrcDir}, then ${jsTestSrcDir},
then (if it's not found in either) it will be included exactly as it appears in your POM.
Therefore, if jquery.js is in ${jsSrcDir}/vendor, you would configure:
<preloadSources> <source>vendor/jquery.js</source> </preloadSources>
And jquery.js would load before all the other sources and specs.
@Parameter protected String customRunnerTemplate
It may be the case that the jasmine-maven-plugin doesn't currently suit all of your needs, and as a result the generated SpecRunner HTML files are set up in a way that you can't run your specs. Have no fear! Simply specify a custom spec runner template in the plugin configuration and make the changes you need.
Potential values are a filesystem path, a URL, or a classpath resource. The default template is
stored in src/main/resources/jasmine-templates/SpecRunner.htmltemplate, and the
required template strings are tokenized in "$*$" patterns.
Example usage:
<customRunnerTemplate>${project.basedir}/src/test/resources/myCustomRunner.template</customRunnerTemplate>
@Parameter protected String customRunnerConfiguration
Sometimes you want to have full control over how scriptloaders are configured. In order to interpolate custom configuration into the generated runnerTemplate, specify a file containing the additional config. Potential values are a filesystem path, a URL, or a classpath resource.
Example usage:
<customRunnerConfiguration>${project.basedir}/src/test/resources/myCustomConfig.txt</customRunnerConfiguration>
@Parameter(defaultValue="${project.build.directory}${file.separator}jasmine")
protected File jasmineTargetDir
@Parameter(property="skipTests") protected boolean skipTests
@Parameter(property="haltOnFailure",
defaultValue="true")
protected boolean haltOnFailure
@Parameter(defaultValue="300") protected int timeout
@Parameter(defaultValue="false") protected boolean debug
@Parameter(defaultValue="SpecRunner.html") protected String specRunnerHtmlFileName
@Parameter(defaultValue="ManualSpecRunner.html") protected String manualSpecRunnerHtmlFileName
@Parameter(defaultValue="TEST-jasmine.xml") protected String junitXmlReportFileName
@Parameter(defaultValue="spec") protected String specDirectoryName
@Parameter(defaultValue="src") protected String srcDirectoryName
@Parameter(defaultValue="${project.build.sourceEncoding}")
protected String sourceEncoding
@Parameter(property="keepServerAlive",
defaultValue="false")
protected boolean keepServerAlive
jasmine:test goal exists.
Useful if you need to run further analysis on your tests, like collecting code coverage.@Parameter(property="jasmine.serverPort",
defaultValue="8234")
protected int serverPort
Used by the jasmine:bdd goal to specify port to run the server under.
The jasmine:test goal always uses a random available port so this property is ignored.
@Parameter(property="jasmine.specRunnerTemplate",
defaultValue="DEFAULT")
protected SpecRunnerTemplate specRunnerTemplate
Determines the strategy to use when generation the JasmineSpecRunner. This feature allows for custom implementation of the runner generator. Typically this is used when using different script runners.
Some valid examples: DEFAULT, REQUIRE_JS
@Parameter @Deprecated protected String scriptLoaderPath
preloadSources parameter instead.Path to loader script, relative to jsSrcDir. Defaults to jsSrcDir/nameOfScript.js. Which script to look for is determined by the selected spcRunnerTemplate. I.e require.js is used when REQUIRE_JS is selected as specRunnerTemplate.
@Parameter(property="jasmine.autoRefreshInterval",
defaultValue="0")
protected int autoRefreshInterval
Automatically refresh the test runner at the given interval (specified in seconds) when using the jasmine:bdd goal.
A value of 0 disables the automatic refresh (which is the default).
@Parameter(defaultValue="${project}",
readonly=true)
protected org.apache.maven.project.MavenProject mavenProject
@Component protected org.codehaus.plexus.resource.ResourceManager locator
protected ScriptSearch sources
protected ScriptSearch specs
protected StringifiesStackTraces stringifiesStackTraces
public final void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
execute in interface org.apache.maven.plugin.Mojoorg.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionpublic String getSourceEncoding()
getSourceEncoding in interface JasmineConfigurationpublic File getCustomRunnerTemplate()
getCustomRunnerTemplate in interface JasmineConfigurationpublic SpecRunnerTemplate getSpecRunnerTemplate()
getSpecRunnerTemplate in interface JasmineConfigurationpublic File getJasmineTargetDir()
getJasmineTargetDir in interface JasmineConfigurationpublic String getSrcDirectoryName()
getSrcDirectoryName in interface JasmineConfigurationpublic ScriptSearch getSources()
getSources in interface JasmineConfigurationpublic ScriptSearch getSpecs()
getSpecs in interface JasmineConfigurationpublic String getSpecDirectoryName()
getSpecDirectoryName in interface JasmineConfigurationpublic List<String> getPreloadSources()
getPreloadSources in interface JasmineConfigurationpublic int getAutoRefreshInterval()
getAutoRefreshInterval in interface JasmineConfigurationpublic org.apache.maven.project.MavenProject getMavenProject()
public File getCustomRunnerConfiguration()
getCustomRunnerConfiguration in interface JasmineConfiguration@Deprecated public String getScriptLoaderPath()
getScriptLoaderPath in interface JasmineConfigurationpublic File getBasedir()
getBasedir in interface JasmineConfigurationCopyright © 2013. All Rights Reserved.