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.
Summary: | No tests root folder was found | ||
---|---|---|---|
Product: | java | Reporter: | rkm1 <rkm1> |
Component: | JUnit | Assignee: | Theofanis Oikonomou <theofanis> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | gglazer, josediazaz, kganfield, mmirilovic |
Priority: | P3 | ||
Version: | 4.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
rkm1
2005-11-27 10:48:58 UTC
Accepted. *** Issue 100221 has been marked as a duplicate of this issue. *** In addition, if the existing project is freeform, only the barest skeleton of a JUnit class is pregenerated. By way of example for a JUnit test of a class called Foo: /* * FooTest.java * * Created on Nov 26, 2007, 10:39:13 AM * * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.sun.Turing; import org.junit.Test; import static org.junit.Assert.*; /** * * @author gglazer */ public class FooTest extends TestCase { public FooTest () { } } On top of this, the two inserted import statements throw "package org.junit does not exist" errors and there does not appear to be any way to fix this other than starting the project over from scratch. The fix should be easy. Ken, could you please look on it. Correct sentence and then I can fix it ;-). This is a fairly old issue and was partially fixed in 6.1. In 6.1 additional information was added to the help topic for the wizard that described how to specify a test package folder for the project. Also, information was added to the warning that appears if the user tries to create a test by right-clicking a class and choosing Tools > Create JUnit Test. The text in the warning dialog also describes how to specify a test package folder. Unable to located test package I think that you can take the text in the warning dialog and display it in the wizard panes for step 2 of each of the JUnit wizards [JUnit Test, Test for Existing Class, JUnit Suite]. Between the text in the wizard and the help topic for the wizard the user should understand how to resolve the problem. I will add this issue to the late UI change and approved the change. This will resolve the first part of the issue. The second part of the issue about junit libraries in freeform projects would require another solution and probably should be filed as a separate issue. I think that in a freeform project the user is supposed to locate the test libraries when they create the freeform project, but i am not sure exactly how the user would add the library location after creating the project. Probably modifying the Ant script. Actually, I had to create $(PROJECT)/test/unit/src for this message to disappear (in 6.5.1). So, if you follow the directions in 6.5.1 to create $(PROJECT)/test, the problem does not go way. I'd suggest the warning tells people to create test/unit/src unless the fix in 6.8 includes just looking for test and not test/unit/src. See also #50012 I cannot reproduce in NetBeans IDE Dev (Build 20121024-d3ca6f6fc27b). If I try to create some test for the first time (without any test folder in the project) it gets created for me and just gives some info in the output like the following INFO: No FileObject found for the following URL: file:/tmp/JavaApplication1/test/ java.lang.IllegalStateException: No FileObject found for the following URL: file:/tmp/JavaApplication1/test/ at org.netbeans.modules.java.testrunner.CommonTestUtil.getTestTargets(CommonTestUtil.java:174) probably this was fixed in 8904f692d00e. Please reopen otherwise. Thank you |