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 44051

Summary: Not able to create Tests from template
Product: java Reporter: Milan Kubec <mkubec>
Component: JUnitAssignee: junit-issues@java <junit-issues>
Status: CLOSED FIXED    
Severity: blocker CC: jrechtacek
Priority: P2    
Version: 4.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 41448    

Description Milan Kubec 2004-05-31 15:40:33 UTC
[custom build 20040531, JDK 1.4.2]

Steps to reproduce:
1) Create dummy j2se project, no main class no
main project
2) invoke New | File, select JUnit/Empty Test,
enter Class name and enter non-existing package name
3) Click Finish

Test Class has with name SimpleJUnitTest is
created in default package and its package
declaration says:

package Template.Classes;

The same happens when instantiating TestSuite
template.
Comment 1 Petr Hrebejk 2004-06-11 10:21:56 UTC
Needs some investigation. Maybe junit should start using the project
specific wizard (As do beans and forms). It should not be problem as
the project system is already integrated with tests.
Comment 2 Jiri Rechtacek 2004-06-14 16:07:39 UTC
Milane, it seems as worksforme for now. Reopen if I'm wrong. Thanks
Comment 3 Jiri Rechtacek 2004-06-14 16:20:48 UTC
Sorry, I have to reopen. It's easy reproducible iff I use new/no
main/no main class project. The path to <default package> wrongly
persists regardless selected project.
Comment 4 Jiri Rechtacek 2004-06-15 10:36:22 UTC
It's JUnit specific problem => reassigned to junit/code.
Hint: use the public method Project UI
API/ProjectChooserFactory.createSimpleTargetChooser() and add the
JUnit specific options in the bottom panel, same way has been used in
Web's wizards. In any problem, ask Petr H. to help you. Thanks
Comment 5 Marian Petras 2004-06-15 16:09:02 UTC
Accepted.
Comment 6 Marian Petras 2004-06-15 19:05:13 UTC
fixed in the trunk (together with bugs #43621, #44202, #44318, #44320,
#44321)

changed files:

junit/src/org/netbeans/modules/junit/wizards/Bundle.properties   (1.3)
junit/src/org/netbeans/modules/junit/wizards/EmptyTestCaseWizardIterator.java
  (1.5)
junit/src/org/netbeans/modules/junit/wizards/EmptyTestStepLocation.java
  (1.4)
junit/src/org/netbeans/modules/junit/wizards/LocationPanel.java  
(deleted - last revision 1.3)
junit/src/org/netbeans/modules/junit/wizards/SimpleTestStepLocation.java
  (1.5)
junit/src/org/netbeans/modules/junit/wizards/StepProblemMessage.java 
 (1.1 - initial revision)
junit/src/org/netbeans/modules/junit/wizards/TestSuiteStepLocation.java
  (1.4)
junit/src/org/netbeans/modules/junit/wizards/TestSuiteWizardIterator.java
  (1.5)
junit/src/org/netbeans/modules/junit/wizards/Utils.java   (1.5)
Comment 7 dmladek 2004-06-16 11:11:54 UTC
IMHO it is fine in NetBeans IDE Dev (Build 200406151800)

If Milene are not satisfied, please reopen it.