Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2011 Gunnar Wagenknecht and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at Contributors: Gunnar Wagenknecht - initial API and implementation
package org.eclipse.pde.internal.junit.runtime;
import  org.eclipse.ui.testing.ITestHarness;
import  org.eclipse.ui.testing.TestableObject;

The ITestHarness implementation used to execute Platform UI tests.
public class PlatformUITestHarness implements ITestHarness {
	private TestableObject fTestableObject;
	private final boolean fRunTestsInSeparateThread;

Creates a new instance.

testableObject the testable object
	public PlatformUITestHarness(Object testableObjectboolean runTestsInSeparateThread) {
		this. = runTestsInSeparateThread;
		 = (TestableObject) testableObject;
	/* (non-Javadoc)
	 * @see org.eclipse.ui.testing.ITestHarness#runTests()
	public void runTests() {
		try {
			// signal starting
			// the test runner runnable
			Runnable testsRunner = new Runnable() {
				public void run() {
				// wrap into separate thread and run from there
				final Thread testRunnerThread = new Thread(testsRunner"Plug-in Tests Runner"); //$NON-NLS-1$
				.runTest(new Runnable() {
					public void run() {
				// wait for tests to finish
				// note, this has do be done outside #runTest method to not lock the UI
				try {
catch (InterruptedException e) {
else {
				// run directly
finally {
			// signal shutdown
New to GrepCode? Check out our FAQ X