Bug 80778 JUnit view toolbar run button enabled when no test can be run [JUnit]
Version 3.1M3. JUnit view toolbar run button enabled when no test can be run/ -Run a JUnit test from the JUnit View. -Shutdown Eclipse. -Start Eclipse. -The JUnit view toolbar run button is enabled, clicking it does nothing. The button should be disabled when no test can be run. Additionally, the JUnit view could remember the last test run accross shutown/restarts. Gary
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
}
		if (fLastLaunch != null && fLastLaunch.getLaunchConfiguration() != null) {
				ILaunchConfiguration launchConfiguration= fLastLaunch.getLaunchConfiguration();
				if (launchConfiguration != null) {
					try {
						String name= JUnitMessages.TestRunnerViewPart_rerunLaunchConfigName; 
						String configName= Messages.format(JUnitMessages.TestRunnerViewPart_configName, name); 
						ILaunchConfigurationWorkingCopy tmp= launchConfiguration.copy(configName); 
						tmp.setAttribute(JUnitBaseLaunchConfiguration.FAILURES_FILENAME_ATTR, createFailureNamesFile());
						tmp.launch(fLastLaunch.getLaunchMode(), null);	
						return;	
					} catch (CoreException e) {
						ErrorDialog.openError(getSite().getShell(), 
							JUnitMessages.TestRunnerViewPart_error_cannotrerun, e.getMessage(), e.getStatus() 
						);
					}
				}
				MessageDialog.openInformation(getSite().getShell(), 
					JUnitMessages.TestRunnerViewPart_cannotrerun_title,  
					JUnitMessages.TestRunnerViewPart_cannotrerurn_message
				); 
		}
	}	
	private String createFailureNamesFile() throws CoreException {
		try {
			File file= File.createTempFile("testFailures", ".txt"); 
			file.deleteOnExit();
			BufferedWriter bw= null;
			try {
				bw= new BufferedWriter(new FileWriter(file));