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.
JavaProjectGenerator now lets you set a flag isTests on a compilation unit in case it contains unit tests. The freeform properties dialog (Sources panel) should let you configure both plain source roots and test roots, and set this flag correspondingly. Note that only a whole compilation unit can be marked for being a test, so you need to be using separate classpaths in order to mark just some roots as test roots.
"Note that only a whole compilation unit can be marked for being a test, so you need to be using separate classpaths in order to mark just some roots as test roots." - in order to implement this I has to set and disable "Separate Classpath for Each Source Package Folder" checkbox when both sources and test source are specified. Done in: src/org/netbeans/modules/java/freeform/ui/Bundle.properties; new revision: 1.3; previous revision: 1.2 src/org/netbeans/modules/java/freeform/ui/ClasspathPanel.java; new revision: 1.3; previous revision: 1.2 src/org/netbeans/modules/java/freeform/ui/OutputPanel.java; new revision: 1.3; previous revision: 1.2 src/org/netbeans/modules/java/freeform/ui/ProjectModel.java; new revision: 1.4; previous revision: 1.3 src/org/netbeans/modules/java/freeform/ui/SourceFoldersPanel.form; new revision: 1.3; previous revision: 1.2 src/org/netbeans/modules/java/freeform/ui/SourceFoldersPanel.java; new revision: 1.3; previous revision: 1.2 src/org/netbeans/modules/java/freeform/ui/SourceFoldersWizardPanel.java;
I think it is fine to force separate classpaths if you are using test roots - you are almost surely going to actually have different classpaths for them anyway. Another approach would be to keep that checkbox enabled but when off, put tests into their own compilation unit (together).
"Another approach would be to keep that checkbox enabled but when off, put tests into their own compilation unit (together)." - yes, I was thinking about that too. Possible, but more work, e.g. when opening project properties and there are two compilation units with the same classpath but one for sources and second for tests then init checkbox to OFF, etc. Can be done in future if needed.