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 97053

Summary: Test folder is not compiled before "Run Single"
Product: java Reporter: Martin Krauskopf <mkrauskopf>
Component: ProjectAssignee: Jesse Glick <jglick>
Status: RESOLVED FIXED    
Severity: blocker CC: tzezula
Priority: P2 Keywords: REGRESSION
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 116230    
Bug Blocks: 49026    

Description Martin Krauskopf 2007-03-02 10:05:20 UTC
1) when you do Shift-F11 (clean and build all), everything is cleaned up and
   source folders are rebuilt (no test source folders - that's ok so far)
2) Do 'F9' or 'Shift-F6' on some test which depends on some class in the same
test folder.

It fails. Because the other class is not recompiled for some reason. So you have
to use inconvenient workaround like:

1) Shift-F11
2) ant compile-test
3) Shift-F6

That used to work before. (CCing Jesse, he did some huge commit to projects...)
Comment 1 Jesse Glick 2007-03-02 12:40:09 UTC
Probably something to do with sourcepath="". I will try to fix and add to
BuildImplTest.
Comment 2 pzajac 2007-03-20 14:09:58 UTC
I am voting for this issue. It's too difficult to run only one test now.
Comment 3 Martin Krauskopf 2007-03-20 14:13:26 UTC
Yes, quite inconvenient. I've created shortcut int the build menu for building
tests for my particular j2se-project. But still forgetting to run it.
Comment 4 Jesse Glick 2007-03-21 01:42:30 UTC
I know about it, just haven't had time to do more than glance at my bugs this
week...
Comment 5 Jesse Glick 2007-03-22 21:20:52 UTC
A little tricky. When using sourcepath="", as required to support excludes
correctly, <javac> will not pick up other classes on the classpath - this is the
point of using the switch. (A more sophisticated compile task using JSR 199
could compile selected files plus their dependencies with filters in effect, but
this is not possible using the javac command line.)

Since as reported this is awkward for test-single, I changed this target to
depend on compile-test rather than compile-test-single. (run-single can still
depend on compile-single because you can easily use F11 to build all non-test
classes.)

Drawbacks of compiling all (as yet uncompiled) tests and test utilities when
running just one test? (1) Speed - hopefully not bad, especially since repeated
runs will not need to recompile unrelated classes. (2) Broken sources you don't
want to run - but this is exactly what issue #49026 is for (just exclude
anything which is broken). So I hope this fix will be satisfactory.


Checking in test/unit/src/org/netbeans/modules/java/j2seproject/BuildImplTest.java;
/shared/data/ccvs/repository/java/j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/BuildImplTest.java,v
 <--  BuildImplTest.java
new revision: 1.9; previous revision: 1.8
done
Checking in src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java;
/shared/data/ccvs/repository/java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java,v
 <--  J2SEActionProvider.java
new revision: 1.58; previous revision: 1.57
done
Checking in src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl;
/shared/data/ccvs/repository/java/j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl,v
 <--  build-impl.xsl
new revision: 1.86; previous revision: 1.85
done