This section provides information about the Jtest tasks for Gradle and their parameters. The following tasks are available:
The Gradle task to execute Jtest. Attributes
Parameter Details
|
-Djtest.jvmArgs="<-Dproperty1=value> <-Dproperty2=value>" |
Example:
-Djtest.jvmArgs="-Duser.language=zh -Duser.country=CN" |
jtest.jvmArgsSpecifies the input scope for analysis. If no resources are specified, Jtest will analyze resources from every built project.
Use the following pattern to specify the paths: ${ProjectName}/my/src/dir/my/package/file.java". You can use the following wildcards:
An absolute or relative path to the *properties file that includes custom configuration settings.
Some of the setting names may not be consistent with the settings dedicated for the build system plugins. See Configuration Settings for details. |
The project name template. By default, the following pattern is used to create project names in json: "group:name". This parameter allows you to configure the pattern with the options [group], [name], [version], [path], and [basedir], for example, to make a project name compatible with the project name in Eclipse.
If you change the pattern for a project that has already been integrated with DTP, DTP will not recognize your project. It will assume that your project after the change of the pattern is a different project. For details, see the DTP documentation. |
The following examples assume that the Jtest Plugin for Gradle has been properly configured and applied in the Gradle build script; see Configuring the Jtest Plugin for Gradle.
jtest {
home = "path/to/jtest"
compilation {
id = "main"
override = true
}
} |
jtest {
home = "path/to/jtest"
resources = [
"**.java",
"myGradleProjectName/src/com/mycompany/models/**/*.properties"
]
} |
jtest {
home = "path/to/jtest"
exclude = "com/mycompany/models/**/NotInteresting*.properties"
} |
See Compilation Data Model for more information.
The Gradle task to collect coverage with Jtest. Note: Jtest Agent cannot be used simultaneously with the JaCoCo plugin or with an externally attached JaCoCo agent. Parameters
Parameter Details
|
jtest {
/* other parameters */
coverage {
skip = false
includes = [ 'package/**' ]
excludes = [ ]
testIncludes = [ 'package/Test.class' ]
testExcludes = [ ]
}
} |
The default is: ${basedir}/parasoft/jtest-instrument/runtimedata.data
The default is: ${basedir}/parasoft/jtest-instrument/metadata.data
This task scans the build to generate settings for the Jtest Java Agent, and creates a monitor package in location specified with the monitorLocation parameter. The monitor package contains the following:
Parameters
Parameter Details
|
-Djtest.jvmArgs="<-Dproperty1=value> <-Dproperty2=value>" |
Example:
-Djtest.jvmArgs="-Duser.language=zh -Duser.country=CN" |
jtest.jvmArgsSpecifies the input scope for analysis. If no resources are specified, Jtest will analyze resources from every built project.
Use the following pattern to specify the paths: ${ProjectName}/my/src/dir/my/package/file.java". You can use the following wildcards:
An absolute or relative path to the *properties file that includes custom configuration settings.
Some of the setting names may not be consistent with the settings dedicated for the build system plugins. See Configuration Settings for details. |
The project name template. By default, the following pattern is used to create project names in json: "group:name". This parameter allows you to configure the pattern with the options [group], [name], [version], [path], and [basedir], for example, to make a project name compatible with the project name in Eclipse.
If you change the pattern for a project that has already been integrated with DTP, DTP will not recognize your project. It will assume that your project after the change of the pattern is a different project. For details, see the DTP documentation. |
The following examples assume that the Jtest Plugin for Gradle has been properly configured and applied in the Gradle build script; see Configuring the Jtest Plugin for Gradle.
jtest {
home = "path/to/jtest"
compilation {
id = "main"
override = true
}
} |
jtest {
home = "path/to/jtest"
resources = [
"**.java",
"myGradleProjectName/src/com/mycompany/models/**/*.properties"
]
} |
jtest {
home = "path/to/jtest"
exclude = "com/mycompany/models/**/NotInteresting*.properties"
} |
See Compilation Data Model for more information.
This goal is provided by the test impact analysis plugin shipped with Jtest and allows you to perform change-based testing of your project (see Test Impact Analysis). Required Parameters
Optional Parameters
|