File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
org.eclipse.pde.junit.runtime.tests/src/org/eclipse/pde/junit/runtime/tests
org.eclipse.pde.ui.tests/META-INF Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 3535import org .eclipse .jdt .junit .model .ITestElement .Result ;
3636import org .eclipse .jdt .junit .model .ITestElementContainer ;
3737import org .eclipse .jdt .junit .model .ITestRunSession ;
38+ import org .eclipse .pde .ui .tests .runtime .TestUtils ;
3839import org .eclipse .pde .ui .tests .util .ProjectUtils ;
3940import org .eclipse .pde .ui .tests .util .TargetPlatformUtil ;
4041import org .junit .Assert ;
@@ -72,7 +73,10 @@ public static void setupProjects() throws Exception {
7273 for (URL resource : Collections .list (bundle .findEntries ("test-bundles" , "verification.tests.*" , false ))) {
7374 ProjectUtils .importTestProject (FileLocator .toFileURL (resource ));
7475 }
76+ TestUtils .waitForJobs (JUnitExecutionTest .class + ".setupProjects() before build" , 100 , 10_000 );
7577 workspaceRoot .getWorkspace ().build (IncrementalProjectBuilder .FULL_BUILD , null );
78+ TestExecutionUtil .waitForAutoBuild ();
79+ TestUtils .waitForJobs (JUnitExecutionTest .class + ".setupProjects() after build" , 100 , 10_000 );
7680 }
7781
7882 @ Parameters (name = "{0}" )
Original file line number Diff line number Diff line change 3131import org .eclipse .core .resources .IProject ;
3232import org .eclipse .core .resources .IResource ;
3333import org .eclipse .core .resources .IncrementalProjectBuilder ;
34+ import org .eclipse .core .resources .ResourcesPlugin ;
3435import org .eclipse .core .runtime .CoreException ;
3536import org .eclipse .core .runtime .IPath ;
3637import org .eclipse .core .runtime .NullProgressMonitor ;
38+ import org .eclipse .core .runtime .OperationCanceledException ;
3739import org .eclipse .core .runtime .Platform ;
40+ import org .eclipse .core .runtime .jobs .Job ;
3841import org .eclipse .debug .core .DebugException ;
3942import org .eclipse .debug .core .DebugPlugin ;
4043import org .eclipse .debug .core .ILaunch ;
5558
5659class TestExecutionUtil {
5760
61+ public static void waitForAutoBuild () {
62+ boolean wasInterrupted = false ;
63+ do {
64+ try {
65+ Job .getJobManager ().join (ResourcesPlugin .FAMILY_AUTO_BUILD , null );
66+ wasInterrupted = false ;
67+ } catch (OperationCanceledException e ) {
68+ e .printStackTrace ();
69+ } catch (InterruptedException e ) {
70+ wasInterrupted = true ;
71+ }
72+ } while (wasInterrupted );
73+ }
74+
5875 public static ITestRunSession runTest (IJavaElement element ) throws CoreException {
5976 IProject project = element .getResource ().getProject ();
6077 project .build (IncrementalProjectBuilder .FULL_BUILD , null );
Original file line number Diff line number Diff line change @@ -73,4 +73,5 @@ Bundle-RequiredExecutionEnvironment: JavaSE-21
7373Eclipse-BundleShape : dir
7474Automatic-Module-Name : org.eclipse.pde.ui.tests
7575Bundle-ActivationPolicy : lazy
76- Export-Package : org.eclipse.pde.ui.tests.util
76+ Export-Package : org.eclipse.pde.ui.tests.runtime,
77+ org.eclipse.pde.ui.tests.util
You can’t perform that action at this time.
0 commit comments