Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 2627 Details for
Bug 3024
[resources] Ensure removing sync info deletes resource (1GD43Y0)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Test case for checking expected behaviour
org.eclipse.core.tests.resources-3024-diff.txt (text/plain), 3.63 KB, created by
Rafael Chaves
on 2002-12-03 11:52:17 EST
(
hide
)
Description:
Test case for checking expected behaviour
Filename:
MIME Type:
Creator:
Rafael Chaves
Created:
2002-12-03 11:52:17 EST
Size:
3.63 KB
patch
obsolete
>Index: src/org/eclipse/core/tests/resources/ISynchronizerTest.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ISynchronizerTest.java,v >retrieving revision 1.7 >diff -u -r1.7 ISynchronizerTest.java >--- src/org/eclipse/core/tests/resources/ISynchronizerTest.java 1 Aug 2002 15:24:09 -0000 1.7 >+++ src/org/eclipse/core/tests/resources/ISynchronizerTest.java 3 Dec 2002 16:49:16 -0000 >@@ -16,10 +16,12 @@ > > import junit.framework.Test; > import junit.framework.TestSuite; >+ > import org.eclipse.core.internal.resources.*; > import org.eclipse.core.resources.*; > import org.eclipse.core.runtime.*; > import org.eclipse.core.tests.harness.EclipseWorkspaceTest; >+ > // > public class ISynchronizerTest extends EclipseWorkspaceTest { > public static int NUMBER_OF_PARTNERS = 100; >@@ -912,5 +914,85 @@ > } catch (CoreException e) { > fail("9.1", e); > } >+} >+/** >+ * Removes resources, sets sync info to <code>null</code> and ensures the >+ * phantoms do not exist any more (see bug 3024) >+ */ >+public void testPhantomRemoval() { >+ final QualifiedName partner = new QualifiedName("org.eclipse.core.tests.resources", "myTarget"); >+ final IWorkspace workspace = getWorkspace(); >+ final ISynchronizer synchronizer = workspace.getSynchronizer(); >+ >+ // set up >+ synchronizer.add(partner); >+ IProject project = workspace.getRoot().getProject("MyProject"); >+ IFolder folder = project.getFolder("foo"); >+ IFile file1 = folder.getFile("file1.txt"); >+ IFile file2 = folder.getFile("file2.txt"); >+ ensureExistsInWorkspace(new IResource[] {file1, file2}, true); >+ >+ // sets sync info for the folder and its children >+ try { >+ synchronizer.setSyncInfo(partner, folder, getRandomString().getBytes()); >+ synchronizer.setSyncInfo(partner, file1, getRandomString().getBytes()); >+ synchronizer.setSyncInfo(partner, file2, getRandomString().getBytes()); >+ } catch (CoreException ce) { >+ fail("1.0",ce); >+ } >+ >+ // 1) tests with one child first >+ assertTrue("1.1", file1.exists()); >+ assertTrue("1.2", !file1.isPhantom()); >+ // deletes file >+ try { >+ file1.delete(true,getMonitor()); >+ } catch (CoreException ce) { >+ fail("2.0",ce); >+ } >+ // file is now a phantom resource >+ assertTrue("2.1", !file1.exists()); >+ assertTrue("2.2", file1.isPhantom()); >+ // removes sync info >+ try { >+ synchronizer.setSyncInfo(partner, file1, null); >+ } catch (CoreException ce) { >+ fail("3.0",ce); >+ } >+ // phantom should not exist any more >+ assertTrue("3.1", !file1.exists()); >+ assertTrue("3.2", !file1.isPhantom()); >+ >+ // 2) tests with the folder and remaining child >+ assertTrue("4.1", folder.exists()); >+ assertTrue("4.2", !folder.isPhantom()); >+ assertTrue("4.3", file2.exists()); >+ assertTrue("4.4", !file2.isPhantom()); >+ // deletes the folder and its only child >+ try { >+ folder.delete(true,getMonitor()); >+ } catch (CoreException ce) { >+ fail("5.0",ce); >+ } >+ // both resources are now phantom resources >+ assertTrue("5.1", !folder.exists()); >+ assertTrue("5.2", folder.isPhantom()); >+ assertTrue("5.3", !file2.exists()); >+ assertTrue("5.4", file2.isPhantom()); >+ // removes only folder sync info >+ try { >+ synchronizer.setSyncInfo(partner, folder, null); >+ } catch (CoreException ce) { >+ fail("6.0",ce); >+ } >+ // phantoms should not exist any more >+ assertTrue("6.1", !folder.exists()); >+ assertTrue("6.2", !folder.isPhantom()); >+ assertTrue("6.3", !file2.exists()); >+ assertTrue("6.4", !file2.isPhantom()); >+ >+ // clean-up >+ synchronizer.remove(partner); >+ ensureDoesNotExistInWorkspace(project); > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 3024
: 2627