Freddy Mallet, sorry but I expected the license Jtestcli to run Jtest's tests .
by typing: $mvn org.codehaus.sonar: sonar-maven-plugin: 1.7: sonar
with the correct pom's ant plugin : (pom.xml)
...
<!-- Run Jtest tests during the test phase -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>test</phase>
<configuration>
<tasks>
<mkdir dir="$
{basedir}/target/site/jtest" />
<property name="maven.test.classpath" refid="maven.test.classpath"/>
<exec
dir="${basedir}
"
executable="/opt/data/parasoft-jtest-8.2/jtestcli"
failonerror="true">
<arg line="-J-Xmx1024m -source 'src/main/java' -temp_project 'TestExerciceQT2' -force -classpath '$
{maven.test.classpath}' -config 'Run Unit Tests' -report '${basedir}/target/site/jtest/CodingStandards'" />
</exec>
<exec
dir="${basedir}"
executable="/opt/data/parasoft-jtest-8.2/jtestcli"
failonerror="true">
<arg line="-J-Xmx1024m -source 'src/test/java' -temp_project 'TestExerciceQT2' -force -classpath '${maven.test.classpath}
' -config 'Run Unit Tests' -report '$
{basedir}
/target/site/jtest/UnitTestReport'" />
</exec>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
...
I get the following result:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building ExerciceQT2
[INFO] task-segment: [org.codehaus.sonar:sonar-maven-plugin:1.7:sonar] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [sonar:sonar]
[INFO] ------------------------------------------------------------------------
[INFO] Building ExerciceQT2
[INFO] task-segment: [org.codehaus.sonar:sonar-core-maven-plugin:1.7:dependencies]
[INFO] ------------------------------------------------------------------------
[INFO] [sonar-core:dependencies]
[INFO] ------------------------------------------------------------------------
[INFO] Building ExerciceQT2
[INFO] task-segment: [org.codehaus.sonar:sonar-core-maven-plugin:1.7:prepare]
.
.
.
[INFO] ------------------------------------------------------------------------
[INFO] Building ExerciceQT2
[INFO] task-segment: [org.codehaus.mojo:cobertura-maven-plugin::cobertura]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing cobertura:cobertura
[INFO] [cobertura:instrument]
[INFO] Not executing cobertura:instrument as the project is not a Java classpath-capable package
[INFO] [antrun:run
{execution: default}
]
[INFO] Executing tasks
[exec] jtestcli: Version 8.2.62 – Copyright (C) 2003-2008 Parasoft Corporation
[exec] jtestcli: Using default workspace "/opt/data/apache-tomcat/.jtest_linux/workspace"
[exec] > [0%] Running: Scope
[exec] > [4%] Computing scope
[exec] >> [4%] Initializing
[exec] >> [8%] Updating
[exec] >> [14%] Refreshing
[exec] >> [14%] Opening TestExerciceQT2.
[exec] >> [14%] Refreshing
[exec] >> [15%] TestExerciceQT2
[exec] >> [15%] Refreshing
[exec] >> [15%] Refreshing /TestExerciceQT2.
[exec] >> [20%] Refreshing
[exec] >> [20%] Building
[exec] >> [21%] TestExerciceQT2
[exec] >> [21%] Building
[exec] >> [21%] Invoking Java Builder on /TestExerciceQT2.
[exec] >> [21%] Preparing to build TestExerciceQT2
[exec] >> [21%] Cleaning output folder for TestExerciceQT2
[exec] >> [21%] Copying resources to the output folder
[exec] >> [21%] Analyzing sources
[exec] >> [22%] Compiling TestExerciceQT2/java/fr/ca/sa/com/../src/test4
[exec] >> [27%] Build done
[exec] >> [27%] Building
[exec] >> [27%] Finding files
[exec] >> [29%] TestExerciceQT2
[exec] >> [31%] Finding files
[exec] >> [33%] Applying filters
[exec] >> [33%] CompteBO.java
[exec] >> [33%] LigneDeCompteBO.java
[exec] >> [33%] AssociationLigneCompte.java
[exec] >> [33%] TypeCompte.java
[exec] >> [33%] TypeLigneCompte.java
[exec] >> [33%] PersonneBO.java
[exec] >> [36%] Applying filters
[exec] >> [36%] Computing lines to check
[exec] >> [46%] Reporting scope results
[exec] >> [46%] TestExerciceQT2
[exec] >> [49%] Reporting scope results
[exec] Total Files: 6
[exec] Files to Check: 6
[exec] Total Lines: 484
[exec] Lines to Check: 484
[exec] Excluded Files: 0
[exec] > [49%] Running: Execution
[exec] >> [61%] Precomputing selection
[exec] >> [62%] Finding types
[exec] >> [62%] Computing selection
[exec] >> [62%] Finding types
[exec] >> [62%] Computing tests
[exec] >> [63%] Adding extra files
[exec] >> [63%] Computing tested types
[exec] >> [63%] Finding types
[exec] >> [63%] Computing tested members
[exec] >> [63%] Computing unit tests
[exec] > [63%] Execution: launching tests
[exec] Executed Test Cases: 0
[exec] Runtime Exceptions: 0
[exec] Assertion Failures: 0
[exec] Contract Violations: 0
[exec] Profiling Problems: 0
[exec] Unverified Outcomes: 0
[exec] Coverage:
[exec] Line: –
[exec] > [100%] Done
[exec] > Deleting temporary project TestExerciceQT2...
[exec] ok
[exec] jtestcli: Version 8.2.62 – Copyright (C) 2003-2008 Parasoft Corporation
[exec] jtestcli: Using default workspace "/opt/data/apache-tomcat/.jtest_linux/workspace"
[exec] > [0%] Running: Scope
[exec] > [4%] Computing scope
[exec] >> [4%] Initializing
[exec] >> [8%] Updating
[exec] >> [14%] Refreshing
[exec] >> [14%] Opening TestExerciceQT2.
[exec] >> [14%] Refreshing
[exec] >> [15%] TestExerciceQT2
[exec] >> [15%] Refreshing
[exec] >> [15%] Refreshing /TestExerciceQT2.
[exec] >> [20%] Refreshing
[exec] >> [20%] Building
[exec] >> [21%] TestExerciceQT2
[exec] >> [21%] Building
[exec] >> [21%] Invoking Java Builder on /TestExerciceQT2.
[exec] >> [21%] Preparing to build TestExerciceQT2
[exec] >> [21%] Cleaning output folder for TestExerciceQT2
[exec] >> [21%] Copying resources to the output folder
[exec] >> [21%] Analyzing sources
[exec] >> [27%] Build done
[exec] >> [27%] Building
[exec] >> [27%] Finding files
[exec] >> [29%] TestExerciceQT2
[exec] >> [31%] Finding files
[exec] >> [33%] Applying filters
[exec] >> [36%] Computing lines to check
[exec] >> [46%] Reporting scope results
[exec] Total Files: 0
[exec] Files to Check: 0
[exec] Total Lines: –
[exec] Lines to Check: –
[exec] Excluded Files: 0
[exec] > [49%] Running: Execution
[exec] >> [61%] Precomputing selection
[exec] >> [62%] Finding types
[exec] >> [62%] Computing selection
[exec] >> [62%] Finding types
[exec] >> [62%] Computing tests
[exec] >> [63%] Adding extra files
[exec] >> [63%] Computing tested types
[exec] >> [63%] Finding types
[exec] >> [63%] Computing tested members
[exec] >> [63%] Computing unit tests
[exec] Executed Test Cases: 0
[exec] Runtime Exceptions: 0
[exec] Assertion Failures: 0
[exec] Contract Violations: 0
[exec] Profiling Problems: 0
[exec] Unverified Outcomes: 0
[exec] Coverage:
[exec] Line: –
[exec] > [100%] Done
[exec] > Deleting temporary project TestExerciceQT2...
[exec] ok
[INFO] Executed tasks
[INFO] [cobertura:cobertura]
[INFO] Not executing cobertura:report as the cobertura data file (/opt/data/apache-continuum_data/working-directory/81/target/cobertura/cobertura.ser) could not be found
[INFO] ------------------------------------------------------------------------
[INFO] Building ExerciceQT2
[INFO] task-segment: [org.codehaus.sonar:sonar-core-maven-plugin:1.7:collect]
[INFO] ------------------------------------------------------------------------
[INFO] [sonar-core:collect]
[INFO] org.sonar.maven.ProfileProvider Selected quality profile : D2I_Fr, language=java
[INFO] Starting class org.sonar.plugins.pmd.cpd.CpdMavenCollector
[INFO] Starting class org.sonar.plugins.pmd.PmdMavenCollector
[INFO] Starting class org.sonar.plugins.javancss.JavaNcssMavenCollector
[INFO] Starting class org.sonar.plugins.core.SaveProfileMavenCollector
[INFO] Starting class org.sonar.plugins.core.sources.ImportSourcesMavenCollector
[INFO] Starting class org.sonar.plugins.checkstyle.CheckstyleMavenCollector
[INFO] Starting class org.sonar.plugins.cobertura.CoberturaMavenCollector
[INFO] Starting class org.sonar.plugins.surefire.SurefireMavenCollector
[INFO] o.s.p.s.SurefireMavenCollector parsing /opt/data/apache-continuum_data/working-directory/81/target/surefire-reports
[INFO] ------------------------------------------------------------------------
[INFO] Building ExerciceQT2
[INFO] task-segment: [org.codehaus.sonar:sonar-core-maven-plugin:1.7:batch] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [sonar-core:batch]
[INFO] ------------------------------------------------------------------------
[INFO] Building ExerciceQT2
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory /opt/data/apache-continuum_data/working-directory/81/target
Downloading: http://55.2.158.95:8080/archiva/repository/internal//parasoft/com/jtest/8.2/jtest-8.2.pom
Downloading: http://55.2.158.95:8080/archiva/repository/public//parasoft/com/jtest/8.2/jtest-8.2.pom
Downloading: http://repo1.maven.org/maven2/parasoft/com/jtest/8.2/jtest-8.2.pom
[INFO] [antrun:run
{execution: default}
]
[INFO] Executing tasks
[mkdir] Created dir: /opt/data/apache-continuum_data/working-directory/81/target/site/jtest
[exec] jtestcli: Version 8.2.62 – Copyright (C) 2003-2008 Parasoft Corporation
[exec] jtestcli: Using default workspace "/opt/data/apache-tomcat/.jtest_linux/workspace"
[exec] > [0%] Running: Scope
[exec] > [4%] Computing scope
[exec] >> [4%] Initializing
[exec] >> [8%] Updating
[exec] >> [14%] Refreshing
[exec] >> [14%] Opening TestExerciceQT2.
[exec] >> [14%] Refreshing
[exec] >> [15%] TestExerciceQT2
[exec] >> [15%] Refreshing
[exec] >> [15%] Refreshing /TestExerciceQT2.
[exec] >> [20%] Refreshing
[exec] >> [20%] Building
[exec] >> [21%] TestExerciceQT2
[exec] >> [21%] Building
[exec] >> [21%] Invoking Java Builder on /TestExerciceQT2.
[exec] >> [21%] Preparing to build TestExerciceQT2
[exec] >> [21%] Cleaning output folder for TestExerciceQT2
[exec] >> [21%] Copying resources to the output folder
[exec] >> [21%] Analyzing sources
[exec] >> [22%] Compiling TestExerciceQT2/java/fr/ca/sa/com/../src/test4
[exec] >> [27%] Build done
[exec] >> [27%] Building
[exec] >> [27%] Finding files
[exec] >> [29%] TestExerciceQT2
[exec] >> [31%] Finding files
[exec] >> [33%] Applying filters
[exec] >> [33%] CompteBO.java
[exec] >> [33%] LigneDeCompteBO.java
[exec] >> [33%] AssociationLigneCompte.java
[exec] >> [33%] TypeCompte.java
[exec] >> [33%] TypeLigneCompte.java
[exec] >> [33%] PersonneBO.java
[exec] >> [36%] Applying filters
[exec] >> [36%] Computing lines to check
[exec] >> [46%] Reporting scope results
[exec] >> [46%] TestExerciceQT2
[exec] >> [49%] Reporting scope results
[exec] Total Files: 6
[exec] Files to Check: 6
[exec] Total Lines: 484
[exec] Lines to Check: 484
[exec] Excluded Files: 0
[exec] > [49%] Running: Execution
[exec] >> [61%] Precomputing selection
[exec] >> [62%] Finding types
[exec] >> [62%] Computing selection
[exec] >> [62%] Finding types
[exec] >> [62%] Computing tests
[exec] >> [63%] Adding extra files
[exec] >> [63%] Computing tested types
[exec] >> [63%] Finding types
[exec] >> [63%] Computing tested members
[exec] >> [63%] Computing unit tests
[exec] > [63%] Execution: launching tests
[exec] Executed Test Cases: 0
[exec] Runtime Exceptions: 0
[exec] Assertion Failures: 0
[exec] Contract Violations: 0
[exec] Profiling Problems: 0
[exec] Unverified Outcomes: 0
[exec] Coverage:
[exec] Line: –
[exec] > [100%] Done
[exec] > Deleting temporary project TestExerciceQT2...
[exec] ok
[exec] jtestcli: Version 8.2.62 – Copyright (C) 2003-2008 Parasoft Corporation
[exec] jtestcli: Using default workspace "/opt/data/apache-tomcat/.jtest_linux/workspace"
[exec] > [0%] Running: Scope
[exec] > [4%] Computing scope
[exec] >> [4%] Initializing
[exec] >> [8%] Updating
[exec] >> [14%] Refreshing
[exec] >> [14%] Opening TestExerciceQT2.
[exec] >> [14%] Refreshing
[exec] >> [15%] TestExerciceQT2
[exec] >> [15%] Refreshing
[exec] >> [15%] Refreshing /TestExerciceQT2.
[exec] >> [20%] Refreshing
[exec] >> [20%] Building
[exec] >> [21%] TestExerciceQT2
[exec] >> [21%] Building
[exec] >> [21%] Invoking Java Builder on /TestExerciceQT2.
[exec] >> [21%] Preparing to build TestExerciceQT2
[exec] >> [21%] Cleaning output folder for TestExerciceQT2
[exec] >> [21%] Copying resources to the output folder
[exec] >> [21%] Analyzing sources
[exec] >> [27%] Build done
[exec] >> [27%] Building
[exec] >> [27%] Finding files
[exec] >> [29%] TestExerciceQT2
[exec] >> [31%] Finding files
[exec] >> [33%] Applying filters
[exec] >> [36%] Computing lines to check
[exec] >> [46%] Reporting scope results
[exec] Total Files: 0
[exec] Files to Check: 0
[exec] Total Lines: –
[exec] Lines to Check: –
[exec] Excluded Files: 0
[exec] > [49%] Running: Execution
[exec] >> [61%] Precomputing selection
[exec] >> [62%] Finding types
[exec] >> [62%] Computing selection
[exec] >> [62%] Finding types
[exec] >> [62%] Computing tests
[exec] >> [63%] Adding extra files
[exec] >> [63%] Computing tested types
[exec] >> [63%] Finding types
[exec] >> [63%] Computing tested members
[exec] >> [63%] Computing unit tests
[exec] Executed Test Cases: 0
[exec] Runtime Exceptions: 0
[exec] Assertion Failures: 0
[exec] Contract Violations: 0
[exec] Profiling Problems: 0
[exec] Unverified Outcomes: 0
[exec] Coverage:
[exec] Line: –
[exec] > [100%] Done
[exec] > Deleting temporary project TestExerciceQT2...
[exec] ok
[INFO] Executed tasks
[INFO] [site:attach-descriptor]
[INFO] [install:install]
[INFO] Installing /opt/data/apache-continuum_data/working-directory/81/pom.xml to /opt/data/apache-tomcat/.m2/repository/ProjetFormationQT/Exercice/1.0.0-SNAPSHOT/Exercice-1.0.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7 minutes 57 seconds
[INFO] Finished at: Tue May 19 15:33:09 CEST 2009
[INFO] Final Memory: 17M/254M
[INFO] ------------------------------------------------------------------------
but in the Sonar interface the coverage code is empty (absolutely nothing) 
I don't know well Parasoft JTest tool, but is there a Maven plugin similar to Cobertura, Emma or Clover, and are you using it ?
When you launch the "mvn clean install" command, I guess your unit tests are correctly executed ?
Do you have any configuration related to unit tests in your pom.xml file and if it is the case, could you attache this configuration to this ticket ?
Thanks for your answer.