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 195253

Summary: Use SourceGroupModifier.createSourceGroupFuture
Product: java Reporter: Jesse Glick <jglick>
Component: JUnitAssignee: Theofanis Oikonomou <theofanis>
Status: RESOLVED INVALID    
Severity: normal CC: mkleint
Priority: P3    
Version: 7.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 102711    

Description Jesse Glick 2011-02-09 21:20:06 UTC
Currently the junit module uses SourceGroupModifier.createSourceGroup in several places to create a test source root. It should rather use createSourceGroupFuture to do so only if and when the user clicks OK or Finish. See bug #102711 comment #12 for discussion.
Comment 1 Theofanis Oikonomou 2012-11-20 11:57:33 UTC
The createSourceGroup method is used by TestSuiteWizardIterator.instantiate and DefaultPlugin.createTestActionCalled methods which are called when the user presses Finish/OK buttons so there is no problem with these usages.

Also, the createSourceGroup method is used by the Empty/Simple/TestSuite wizards panels while creating the panels to show. In these panels the test root folder is presented to the user. So, the dataobject needs to be created before that happens and not be delayed until the user presses the Finish button otherwise the JavaTemplates.createPackageChooser throws an exception.

imho there is nothing to change here.
Comment 2 Jesse Glick 2012-12-03 18:28:01 UTC
(In reply to comment #1)
> the createSourceGroup method is used by the Empty/Simple/TestSuite
> wizards panels while creating the panels to show. In these panels the test root
> folder is presented to the user. So, the dataobject needs to be created before
> that happens and not be delayed until the user presses the Finish button
> otherwise the JavaTemplates.createPackageChooser throws an exception.

Still a bug from the user perspective that changes are made on disk even if you Cancel out of the wizard. Not sure how to fix; can the package chooser be given a fake (MemoryFileSystem) root folder? Or can the wizard notice a cancel event and remove a newly created empty test folder?