Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-10-15 16:01:04 +0000
committerMichael Valenta2003-10-15 16:01:04 +0000
commitae15fdf2a64173f4ed82d9ce8812eb7cb270e43e (patch)
tree6412c8755bc0f2b0edccfb798af788a4d338c2a8
parent5767df9c058ccb0e90d79ed35cc8d0bee62cb407 (diff)
downloadeclipse.platform.team-ae15fdf2a64173f4ed82d9ce8812eb7cb270e43e.tar.gz
eclipse.platform.team-ae15fdf2a64173f4ed82d9ce8812eb7cb270e43e.tar.xz
eclipse.platform.team-ae15fdf2a64173f4ed82d9ce8812eb7cb270e43e.zip
44446: NPE in setCachedSyncBytes() while running Override and Update
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/EclipseSynchronizerTest.java37
1 files changed, 37 insertions, 0 deletions
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 eecf2064a..30dc75971 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
@@ -30,8 +30,10 @@ import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
+import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.TeamException;
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.resources.EclipseSynchronizer;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
@@ -519,4 +521,39 @@ public class EclipseSynchronizerTest extends EclipseTest {
listA.remove(obj);
}
}
+
+ /*
+ * See bug 44446
+ */
+ public void testRecreation() throws CoreException {
+
+ // Set up a project with dummy sync info
+ IProject project = getUniqueTestProject(getName());
+ sync.setFolderSync(project, dummyFolderSync(project));
+
+ IFolder folder = project.getFolder("folder1");
+ folder.create(false, true, null);
+ sync.setFolderSync(folder, dummyFolderSync(folder));
+ sync.setResourceSync(folder, dummyResourceSync(folder));
+
+ IFile file = folder.getFile("file1");
+ file.create(getRandomContents(), false /*force*/, null);
+ sync.setResourceSync(file, dummyResourceSync(file));
+
+ // Map the project to CVS so the Move/Delete hook works
+ RepositoryProvider.map(project, CVSProviderPlugin.getTypeId());
+
+ // Remove the file and assert that it still has sync info
+ file.delete(false, false, null);
+ assertNotNull("Sync bytes should not be null for " + file.getFullPath(), sync.getSyncBytes(file));
+
+ // Recreate the file and assert that it still has sync info
+ file.create(getRandomContents(), false /*force*/, null);
+ assertNotNull("Sync bytes should not be null for " + file.getFullPath(), sync.getSyncBytes(file));
+
+ // unmanage the file and assert that sync info is gone
+ sync.deleteResourceSync(file);
+ assertNull("Sync bytes should be null for " + file.getFullPath(), sync.getSyncBytes(file));
+
+ }
}

Back to the top