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 57277

Summary: Can't run non-junit tests in "Test Packages" folders
Product: projects Reporter: ats37 <ats37>
Component: Generic InfrastructureAssignee: Jesse Glick <jglick>
Status: RESOLVED DUPLICATE    
Severity: blocker    
Priority: P3    
Version: 4.x   
Hardware: PC   
OS: Windows 3.1/NT   
Issue Type: DEFECT Exception Reporter:

Description ats37 2005-03-31 17:37:46 UTC
In addition to my JUnit-based unit tests, I have some (hand-written) quick &
dirty performance tests.   These take the form of an executable java class (with
void main(String[] argc) method which just run the old & new versions of some of
my code classes, and time how long they each take to complete.  Since these are
test utility classes rather than the code I'm building, I put them under "Test
Packages" rather than "Source Packages" in my (General|Java Class Library)
project.  However, when I try to run them with Shift+F6, I just get a
junit.framework.AssertionFailedError telling me there's "No tests found".

I don't want it to try to run the class with JUnit - I named it *Timer rather
than *Test and it doesn't extend TestCase, in order to avoid this.  However,
Netbeans doesn't appear to take this into account when Executing the class.  If
I cut & paste the class into the equivalent package under "Source Packages",
Shift+F6 runs it as expected.  However, it then gets included in the built JAR
File.  I suppose I could just configure a specific Exclude entry in the project
properties to avoid this, but IMO the class doesn't really belong under Source,
as it's only for testing.
Comment 1 Jesse Glick 2005-04-01 15:28:38 UTC

*** This issue has been marked as a duplicate of 43391 ***