Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.team.tests.core/META-INF/MANIFEST.MF2
-rw-r--r--tests/org.eclipse.team.tests.core/pom.xml2
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/regression/PessimisticRepositoryProvider.java19
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/META-INF/MANIFEST.MF2
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/pom.xml2
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java60
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/EclipseFolderTest.java20
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/EclipseSynchronizerTest.java38
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CreatePatchTest.java9
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/Bug152581Test.java6
10 files changed, 65 insertions, 95 deletions
diff --git a/tests/org.eclipse.team.tests.core/META-INF/MANIFEST.MF b/tests/org.eclipse.team.tests.core/META-INF/MANIFEST.MF
index e17d6c142..3b156d5e0 100644
--- a/tests/org.eclipse.team.tests.core/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.team.tests.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.tests.core; singleton:=true
-Bundle-Version: 3.8.200.qualifier
+Bundle-Version: 3.8.300.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.team.tests.core,
diff --git a/tests/org.eclipse.team.tests.core/pom.xml b/tests/org.eclipse.team.tests.core/pom.xml
index 07cf94dc2..fd875a66d 100644
--- a/tests/org.eclipse.team.tests.core/pom.xml
+++ b/tests/org.eclipse.team.tests.core/pom.xml
@@ -18,7 +18,7 @@
</parent>
<groupId>org.eclipse.team</groupId>
<artifactId>org.eclipse.team.tests.core</artifactId>
- <version>3.8.200-SNAPSHOT</version>
+ <version>3.8.300-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/regression/PessimisticRepositoryProvider.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/regression/PessimisticRepositoryProvider.java
index 8ec075dd3..cf1f8bf60 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/regression/PessimisticRepositoryProvider.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/regression/PessimisticRepositoryProvider.java
@@ -19,10 +19,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourceAttributes;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.*;
import org.eclipse.team.core.RepositoryProvider;
/**
@@ -63,14 +60,12 @@ public class PessimisticRepositoryProvider extends RepositoryProvider implements
if (markWritableOnEdit) {
try {
ResourcesPlugin.getWorkspace().run(
- new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) {
- for (int i = 0, length = files.length; i < length; i++) {
- try {
- setReadOnly(files[i], false);
- } catch (CoreException e) {
- e.printStackTrace();
- }
+ (IWorkspaceRunnable) monitor -> {
+ for (int i = 0, length = files.length; i < length; i++) {
+ try {
+ setReadOnly(files[i], false);
+ } catch (CoreException e) {
+ e.printStackTrace();
}
}
},
diff --git a/tests/org.eclipse.team.tests.cvs.core/META-INF/MANIFEST.MF b/tests/org.eclipse.team.tests.cvs.core/META-INF/MANIFEST.MF
index f3d5fe911..ea5538ad6 100644
--- a/tests/org.eclipse.team.tests.cvs.core/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.team.tests.cvs.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.tests.cvs.core; singleton:=true
-Bundle-Version: 3.4.300.qualifier
+Bundle-Version: 3.4.400.qualifier
Bundle-Activator: org.eclipse.team.tests.ccvs.core.TeamCVSTestPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/tests/org.eclipse.team.tests.cvs.core/pom.xml b/tests/org.eclipse.team.tests.cvs.core/pom.xml
index a1496b70e..2affa4f3b 100644
--- a/tests/org.eclipse.team.tests.cvs.core/pom.xml
+++ b/tests/org.eclipse.team.tests.cvs.core/pom.xml
@@ -18,7 +18,7 @@
</parent>
<groupId>org.eclipse.team</groupId>
<artifactId>org.eclipse.team.tests.cvs.core</artifactId>
- <version>3.4.300-SNAPSHOT</version>
+ <version>3.4.400-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
index 6fbcc5200..4e9a3bf89 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
@@ -97,7 +97,6 @@ import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourceAttributes;
@@ -872,14 +871,11 @@ public class EclipseTest extends ResourceTest {
protected void assertReadOnly(IResource[] resources, final boolean isReadOnly, final boolean recurse) throws CoreException {
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
- resource.accept(new IResourceVisitor() {
- @Override
- public boolean visit(IResource resource) throws CoreException {
- if (resource.getType() == IResource.FILE) {
- assertEquals(isReadOnly, resource.getResourceAttributes().isReadOnly());
- }
- return recurse;
+ resource.accept(resource1 -> {
+ if (resource1.getType() == IResource.FILE) {
+ assertEquals(isReadOnly, resource1.getResourceAttributes().isReadOnly());
}
+ return recurse;
});
}
}
@@ -1416,16 +1412,13 @@ public class EclipseTest extends ResourceTest {
private void ensureNotReadOnly(IResource resource) {
if (resource.exists()) {
try {
- resource.accept(new IResourceVisitor() {
- @Override
- public boolean visit(IResource resource) throws CoreException {
- ResourceAttributes attrs = resource.getResourceAttributes();
- if (resource.exists() && attrs.isReadOnly()) {
- attrs.setReadOnly(false);
- resource.setResourceAttributes(attrs);
- }
- return true;
+ resource.accept(resource1 -> {
+ ResourceAttributes attrs = resource1.getResourceAttributes();
+ if (resource1.exists() && attrs.isReadOnly()) {
+ attrs.setReadOnly(false);
+ resource1.setResourceAttributes(attrs);
}
+ return true;
});
} catch (CoreException e) {
fail("#ensureNotReadOnly " + resource.getFullPath(), e);
@@ -1440,28 +1433,25 @@ public class EclipseTest extends ResourceTest {
*/
public void ensureDoesNotExistInWorkspace(final IProject[] projects) {
final Map<IProject, CoreException> failures = new HashMap<IProject, CoreException>();
- IWorkspaceRunnable body = new IWorkspaceRunnable() {
- @Override
- public void run(IProgressMonitor monitor) {
- for (int i = 0; i < projects.length; i++) {
- try {
- if (projects[i].exists()) {
- try {
+ IWorkspaceRunnable body = monitor -> {
+ for (int i = 0; i < projects.length; i++) {
+ try {
+ if (projects[i].exists()) {
+ try {
+ projects[i].delete(true, null);
+ } catch (CoreException e1) {
+ // Ignore the exception and try again after making
+ // sure the project doesn't contain any read-only resources
+ ensureNotReadOnly(projects[i]);
+ if (projects[i].exists()) {
+ projects[i].refreshLocal(IResource.DEPTH_INFINITE, null);
projects[i].delete(true, null);
- } catch (CoreException e) {
- // Ignore the exception and try again after making
- // sure the project doesn't contain any read-only resources
- ensureNotReadOnly(projects[i]);
- if (projects[i].exists()) {
- projects[i].refreshLocal(IResource.DEPTH_INFINITE, null);
- projects[i].delete(true, null);
- }
}
}
- } catch (CoreException e) {
- write(new CVSStatus(IStatus.ERROR, "Could not delete project " + projects[i].getName(), e), 0);
- failures.put(projects[i], e);
}
+ } catch (CoreException e2) {
+ write(new CVSStatus(IStatus.ERROR, "Could not delete project " + projects[i].getName(), e2), 0);
+ failures.put(projects[i], e2);
}
}
};
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/EclipseFolderTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/EclipseFolderTest.java
index 24d3eeb33..a35827b6a 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/EclipseFolderTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/EclipseFolderTest.java
@@ -20,12 +20,10 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.ICVSRunnable;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.tests.ccvs.core.CVSTestSetup;
import org.eclipse.team.tests.ccvs.core.EclipseTest;
@@ -82,17 +80,15 @@ public class EclipseFolderTest extends EclipseTest {
assertChildrenHaveSync(projectB, true);
// test that unmanaging in a CVS runnable flushes too
- cvsProjectB.run(new ICVSRunnable() {
- public void run(IProgressMonitor monitor) throws CVSException {
- try {
- assertChildrenHaveSync(projectB, true);
- cvsProjectB.unmanage(null);
- assertChildrenHaveSync(projectB, false);
- } catch(CoreException e) {
- throw CVSException.wrapException(e);
- }
+ cvsProjectB.run(monitor -> {
+ try {
+ assertChildrenHaveSync(projectB, true);
+ cvsProjectB.unmanage(null);
+ assertChildrenHaveSync(projectB, false);
+ } catch (CoreException e) {
+ throw CVSException.wrapException(e);
}
- }, null);
+ }, null);
assertChildrenHaveSync(projectB, false);
}
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/EclipseSynchronizerTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/EclipseSynchronizerTest.java
index 22a17a1f3..ea95e3ec4 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/EclipseSynchronizerTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/EclipseSynchronizerTest.java
@@ -33,7 +33,6 @@ import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.Team;
@@ -42,7 +41,6 @@ import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.core.CVSTeamProvider;
-import org.eclipse.team.internal.ccvs.core.ICVSRunnable;
import org.eclipse.team.internal.ccvs.core.resources.EclipseSynchronizer;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.MutableResourceSyncInfo;
@@ -875,25 +873,23 @@ public class EclipseSynchronizerTest extends EclipseTest {
// Create a project with dummy sync info
final IProject project = createProject(new String[] {"folder1/file1", "folder1/file2"});
- sync.run(project, new ICVSRunnable() {
- public void run(IProgressMonitor monitor) throws CVSException {
- try {
- IFile file1 = project.getFile("folder1/file1");
- IFile file2 = project.getFile("folder1/file2");
- // Delete file 1
- file1.delete(false, false, null);
- assertHasSyncInfo(file1);
- assertHasSyncInfo(file2);
- sync.deleteResourceSync(file1);
- assertHasNoSyncInfo(file1);
- assertHasSyncInfo(file2);
- // Move file 2
- file2.move(new Path("file3"), false, false, null);
- assertHasNoSyncInfo(file1);
- assertHasSyncInfo(file2);
- } catch (CoreException e) {
- throw CVSException.wrapException(e);
- }
+ sync.run(project, monitor -> {
+ try {
+ IFile file1 = project.getFile("folder1/file1");
+ IFile file2 = project.getFile("folder1/file2");
+ // Delete file 1
+ file1.delete(false, false, null);
+ assertHasSyncInfo(file1);
+ assertHasSyncInfo(file2);
+ sync.deleteResourceSync(file1);
+ assertHasNoSyncInfo(file1);
+ assertHasSyncInfo(file2);
+ // Move file 2
+ file2.move(new Path("file3"), false, false, null);
+ assertHasNoSyncInfo(file1);
+ assertHasSyncInfo(file2);
+ } catch (CoreException e) {
+ throw CVSException.wrapException(e);
}
}, null);
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CreatePatchTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CreatePatchTest.java
index 8dc981dcf..0224464d3 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CreatePatchTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CreatePatchTest.java
@@ -31,7 +31,6 @@ import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
@@ -204,11 +203,9 @@ public class CreatePatchTest extends EclipseTest {
assertTrue(totalWaited < 2500);
}
try {
- ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- ret[0] = filterStream(file.getContents(), prefixesToIgnore);
- }
- }, file, IResource.NONE, null);
+ ResourcesPlugin.getWorkspace().run(
+ (IWorkspaceRunnable) monitor -> ret[0] = filterStream(file.getContents(), prefixesToIgnore), file,
+ IResource.NONE, null);
} catch (CoreException e) {
fail(e.getMessage());
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/Bug152581Test.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/Bug152581Test.java
index 2c509dfb9..90c89a3f5 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/Bug152581Test.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/benchmark/Bug152581Test.java
@@ -73,11 +73,7 @@ public class Bug152581Test extends BenchmarkTest {
}
public void ensureExistsInWorkspace(final IResource resource, final boolean local) {
- IWorkspaceRunnable body = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- create(resource, local);
- }
- };
+ IWorkspaceRunnable body = monitor -> create(resource, local);
try {
getWorkspace().run(body, null);
} catch (CoreException e) {

Back to the top