This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 157978 - Profiling tests in maven projects results in no data
Summary: Profiling tests in maven projects results in no data
Status: VERIFIED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Tomas Hurka
URL:
Keywords: VISUALVM
Depends on:
Blocks: 120674
  Show dependency tree
 
Reported: 2009-02-05 10:22 UTC by J Bachorik
Modified: 2009-06-25 10:23 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


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

Note You need to log in before you can comment on or make changes to this bug.
Description J Bachorik 2009-02-05 10:22:17 UTC
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 J Bachorik 2009-02-05 10:22:49 UTC
Created attachment 76596 [details]
Sample project
Comment 2 Tomas Hurka 2009-03-24 13:18:45 UTC
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 Tomas Hurka 2009-03-24 13:20:11 UTC
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 Tomas Hurka 2009-03-24 14:19:26 UTC
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 Quality Engineering 2009-03-26 14:30:17 UTC
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 matusdekanek 2009-06-03 15:03:07 UTC
marking verified