Class PythonTestMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
de.iip_ecosphere.platform.tools.maven.python.PythonTestMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="test-python",
defaultPhase=TEST)
public class PythonTestMojo
extends org.apache.maven.plugin.AbstractMojo
Maven Mojo for Python unit tests.
- Author:
- Alexander Weber, SSE, Holger Eichelberger, SSE
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate org.apache.maven.shared.model.fileset.FileSetA specificfileSetrule to select files and directories.private booleanprivate Stringprivate org.apache.maven.project.MavenProjectprivate Stringprivate Stringprivate booleanprivate booleanprivate Stringprivate intFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidAdds a path given with slashes topathsas OS-specific path.private String[]Composes the environment for the python exec call.voidexecute()intgetTestedFileCount(boolean reset) Returns the number of tested files.private StringrunPythonTest(String[] cmd, String workingDirectory, String[] envp) Running the syntax check for the python Files.voidModify the test file.Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
project
@Parameter(defaultValue="${project}", required=true, readonly=true) private org.apache.maven.project.MavenProject project -
failOnError
@Parameter(property="python-test.failOnError", defaultValue="true") private boolean failOnError -
modelProject
@Parameter(property="python-test.modelProject", defaultValue="../../../target/pySrc") private String modelProject -
surefireSkip
@Parameter(property="skipTests", required=false, defaultValue="false") private boolean surefireSkip -
mavenSkip
@Parameter(property="maven.test.skip", required=false, defaultValue="false") private boolean mavenSkip -
skip
@Parameter(property="python-test.skip", required=false, defaultValue="false") private boolean skip -
test
-
python
-
pythonPath
-
fileset
@Parameter(required=false) private org.apache.maven.shared.model.fileset.FileSet filesetA specificfileSetrule to select files and directories. -
testedFileCount
private int testedFileCount
-
-
Constructor Details
-
PythonTestMojo
public PythonTestMojo()
-
-
Method Details
-
setTest
Modify the test file. [testing]- Parameters:
test- the test file
-
getTestedFileCount
public int getTestedFileCount(boolean reset) Returns the number of tested files.- Parameters:
reset- shall the number be reset- Returns:
- the number of tested files
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
composeEnvironment
Composes the environment for the python exec call.- Returns:
- the environment, my be null for none
-
runPythonTest
Running the syntax check for the python Files.- Parameters:
cmd- the command to run, shall run a python fileworkingDirectory- the directory of the python tests- Returns:
- The output to add to the other outputs
-
add
Adds a path given with slashes topathsas OS-specific path.- Parameters:
paths- the paths list to be modifiedpath- the path to be added
-