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 - Use SourceGroupModifier.createSourceGroupFuture
Summary: Use SourceGroupModifier.createSourceGroupFuture
Status: RESOLVED INVALID
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
Depends on:
Blocks: 102711
  Show dependency tree
 
Reported: 2011-02-09 21:20 UTC by Jesse Glick
Modified: 2012-12-03 18:28 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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?