Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Export-Package: org.eclipse.core.tests.filesystem,
org.eclipse.core.tests.resources.util
Require-Bundle: org.eclipse.core.resources,
org.eclipse.core.tests.harness,
org.junit,
org.eclipse.core.filesystem,
org.eclipse.core.runtime,
org.eclipse.pde.junit.runtime;bundle-version="3.5.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import junit.framework.ComparisonFailure;
import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.internal.resources.WorkspacePreferences;
import org.eclipse.core.resources.IWorkspace;
Expand Down Expand Up @@ -260,8 +259,7 @@ public void testSetDescription() throws CoreException {
* Compares the values in a workspace description with the corresponding
* properties in a preferences object.
*/
private void assertMatchesPreferences(Preferences expectedPreferences, IWorkspaceDescription actualDescription)
throws ComparisonFailure {
private void assertMatchesPreferences(Preferences expectedPreferences, IWorkspaceDescription actualDescription) {
assertThat(actualDescription.isAutoBuilding()).as("check auto building")
.isEqualTo(expectedPreferences.getBoolean(ResourcesPlugin.PREF_AUTO_BUILDING));
assertThat(actualDescription.getBuildOrder() == null).as("check default build order")
Expand All @@ -287,8 +285,8 @@ private void assertMatchesPreferences(Preferences expectedPreferences, IWorkspac
/**
* Compares two workspace description objects..
*/
private void assertDescriptionEquals(IWorkspaceDescription expectedDescription, IWorkspaceDescription actualDescription)
throws ComparisonFailure {
private void assertDescriptionEquals(IWorkspaceDescription expectedDescription,
IWorkspaceDescription actualDescription) {
assertThat(actualDescription.isAutoBuilding()).as("check auto building")
.isEqualTo(expectedDescription.isAutoBuilding());
assertThat(actualDescription.getBuildOrder()).as("check default build order")
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.nio.file.Path;
import java.util.HashMap;
import java.util.Map;
import junit.framework.AssertionFailedError;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
Expand Down Expand Up @@ -97,7 +96,7 @@ public void testLinkedFile(@TempDir Path tempDirectory) throws Exception {
joinAutoRefreshJobs();
assertThat(provider.getMonitoredResources()).isEmpty();
// check provider for other errors
AssertionFailedError[] failures = provider.getFailures();
AssertionError[] failures = provider.getFailures();
assertThat(failures).isEmpty();
}

Expand All @@ -124,7 +123,7 @@ public void testProjectCloseOpen() throws Exception {
joinAutoRefreshJobs();
assertThat(provider.getMonitoredResources()).isEmpty();
// check provider for other errors
AssertionFailedError[] failures = provider.getFailures();
AssertionError[] failures = provider.getFailures();
assertThat(failures).isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@
*******************************************************************************/
package org.eclipse.core.tests.resources.refresh;

import java.util.*;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import junit.framework.AssertionFailedError;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.refresh.*;
import org.eclipse.core.resources.refresh.IRefreshMonitor;
import org.eclipse.core.resources.refresh.IRefreshResult;
import org.eclipse.core.resources.refresh.RefreshProvider;

public class TestRefreshProvider extends RefreshProvider implements IRefreshMonitor {
private final List<AssertionFailedError> failures = new CopyOnWriteArrayList<>();
private final List<AssertionError> failures = new CopyOnWriteArrayList<>();
private final Set<Object> monitoredResources = Collections.synchronizedSet(new HashSet<>());
private static volatile TestRefreshProvider instance;

Expand All @@ -46,8 +50,8 @@ public static void reset() {
/**
* Returns the failures, or an empty array if there were no failures.
*/
public AssertionFailedError[] getFailures() {
return failures.toArray(new AssertionFailedError[failures.size()]);
public AssertionError[] getFailures() {
return failures.toArray(new AssertionError[failures.size()]);
}

/**
Expand All @@ -60,7 +64,7 @@ public IResource[] getMonitoredResources() {
@Override
public IRefreshMonitor installMonitor(IResource resource, IRefreshResult result) {
if (!monitoredResources.add(resource)) {
failures.add(new AssertionFailedError("installMonitor on resource that is already monitored: " + resource));
failures.add(new AssertionError("installMonitor on resource that is already monitored: " + resource));
}
return this;
}
Expand All @@ -72,7 +76,7 @@ public void unmonitor(IResource resource) {
return;
}
if (!monitoredResources.remove(resource)) {
failures.add(new AssertionFailedError("Unmonitor on resource that is not monitored: " + resource));
failures.add(new AssertionError("Unmonitor on resource that is not monitored: " + resource));
}
}
}
Loading