lm.removeLaunches(lm.getLaunches()); configuration.delete();
	private void runTest(String source, final String[] expectedSequence) throws Exception {		IPackageFragmentRoot root= JavaProjectHelper.addSourceContainer(fProject, "src");		IPackageFragment pack= root.createPackageFragment("pack", true, null);		ICompilationUnit aTestCase= pack.createCompilationUnit("ATestCase.java", source, true, null);				ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);				TestRunListener.startListening();				ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();		lm.removeLaunches(lm.getLaunches());		ILaunchesListener2 launchesListener= new ILaunchesListener2() {			public void launchesTerminated(ILaunch[] launches) {				for (int i= 0; i < launches.length; i++) {					if (isJUnitLaunch(launches[i]))						fLaunchHasTerminated= true;					logLaunch("terminated", launches[i]);				}			}			public void launchesRemoved(ILaunch[] launches) {				for (int i= 0; i < launches.length; i++) {					if (isJUnitLaunch(launches[i]))						fLaunchHasTerminated= true;					logLaunch("removed   ", launches[i]);				}			}			public void launchesAdded(ILaunch[] launches) {				for (int i= 0; i < launches.length; i++)					logLaunch("added     ", launches[i]);			}			public void launchesChanged(ILaunch[] launches) {				for (int i= 0; i < launches.length; i++)					logLaunch("changed   ", launches[i]);			}			private void logLaunch(String action, ILaunch launch) {				StringBuffer buf= new StringBuffer();				buf.append(System.currentTimeMillis()).append(" ");				buf.append("launch ").append(action).append(": ");				ILaunchConfiguration launchConfiguration= launch.getLaunchConfiguration();				if (launchConfiguration != null) {					buf.append(launchConfiguration.getName()).append(": ");				}				buf.append(launch);				if (isJUnitLaunch(launch)) {					buf.append(" [JUnit]");				}				System.out.println(buf);							}		};		lm.addLaunchListener(launchesListener);		try {			LaunchConfigurationManager manager= DebugUIPlugin.getDefault().getLaunchConfigurationManager();			List launchShortcuts= manager.getLaunchShortcuts();			LaunchShortcutExtension ext= null;			for (Iterator iter= launchShortcuts.iterator(); iter.hasNext();) {				ext= (LaunchShortcutExtension) iter.next();				if (ext.getLabel().equals("JUnit Test"))					break;			}			ext.launch(new StructuredSelection(aTestCase), ILaunchManager.RUN_MODE);			new DisplayHelper() {				protected boolean condition() {					return fLaunchHasTerminated;				}			}.waitForCondition(Display.getCurrent(), 30 * 1000, 1000);		} finally {			lm.removeLaunchListener(launchesListener);		}		if (! fLaunchHasTerminated)			fail("Launch has not terminated");				new DisplayHelper(){			protected boolean condition() {				return TestRunListener.getMessageCount() >= expectedSequence.length;			}		}.waitForCondition(Display.getCurrent(), 5*1000, 100);				List messages= TestRunListener.endListening();		StringBuffer actual= new StringBuffer();		for (Iterator iter= messages.iterator(); iter.hasNext();) {			actual.append(iter.next()).append('\n');		}		StringBuffer expected= new StringBuffer();		for (int i= 0; i < expectedSequence.length; i++) {			expected.append(expectedSequence[i]).append('\n');		}		assertEquals(expected.toString(), actual.toString());	}