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 262190

Summary: Unable to start profiler on test class with main method
Product: projects Reporter: westrick85 <westrick85>
Component: Ant ProjectAssignee: Tomas Stupka <tstupka>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

Description westrick85 2016-05-23 18:45:27 UTC
I have a Java Class Library project. I created a test driver class with main method in the test packages. It isn't a JUnit test class. It's a simple main method that exercises some of the code.

Selecting the action "Profile Test File" on the test source file with a main method results in the following error message:

profile-test-with-main:C:\MyProject\nbproject\build-impl.xml:1237: Problem: failed to create task or type antcal
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
BUILD FAILED (total time: 0 seconds)

I think there is a typo in the profile-test-withmain target in nbproject/build-impl.xml. Replacing "antcal" with "antcall" fixes the error and allows me to profile the test file.
Comment 1 Tomas Stupka 2016-07-05 16:12:03 UTC
fixed in jet-main #d852ff89747f
Comment 2 Quality Engineering 2016-07-07 01:52:09 UTC
Integrated into 'main-silver', will be available in build *201607070002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/d852ff89747f
User: Tomas Stupka <tstupka@netbeans.org>
Log: Issue #262190 - Unable to start profiler on test class with main method