Skip to content

Commit 76ee2ef

Browse files
committed
Replace calls to ResourceTest.cleanup()
Some test classes manually call the cleanup() method of ResourceTest just to remove the projects in the workspace. Since this method contains more functionality than that and should be private to the ResourceTest teardown functionality, this change replaces the calls to the method with ordinary cleanups of the workspace.
1 parent 9b9ddbf commit 76ee2ef

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/builders/ParallelBuildChainTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ protected void setUp() throws Exception {
105105
@Override
106106
protected void tearDown() throws Exception {
107107
// Cleanup workspace first to ensure that auto-build is not started on projects
108-
cleanup();
108+
waitForBuild();
109+
getWorkspace().getRoot().delete(true, true, getMonitor());
109110
super.tearDown();
110111
TimerBuilder.abortCurrentBuilds();
111112
}
@@ -143,7 +144,7 @@ public void testIndividualProjectBuilds_ProjectRelaxedRule() throws Exception {
143144

144145
@Test
145146
public void testIndividualProjectBuilds_WithManyProjects_ProjectRelaxedRule() throws Exception {
146-
int numberOfParallelBuilds = 60;
147+
int numberOfParallelBuilds = 30;
147148
var longRunningProjects = createMultipleTestProjects(numberOfParallelBuilds, BuildDurationType.LONG_RUNNING,
148149
RuleType.CURRENT_PROJECT_RELAXED);
149150
executeIndividualFullProjectBuilds(numberOfParallelBuilds, () -> {

resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IResourceTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,8 @@ protected void reinitializeProjectsAfterTestIteration() {
471471
public void cleanUp(Object[] args, int countArg) throws Exception {
472472
// Reinitialize projects if necessary
473473
if (reinitializeOnCleanup) {
474-
IResourceTest.this.cleanup();
474+
waitForBuild();
475+
getWorkspace().getRoot().delete(true, true, getMonitor());
475476
IResourceTest.this.initializeProjects();
476477
reinitializeOnCleanup = false;
477478
}

resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ public IResource[] buildResources(IContainer root, String[] hierarchy) {
428428
return result;
429429
}
430430

431-
protected void cleanup() throws CoreException {
431+
private void cleanup() throws CoreException {
432432
// Wait for any build job that may still be executed
433433
waitForBuild();
434434
final IFileStore[] toDelete = storesToDelete.toArray(new IFileStore[0]);

0 commit comments

Comments
 (0)