Skip to content

Commit

Permalink
Move getWorkspace() method from ResourceTest to utility class eclipse…
Browse files Browse the repository at this point in the history
…-platform#903

This changes moves the getWorkspace() utility method defined in
ResourceTest to the dedicated ResourceTestUtil test class. It prepares
for removing the JUnit 3 test inheritances hierarchy to migrate to JUnit
4.

Contributes to
eclipse-platform#903
  • Loading branch information
HeikoKlare committed Nov 30, 2023
1 parent b82241f commit 8fde68d
Show file tree
Hide file tree
Showing 151 changed files with 183 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import static org.eclipse.core.tests.resources.ResourceTestUtil.assertExistsInFileSystem;
import static org.eclipse.core.tests.resources.ResourceTestUtil.assertExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

/**
* This class needs to be used with SaveManager2Test. Basically this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import junit.framework.Test;
import junit.framework.TestSuite;
import static org.eclipse.core.tests.resources.ResourceTestUtil.assertExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.assertDoesNotExistInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.assertExistsInFileSystem;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import junit.framework.Test;
import junit.framework.TestSuite;

import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
import org.eclipse.core.tests.internal.builders.DeltaVerifierBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*******************************************************************************/
package org.eclipse.core.tests.resources.saveparticipant;

import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.tests.resources.WorkspaceSessionTest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package org.eclipse.core.tests.filesystem;

import static org.eclipse.core.tests.resources.ResourceTestUtil.createFile;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.junit.Assert.assertThrows;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static org.eclipse.core.tests.resources.ResourceTestUtil.createFile;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInFileSystem;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertThrows;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*******************************************************************************/
package org.eclipse.core.tests.internal.alias;

import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*******************************************************************************/
package org.eclipse.core.tests.internal.builders;

import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.junit.Assert.assertThrows;

import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package org.eclipse.core.tests.internal.builders;

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import java.util.Map;
import org.eclipse.core.resources.IBuildConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package org.eclipse.core.tests.internal.builders;

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import org.eclipse.core.internal.events.BuildContext;
import org.eclipse.core.internal.resources.BuildConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package org.eclipse.core.tests.internal.builders;

import static org.eclipse.core.tests.resources.ResourceTestUtil.create;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import java.io.ByteArrayInputStream;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package org.eclipse.core.tests.internal.builders;

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import org.eclipse.core.resources.ICommand;
import org.eclipse.core.resources.IFile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*******************************************************************************/
package org.eclipse.core.tests.internal.builders;

import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import org.eclipse.core.resources.ICommand;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package org.eclipse.core.tests.internal.builders;

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.removeFromWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.transferStreams;
import static org.junit.Assert.assertArrayEquals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
******************************************************************************/
package org.eclipse.core.tests.internal.builders;

import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import org.eclipse.core.resources.ICommand;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*******************************************************************************/
package org.eclipse.core.tests.internal.builders;

import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import org.eclipse.core.resources.ICommand;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package org.eclipse.core.tests.internal.builders;

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import java.lang.reflect.Array;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package org.eclipse.core.tests.internal.builders;

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.eclipse.core.tests.resources.TestUtil.waitForCondition;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*******************************************************************************/
package org.eclipse.core.tests.internal.builders;

import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import java.util.List;
import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.resources.ICommand;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import static org.eclipse.core.tests.resources.ResourceTestUtil.create;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.is;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package org.eclipse.core.tests.internal.events;

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import java.util.ArrayList;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.eclipse.core.tests.internal.localstore;

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import java.io.DataInputStream;
import java.io.DataOutputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package org.eclipse.core.tests.internal.localstore;

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInFileSystem;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.removeFromFileSystem;
import static org.junit.Assert.assertThrows;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInFileSystem;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.removeFromFileSystem;
import static org.eclipse.core.tests.resources.ResourceTestUtil.removeFromWorkspace;
import static org.hamcrest.MatcherAssert.assertThat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInFileSystem;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.removeFromFileSystem;
import static org.junit.Assert.assertThrows;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInFileSystem;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.removeFromFileSystem;
import static org.eclipse.core.tests.resources.ResourceTestUtil.removeFromWorkspace;
import static org.junit.Assert.assertThrows;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import static org.eclipse.core.tests.resources.ResourceTestUtil.createFile;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.junit.Assert.assertThrows;

import java.io.ByteArrayInputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*******************************************************************************/
package org.eclipse.core.tests.internal.localstore;

import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static org.eclipse.core.tests.resources.ResourceTestUtil.assertExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInFileSystem;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.junit.Assert.assertThrows;

import org.eclipse.core.internal.resources.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*******************************************************************************/
package org.eclipse.core.tests.internal.localstore;

import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import java.io.File;
import java.util.Date;
import org.eclipse.core.resources.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInFileSystem;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.removeFromFileSystem;
import static org.eclipse.core.tests.resources.ResourceTestUtil.removeFromWorkspace;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*******************************************************************************/
package org.eclipse.core.tests.internal.localstore;

import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.resources.IProject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package org.eclipse.core.tests.internal.localstore;

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import java.io.ByteArrayInputStream;
import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import static org.eclipse.core.tests.resources.ResourceTestUtil.assertExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import static org.eclipse.core.tests.resources.ResourceTestUtil.assertExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package org.eclipse.core.tests.internal.properties;

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.junit.Assert.assertNotEquals;

import java.nio.charset.StandardCharsets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.eclipse.core.tests.internal.resources;

import static org.eclipse.core.tests.resources.ResourceTestUtil.createFile;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.removeFromFileSystem;

import java.io.ByteArrayInputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package org.eclipse.core.tests.internal.resources;

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import org.eclipse.core.internal.resources.BuildConfiguration;
import org.eclipse.core.resources.IBuildConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package org.eclipse.core.tests.internal.resources;

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import java.util.ArrayList;
import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package org.eclipse.core.tests.internal.resources;

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.removeFromWorkspace;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package org.eclipse.core.tests.internal.resources;

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.junit.Assert.assertThrows;

import org.eclipse.core.internal.resources.BuildConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package org.eclipse.core.tests.internal.resources;

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.junit.Assert.assertThrows;

import java.util.concurrent.atomic.AtomicBoolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static org.eclipse.core.tests.resources.ResourceTestUtil.assertExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInFileSystem;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.removeFromWorkspace;
import static org.junit.Assert.assertThrows;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package org.eclipse.core.tests.resources;

import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import static org.eclipse.core.tests.resources.ResourceTestUtil.create;
import static org.eclipse.core.tests.resources.ResourceTestUtil.createFile;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.removeFromWorkspace;
import static org.junit.Assert.assertThrows;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import static org.eclipse.core.tests.resources.ResourceTestUtil.assertDoesNotExistInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.assertExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.removeFromWorkspace;
import static org.junit.Assert.assertThrows;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static org.eclipse.core.tests.resources.ResourceTestUtil.assertExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInFileSystem;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.removeFromFileSystem;
import static org.eclipse.core.tests.resources.ResourceTestUtil.removeFromWorkspace;
import static org.junit.Assert.assertThrows;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import static org.eclipse.core.tests.resources.ResourceTestUtil.assertDoesNotExistInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.assertExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.ensureExistsInWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.getWorkspace;
import static org.eclipse.core.tests.resources.ResourceTestUtil.removeFromFileSystem;
import static org.eclipse.core.tests.resources.ResourceTestUtil.removeFromWorkspace;
import static org.junit.Assert.assertThrows;
Expand Down
Loading

0 comments on commit 8fde68d

Please sign in to comment.