cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

Bug 157978 - Profiling tests in maven projects results in no data
: Profiling tests in maven projects results in no data
Status: VERIFIED FIXED
: profiler
Base
: Dev
: All All
: P2 (vote)
: 6.7
Assigned To:
:
:
:
: VISUALVM
:
: 120674
  Show dependency treegraph
 
Reported: 2009-02-05 10:22 by
Modified: 2009-06-25 10:23 (History)
Issue Type: DEFECT
:


Attachments
Sample project (14.51 KB, application/x-compressed)
2009-02-05 10:22, J Bachorik
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2009-02-05 10:22:17
When trying to profile tests in a maven based projects the profiler starts
successfully but collects no data.

Steps to reproduce:
1. Open the attached project
2. Select com.mycompany.mavenproject3.App java file
3. Invoke Profile/Profile Other/Profile Test for "App'java" action
4. Choose CPU profiling, default settings and start the tests

The tests will finish in a short time, the profiler will get notified about the
application being closed but there would
be no data collected.
------- Comment #1 From 2009-02-05 10:22:49 -------
Created an attachment (id=76596) [details]
Sample project
------- Comment #2 From 2009-03-24 13:18:45 -------
Tests in maven are started by artificially generated jar, which contains just
manifest and no classfiles. The manifest has Class-Path and Main-Class
attributes, 
which defines what should be executed. Profiler ignores Class-Path attribute in
manifest and therefore is unable see the class executed by such jar.
------- Comment #3 From 2009-03-24 13:20:11 -------
Here is example of such manifest file:
$ cat META-INF/MANIFEST.MF 
Manifest-Version: 1.0
Class-Path: file:/Users/thurka/.m2/repository/org/apache/maven/surefir
 e/surefire-booter/2.4.3/surefire-booter-2.4.3.jar file:/Users/thurka/
 .m2/repository/org/apache/maven/surefire/surefire-api/2.4.3/surefire-
 api-2.4.3.jar file:/private/tmp/mavenproject1/target/test-classes/ fi
 le:/private/tmp/mavenproject1/target/classes/ file:/Users/thurka/.m2/
 repository/junit/junit/3.8.1/junit-3.8.1.jar
Main-Class: org.apache.maven.surefire.booter.SurefireBooter

$ 
------- Comment #4 From 2009-03-24 14:19:26 -------
fixed in profiler-main

changeset:   123084:b760e293b4c9
user:        Tomas Hurka <thurka@netbeans.org>
date:        Tue Mar 24 14:17:32 2009 +0100
summary:     bugfix #157978, use Class-Path attribute from manifest when
computing classpath of profiled application
------- Comment #5 From 2009-03-26 14:30:17 -------
Integrated into 'main-golden', will be available in build *200903260733* on
http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/b760e293b4c9
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #157978, use Class-Path attribute from manifest when computing
classpath of profiled application
------- Comment #6 From 2009-06-03 15:03:07 -------
marking verified