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
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2022 IBM Corporation and others.
* Copyright (c) 2000, 2026 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -175,7 +175,7 @@ public void setUp(@TempDir Path tempDirectory) throws Exception {
//project with no overlap
pNoOverlap = root.getProject("NoOverlap");
createInWorkspace(pNoOverlap);
createInWorkspace(buildResources(pNoOverlap, new String[] {"/1/", "/1/1", "/1/2", "/2/", "/2/1"}));
createInWorkspace(buildResources(pNoOverlap, "/1/", "/1/1", "/1/2", "/2/", "/2/1"));

//project with overlap
pOverlap = root.getProject("Overlap");
Expand All @@ -186,9 +186,9 @@ public void setUp(@TempDir Path tempDirectory) throws Exception {
lChildOverlap = fOverlap.getFile("lChildOverlap");
createInWorkspace(new IResource[] {fOverlap, f2, lOverlap, lChildOverlap});
//create some other random child elements
createInWorkspace(buildResources(pOverlap, new String[] {"/1/", "/1/1", "/1/2"}));
createInWorkspace(buildResources(f2, new String[] {"/1/", "/1/1", "/1/2"}));
createInWorkspace(buildResources(fOverlap, new String[] {"/1/", "/1/1", "/1/2"}));
createInWorkspace(buildResources(pOverlap, "/1/", "/1/1", "/1/2"));
createInWorkspace(buildResources(f2, "/1/", "/1/1", "/1/2"));
createInWorkspace(buildResources(fOverlap, "/1/", "/1/1", "/1/2"));

//create links
pLinked = root.getProject("LinkProject");
Expand All @@ -201,8 +201,8 @@ public void setUp(@TempDir Path tempDirectory) throws Exception {
fLinked.createLink(fOverlap.getLocation(), IResource.NONE, null);
lLinked.createLink(lOverlap.getLocation(), IResource.NONE, null);
createInWorkspace(lChildLinked);
createInWorkspace(buildResources(pLinked, new String[] {"/a/", "/a/a", "/a/b"}));
createInWorkspace(buildResources(fLinked, new String[] {"/a/", "/a/a", "/a/b"}));
createInWorkspace(buildResources(pLinked, "/a/", "/a/a", "/a/b"));
createInWorkspace(buildResources(fLinked, "/a/", "/a/a", "/a/b"));

linkOverlapLocation = wrapInCanonicalIPath(tempDirectory);
linkOverlapLocation.toFile().mkdirs();
Expand Down Expand Up @@ -803,10 +803,9 @@ public void testDeleteProjectContents() throws CoreException {
//delete the overlapping project - it should delete the children of the linked folder
//but leave the actual links intact in the resource tree
pOverlap.delete(IResource.ALWAYS_DELETE_PROJECT_CONTENT, createTestMonitor());
assertDoesNotExistInWorkspace(new IResource[] { pOverlap, fOverlap, lOverlap, lChildOverlap, lChildLinked });
assertDoesNotExistInFileSystem(
new IResource[] { pOverlap, fOverlap, lOverlap, lChildOverlap, lChildLinked, lLinked, fLinked });
assertExistsInWorkspace(new IResource[] { pLinked, fLinked, lLinked });
assertDoesNotExistInWorkspace(pOverlap, fOverlap, lOverlap, lChildOverlap, lChildLinked);
assertDoesNotExistInFileSystem(pOverlap, fOverlap, lOverlap, lChildOverlap, lChildLinked, lLinked, fLinked);
assertExistsInWorkspace(pLinked, fLinked, lLinked);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2010, 2015 Broadcom Corporation and others.
* Copyright (c) 2010, 2026 Broadcom Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -565,7 +565,7 @@ protected IStatus run(IProgressMonitor monitor) {
private void invokeTestBug343256(IProject project, ISchedulingRule[] getRules, ISchedulingRule[] buildRules, TestBarrier2 tb1, TestBarrier2 tb2, Job j) {
// Test 1 - build project sched rule
getRules[0] = getRules[1] = project;
buildRules[0] = buildRules[1] = new MultiRule(new ISchedulingRule[] {getRules[0]});
buildRules[0] = buildRules[1] = new MultiRule(getRules[0]);
tb1.setStatus(TestBarrier2.STATUS_START);
tb2.setStatus(TestBarrier2.STATUS_START);
j.schedule();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2015 IBM Corporation and others.
* Copyright (c) 2004, 2026 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -174,36 +174,25 @@ public void testVisitor() throws CoreException {
Set.of(IPath.ROOT, proj1.getFullPath(), proj2.getFullPath()));
verify(tree, IPath.ROOT, BucketTree.DEPTH_INFINITE, Set.of(IPath.ROOT, proj1.getFullPath(),
file1.getFullPath(), folder1.getFullPath(), file2.getFullPath(), proj2.getFullPath()));
verify(tree, proj1.getFullPath(), BucketTree.DEPTH_ZERO,
Arrays.asList(new IPath[] { proj1.getFullPath() }));
verify(tree, proj1.getFullPath(), BucketTree.DEPTH_ZERO, Arrays.asList(proj1.getFullPath()));
verify(tree, proj1.getFullPath(), BucketTree.DEPTH_ONE,
Arrays.asList(new IPath[] { proj1.getFullPath(), file1.getFullPath(), folder1.getFullPath() }));
verify(tree, proj1.getFullPath(), BucketTree.DEPTH_INFINITE, Arrays.asList(
new IPath[] { proj1.getFullPath(), file1.getFullPath(), folder1.getFullPath(), file2.getFullPath() }));
verify(tree, file1.getFullPath(), BucketTree.DEPTH_ZERO,
Arrays.asList(new IPath[] { file1.getFullPath() }));
verify(tree, file1.getFullPath(), BucketTree.DEPTH_ONE,
Arrays.asList(new IPath[] { file1.getFullPath() }));
verify(tree, file1.getFullPath(), BucketTree.DEPTH_INFINITE,
Arrays.asList(new IPath[] { file1.getFullPath() }));
verify(tree, folder1.getFullPath(), BucketTree.DEPTH_ZERO,
Arrays.asList(new IPath[] { folder1.getFullPath() }));
Arrays.asList(proj1.getFullPath(), file1.getFullPath(), folder1.getFullPath()));
verify(tree, proj1.getFullPath(), BucketTree.DEPTH_INFINITE,
Arrays.asList(proj1.getFullPath(), file1.getFullPath(), folder1.getFullPath(), file2.getFullPath()));
verify(tree, file1.getFullPath(), BucketTree.DEPTH_ZERO, Arrays.asList(file1.getFullPath()));
verify(tree, file1.getFullPath(), BucketTree.DEPTH_ONE, Arrays.asList(file1.getFullPath()));
verify(tree, file1.getFullPath(), BucketTree.DEPTH_INFINITE, Arrays.asList(file1.getFullPath()));
verify(tree, folder1.getFullPath(), BucketTree.DEPTH_ZERO, Arrays.asList(folder1.getFullPath()));
verify(tree, folder1.getFullPath(), BucketTree.DEPTH_ONE,
Arrays.asList(new IPath[] { folder1.getFullPath(), file2.getFullPath() }));
Arrays.asList(folder1.getFullPath(), file2.getFullPath()));
verify(tree, folder1.getFullPath(), BucketTree.DEPTH_INFINITE,
Arrays.asList(new IPath[] { folder1.getFullPath(), file2.getFullPath() }));
verify(tree, file2.getFullPath(), BucketTree.DEPTH_ZERO,
Arrays.asList(new IPath[] { file2.getFullPath() }));
verify(tree, file2.getFullPath(), BucketTree.DEPTH_ONE,
Arrays.asList(new IPath[] { file2.getFullPath() }));
verify(tree, file2.getFullPath(), BucketTree.DEPTH_INFINITE,
Arrays.asList(new IPath[] { file2.getFullPath() }));
verify(tree, proj2.getFullPath(), BucketTree.DEPTH_ZERO,
Arrays.asList(new IPath[] { proj2.getFullPath() }));
verify(tree, proj2.getFullPath(), BucketTree.DEPTH_ONE,
Arrays.asList(new IPath[] { proj2.getFullPath() }));
verify(tree, proj2.getFullPath(), BucketTree.DEPTH_INFINITE,
Arrays.asList(new IPath[] { proj2.getFullPath() }));
Arrays.asList(folder1.getFullPath(), file2.getFullPath()));
verify(tree, file2.getFullPath(), BucketTree.DEPTH_ZERO, Arrays.asList(file2.getFullPath()));
verify(tree, file2.getFullPath(), BucketTree.DEPTH_ONE, Arrays.asList(file2.getFullPath()));
verify(tree, file2.getFullPath(), BucketTree.DEPTH_INFINITE, Arrays.asList(file2.getFullPath()));
verify(tree, proj2.getFullPath(), BucketTree.DEPTH_ZERO, Arrays.asList(proj2.getFullPath()));
verify(tree, proj2.getFullPath(), BucketTree.DEPTH_ONE, Arrays.asList(proj2.getFullPath()));
verify(tree, proj2.getFullPath(), BucketTree.DEPTH_INFINITE, Arrays.asList(proj2.getFullPath()));
}

public void verify(BucketTree tree, IPath root, int depth, final Collection<IPath> expected)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2022 IBM Corporation and others.
* Copyright (c) 2000, 2026 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -190,8 +190,8 @@ public void testFileFor() {
@Deprecated // Explicitly tests deprecated API
public void testIsLocal() throws CoreException {
// create resources
IResource[] resources = buildResources(project, new String[] { "/Folder1/", "/Folder1/File1",
"/Folder1/Folder2/", "/Folder1/Folder2/File2", "/Folder1/Folder2/Folder3/" });
IResource[] resources = buildResources(project, "/Folder1/", "/Folder1/File1", "/Folder1/Folder2/",
"/Folder1/Folder2/File2", "/Folder1/Folder2/Folder3/");
createInWorkspace(resources);
for (IResource resource : resources) {
removeFromFileSystem(resource);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 IBM Corporation and others.
* Copyright (c) 2000, 2026 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -65,8 +65,7 @@ public void testProjectDeletion() throws CoreException {
TestingSupport.waitForSnapshot();

// create resources
IResource[] resources = buildResources(project,
new String[] { "/File1", "/Folder1/", "/Folder1/File1", "/Folder1/Folder2/" });
IResource[] resources = buildResources(project, "/File1", "/Folder1/", "/Folder1/File1", "/Folder1/Folder2/");
createInWorkspace(resources);

// delete project's default directory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2017 IBM Corporation and others.
* Copyright (c) 2000, 2026 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -284,9 +284,9 @@ public void testMoveHierarchy() throws Exception {
createInWorkspace(folderSource);

// create hierarchy
String[] hierarchy = new String[] { "/", "/file1", "/file2", "/folder1/", "/folder1/file3",
"/folder1/file4", "/folder2/", "/folder2/file5", "/folder2/file6", "/folder1/folder3/",
"/folder1/folder3/file7", "/folder1/folder3/file8" };
String[] hierarchy = { "/", "/file1", "/file2", "/folder1/", "/folder1/file3", "/folder1/file4", "/folder2/",
"/folder2/file5", "/folder2/file6", "/folder1/folder3/", "/folder1/folder3/file7",
"/folder1/folder3/file8" };
IResource[] resources = buildResources(folderSource, hierarchy);
createInWorkspace(resources);

Expand Down Expand Up @@ -359,8 +359,8 @@ public void testMoveHierarchyBetweenProjects() throws Exception {
createInWorkspace(folderSource);

// build hierarchy
String[] hierarchy = new String[] { "/", "/file1", "/file2", "/folder1/", "/folder1/file3", "/folder1/file4",
"/folder2/", "/folder2/file5", "/folder2/file6", "/folder1/folder3/", "/folder1/folder3/file7",
String[] hierarchy = { "/", "/file1", "/file2", "/folder1/", "/folder1/file3", "/folder1/file4", "/folder2/",
"/folder2/file5", "/folder2/file6", "/folder1/folder3/", "/folder1/folder3/file7",
"/folder1/folder3/file8" };
IResource[] resources = buildResources(folderSource, hierarchy);
createInWorkspace(resources);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2015 IBM Corporation and others.
* Copyright (c) 2006, 2026 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -108,7 +108,7 @@ private String getModelMessage(IStatus status) {
public void setUp() throws Exception {
TestModelProvider.enabled = true;
project = getWorkspace().getRoot().getProject("Project");
IResource[] before = buildResources(project, new String[] {"c/", "c/b/", "c/a/", "c/x", "c/b/y", "c/b/z"});
IResource[] before = buildResources(project, "c/", "c/b/", "c/a/", "c/x", "c/b/y", "c/b/z");
createInWorkspace(before);
assertExistsInWorkspace(before);
factory = createEmptyChangeDescription();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2021 IBM Corporation and others.
* Copyright (c) 2021, 2026 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -44,7 +44,7 @@ public class TestProjectDeletion {
@BeforeEach
public void setUp() throws Exception {
project = getWorkspace().getRoot().getProject("Project");
IResource[] resources = buildResources(project, new String[] { "a/", "a/b/", "a/c/", "a/d", "a/b/e", "a/b/f" });
IResource[] resources = buildResources(project, "a/", "a/b/", "a/c/", "a/d", "a/b/e", "a/b/f");
createInWorkspace(resources);
assertExistsInWorkspace(resources);
factory = ResourceChangeValidator.getValidator().createDeltaFactory();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2022 IBM Corporation and others.
* Copyright (c) 2000, 2026 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -304,8 +304,8 @@ public void testCopy() throws CoreException {
createInWorkspace(destProject);
setHidden(folder, true, IResource.DEPTH_ZERO);
folder.copy(destFolder.getFullPath(), flags, createTestMonitor());
assertExistsInWorkspace(new IResource[] { folder, subFile });
assertExistsInWorkspace(new IResource[] { destFolder, destSubFile });
assertExistsInWorkspace(folder, subFile);
assertExistsInWorkspace(destFolder, destSubFile);

// set all the resources to be hidden
// copy the project
Expand All @@ -322,8 +322,8 @@ public void testCopy() throws CoreException {
createInWorkspace(destProject);
setHidden(project, true, IResource.DEPTH_INFINITE);
folder.copy(destFolder.getFullPath(), flags, createTestMonitor());
assertExistsInWorkspace(new IResource[] { folder, subFile });
assertExistsInWorkspace(new IResource[] { destFolder, destSubFile });
assertExistsInWorkspace(folder, subFile);
assertExistsInWorkspace(destFolder, destSubFile);
}

@Test
Expand Down Expand Up @@ -358,8 +358,8 @@ public void testMove() throws CoreException {
createInWorkspace(destProject);
setHidden(folder, true, IResource.DEPTH_ZERO);
folder.move(destFolder.getFullPath(), flags, createTestMonitor());
assertDoesNotExistInWorkspace(new IResource[] { folder, subFile });
assertExistsInWorkspace(new IResource[] { destFolder, destSubFile });
assertDoesNotExistInWorkspace(folder, subFile);
assertExistsInWorkspace(destFolder, destSubFile);

// set all the resources to be hidden
// move the project
Expand All @@ -376,8 +376,8 @@ public void testMove() throws CoreException {
createInWorkspace(destProject);
setHidden(project, true, IResource.DEPTH_INFINITE);
folder.move(destFolder.getFullPath(), flags, createTestMonitor());
assertDoesNotExistInWorkspace(new IResource[] { folder, subFile });
assertExistsInWorkspace(new IResource[] { destFolder, destSubFile });
assertDoesNotExistInWorkspace(folder, subFile);
assertExistsInWorkspace(destFolder, destSubFile);
}

@Test
Expand All @@ -399,12 +399,12 @@ public void testDelete() throws CoreException {
createInWorkspace(resources);
file.delete(flags, createTestMonitor());
assertDoesNotExistInWorkspace(file);
assertExistsInWorkspace(new IResource[] { project, folder, subFile });
assertExistsInWorkspace(project, folder, subFile);
// delete a folder
createInWorkspace(resources);
folder.delete(flags, createTestMonitor());
assertDoesNotExistInWorkspace(new IResource[] { folder, subFile });
assertExistsInWorkspace(new IResource[] { project, file });
assertDoesNotExistInWorkspace(folder, subFile);
assertExistsInWorkspace(project, file);

// set one child to be hidden
createInWorkspace(resources);
Expand All @@ -416,8 +416,8 @@ public void testDelete() throws CoreException {
createInWorkspace(resources);
setHidden(folder, true, IResource.DEPTH_ZERO);
folder.delete(flags, createTestMonitor());
assertDoesNotExistInWorkspace(new IResource[] { folder, subFile });
assertExistsInWorkspace(new IResource[] { project, file });
assertDoesNotExistInWorkspace(folder, subFile);
assertExistsInWorkspace(project, file);

// set all resources to be hidden
createInWorkspace(resources);
Expand All @@ -430,13 +430,13 @@ public void testDelete() throws CoreException {
setHidden(project, true, IResource.DEPTH_INFINITE);
file.delete(flags, createTestMonitor());
assertDoesNotExistInWorkspace(file);
assertExistsInWorkspace(new IResource[] { project, folder, subFile });
assertExistsInWorkspace(project, folder, subFile);
// delete a folder
createInWorkspace(resources);
setHidden(project, true, IResource.DEPTH_INFINITE);
folder.delete(flags, createTestMonitor());
assertDoesNotExistInWorkspace(new IResource[] { folder, subFile });
assertExistsInWorkspace(new IResource[] { project, file });
assertDoesNotExistInWorkspace(folder, subFile);
assertExistsInWorkspace(project, file);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 IBM Corporation and others.
* Copyright (c) 2000, 2026 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -220,7 +220,7 @@ public void testFolderCreation() throws Exception {
@Test
public void testFolderDeletion() throws Throwable {
IProject project = getWorkspace().getRoot().getProject("Project");
IResource[] before = buildResources(project, new String[] {"c/", "c/b/", "c/x", "c/b/y", "c/b/z"});
IResource[] before = buildResources(project, "c/", "c/b/", "c/x", "c/b/y", "c/b/z");
createInWorkspace(before);
//
assertExistsInWorkspace(before);
Expand All @@ -231,8 +231,8 @@ public void testFolderDeletion() throws Throwable {
@Test
public void testFolderMove() throws Throwable {
IProject project = getWorkspace().getRoot().getProject("Project");
IResource[] before = buildResources(project, new String[] {"b/", "b/b/", "b/x", "b/b/y", "b/b/z"});
IResource[] after = buildResources(project, new String[] {"a/", "a/b/", "a/x", "a/b/y", "a/b/z"});
IResource[] before = buildResources(project, "b/", "b/b/", "b/x", "b/b/y", "b/b/z");
IResource[] after = buildResources(project, "a/", "a/b/", "a/x", "a/b/y", "a/b/z");

// create the resources and set some content in a file that will be moved.
createInWorkspace(before);
Expand Down
Loading
Loading