Bug 195253 - Use SourceGroupModifier.createSourceGroupFuture
Use SourceGroupModifier.createSourceGroupFuture
Status: RESOLVED INVALID
Product: java
Classification: Unclassified
Component: JUnit
7.0
All All
: P3 (vote)
: TBD
Assigned To: Theofanis Oikonomou
junit-issues@java
junitlib
:
Depends on:
Blocks: 102711
  Show dependency treegraph
 
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
:


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?


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo