...
You can also generate the static coverage file using the coverage tool shipped with SOAtest, though it lacks the advantages of using the source code described above. To do so, you need to run the tool independently of SOAtest, passing the binary, filter, license, and other properties when you do (see the sample license properties file below). An example using the Jtest coverage tool (jtestcov) against Parabank is shown below:
| Code Block |
|---|
java -jar jtestcov.jar -soatest -app c:/<PATH_TO_APPLICATION>/parabank.war -include com/parasoft/parabank/** -settings c:/<PATH_TO_LICENSE_FILE>/licensesettings.properties |
| Info |
|---|
The |
| Code Block | ||
|---|---|---|
| ||
# === DTP SERVER SETTINGS ===
# Specifies URL of the DTP server in the | ||
| Code Block | ||
| ||
# === LICENSE ===
# === END USER LICENSE AGREEMENT ===
# Set to true to accept the Parasoft End User License Agreement (EULA).
# Please review the EULA.txt file included in the product installation directory.
#parasoft.eula.accepted=false
# === LOCAL LICENSE ===
# Enables local license - be sure to specify password.
#jtest.license.use_network=false
# Specifies password for the local license.
#jtest.license.local.password=[LICENSE PASSWORD]
# === NETWORK LICENSE ===
# Enables network license - be sure to configure DTP server settings.
#jtest.license.use_network=true
# Specifies type of the network license (edition).
# Supported editions: desktop_edition, desktop_compliance_edition, server_edition, server_compliance_edition
#jtest.license.network.edition=server_edition
# Enables specific list of license features
#jtest.license.network.edition=custom_edition
#jtest.license.custom_edition_features=Jtest, Automation, Desktop Command Line, DTP Publish, Coverage, Test Impact Analysis
# === DTP SERVER SETTINGS ===
# Specifies URL of the DTP server in the form https://host[:port][/context-path]
#dtp.url=https://localhost:8443
# Specifies user name for DTP server authentication.
#dtp.user=admin
# Specifies password for DTP server authentication - use jtestcli -encodepass <PASSWORD> to encrypt the password, if needed.
#dtp.password=admin
# Specifies name of the DTP project - this settings is optional.
#dtp.project=[DTP Project Name]
# === DTP REPORTING ===
# Enables reporting test results to DTP server - be sure to configure DTP server settings.
#report.dtp.publish=true
# Specifies a build identifier used to label results. It may be unique for each build
# but may also label more than one test sessions that were executed during a specified build.
#build.id=${dtp_project}-yyyy-MM-dd
# Specifies a tag which represents an unique identifier for the run, used to distinguish it from similar runs.
# It could be constructed as minimal combination of following variables that will make it unique or specified manually.
# e.g. ${config_name}-${project_module}-${scontrol_branch}-${exec_env}
#session.tag=[tag]
# Specifies a set of tags that will be used to create coverage images in DTP server.
# Coverage images allow you to track different types of coverage, such as coverage for unit, functional, manual tests and others.
# There is a set of predefined tags that will be automatically recognized by DTP, see the examples below.
# You can also specify other tags that will be used to create coverage images.
#report.coverage.images=${dtp_project}
#report.coverage.images=${dtp_project};${dtp_project}_Unit Test
#report.coverage.images=${dtp_project};${dtp_project}_Functional Test
#report.coverage.images=${dtp_project};${dtp_project}_Manual Test
# === CONSOLE VERBOSITY LEVEL ===
# Increases console verbosity level to high.
#console.verbosity.level=high |
...
jtest.agent.runtimeData | Specifies a location on the application server for the agent to store the coverage data it collects at runtime. The following example will create files in the in
|
|---|---|
jtest.agent.includes | A comma-separated list of patterns that specify classes to be instrumented. The following wildcards are supported:
In the following example, all classes from the
|
jtest.agent.includesexcludes | A comma-separated list of patterns that specify classes to be instrumentedexcluded from instrumentation. The following wildcards are supported:
In the following example, all classes from the
|
jtest.agent.autostart | Enables/disables automatic runtime data collection. The default is true. |
jtest.agent.port | Sets up agent communication port. The default is 8050. |
jtest.agent.excludesdebug | Enables/disables verbose output to console. The default is false. |
jtest.agent.enableMultiuserCoverage | Enables/disables collecting web application coverage for multiple users. The default is A comma-separated list of patterns that specify classes to be excluded from instrumentation. The following wildcards are supported:
In the following example, all classes from the com/myapp/transport/*,com/myapp/autogen/** |
jtest.agent.autostartautoloadMultiuserLibs | Enables/disables automatic runtime data collectionloading of multiuser libraries (OpenTelemetry javaagent) when jtest.agent.enableMultiuserCoverage is set to true. The default value is true. |
jtest.agent.port serverEnabled | Activates the agentSets up agent communication port. The default is 8050. |
jtest.agent.debugenableJacoco | Enables /disables verbose output to consolethe agent to collect coverage using the JaCoCo engine. The default is false. |
jtest.agent.enableMultiuserCoverage .appLocationIncludes | A comma-separated list of path patterns that specify the location of application files that should be used by CTP to determine what manual tests have been impacted by code changes. The following wildcards are supported:
false. |
jtest.agent.autoloadMultiuserLibs | Enables/disables automatic loading of multiuser libraries (OpenTelemetry javaagent) when jtest.agent.enableMultiuserCoverage is set to true. The default value is true. |
jtest.agent.serverEnabled | Activates the agent. |
jtest.agent.enableJacoco | Enables the agent to collect coverage using the JaCoCo engine. The default is false. |
appLocationExcludes | A comma-separated list of path patterns that specify the location of application files that are within a location indicated by jtest.agest.appLocationIncludes but do not need to be considered when CTP determines manual tests that have been impacted by code changes. Excluding files this way can greatly decrease the time needed to analyze files for changes. The following wildcards are supported:
|
When the properties are configured, add a -javaagent argument when starting your application server to attach the agent and include the agent configuration file:
...
- When
jtest.agent.enableMultiuserCoverageis enabled, jtest-otel-ext.jar and opentelemetry-javaagent.jar will be automatically loaded from the agent.jar directory. - The "default" user (the user who has not specified their ID) may collect extra coverage information from other users who are accessing the same web application.
- Coverage collected for multithreaded applications may, in some cases, not be assigned to individual users. This is related to OpenTelemetry limitations regarding context sharing between threads.
- Collecting coverage with the Jacoco engine is not supported.
- Coverage data collected for web application initialization is not assigned to a specific user, but to the "default" user.
| Anchor | ||||
|---|---|---|---|---|
|
The dotTEST coverage agent can collect coverage for web applications and standalone applications. Each requires a different configuration.
...