Bug 20157 junit: exception on 'recreate suite' if file read-only [JUnit]
F3 (everything using the junit wizards) a. create a test class b. create a suite for this class c. add one more test class d. make the test suite class read-only (its compilation unit) e. select that file and choose 'recreate test suite...' f. check both boxes Java Model Exception: Java Model Status [AllTEsts.java is read-only.] at org.eclipse.jdt.internal.core.Openable.save(Openable.java:448) at org.eclipse.jdt.internal.junit.wizards.UpdateTestSuite.updateTestCasesInSuite (UpdateTestSuite.java:181) at org.eclipse.jdt.internal.junit.wizards.UpdateTestSuite.access$1 (UpdateTestSuite.java:149) at org.eclipse.jdt.internal.junit.wizards.UpdateTestSuite$1.run (UpdateTestSuite.java:195) at org.eclipse.jface.operation.ModalContext.runInCurrentThread (ModalContext.java:299) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:249) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run (ProgressMonitorDialog.java:335) at org.eclipse.jdt.internal.junit.wizards.UpdateTestSuite.run (UpdateTestSuite.java:113) at org.eclipse.ui.internal.PluginAction.runWithEvent (PluginAction.java:210) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Menu.setVisible(Menu.java:920) at org.eclipse.swt.widgets.Control.WM_CONTEXTMENU(Control.java:2818) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method) at org.eclipse.swt.widgets.Tree.callWindowProc(Tree.java(Compiled Code)) at org.eclipse.swt.widgets.Tree.callWindowProc(Tree.java(Compiled Code)) at org.eclipse.swt.widgets.Control.WM_RBUTTONUP(Control.java:3707) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java(Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1160) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:739) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:248) at org.eclipse.core.launcher.Main.run(Main.java:697) at org.eclipse.core.launcher.Main.main(Main.java:530)
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/wizards/NewTestSuiteCreationWizardPage.java
/**
	 * Returns true iff an existing suite() method has been replaced.
	 */
	public boolean hasUpdatedExistingClass() {
		return fUpdatedExistingClassButton;
	}
	
	private IStatus classesInSuiteChanged() {
		JUnitStatus status= new JUnitStatus();
		if (fClassesInSuiteTable.getCheckedElements().length <= 0)
			status.setWarning(WizardMessages.getString("NewTestSuiteWizPage.classes_in_suite.error.no_testclasses_selected")); 
		return status;
	}
	
	private void updateSelectedClassesLabel() {
		int noOfClassesChecked= fClassesInSuiteTable.getCheckedElements().length;
		String key= (noOfClassesChecked==1) ? "NewTestClassWizPage.treeCaption.classSelected" : "NewTestClassWizPage.treeCaption.classesSelected"; 
		fSelectedClassesLabel.setText(WizardMessages.getFormattedString(key, new Integer(noOfClassesChecked)));
	}
	protected void createSuiteNameControl(Composite composite, int nColumns) {
		fSuiteNameLabel= new Label(composite, SWT.LEFT | SWT.WRAP);
		fSuiteNameLabel.setFont(composite.getFont());
		fSuiteNameLabel.setText(WizardMessages.getString("NewTestSuiteWizPage.suiteName.text")); 
		GridData gd= new GridData();
		gd.horizontalSpan= 1;
		fSuiteNameLabel.setLayoutData(gd);
		fSuiteNameText= new Text(composite, SWT.SINGLE | SWT.BORDER);
		
		fSuiteNameText.setEnabled(true);
		fSuiteNameText.setFont(composite.getFont());