org.eclipse.core.tests.resources
Class LinkedResourceTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.eclipse.core.tests.harness.CoreTest
              extended by org.eclipse.core.tests.resources.ResourceTest
                  extended by org.eclipse.core.tests.resources.LinkedResourceTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
LinkedResourceWithPathVariableTest

public class LinkedResourceTest
extends ResourceTest

Tests the following API methods: IFile#createLink IFolder#createLink This test supports both variable-based and non-variable-based locations. Although the method used for creating random locations ResourceTest#getRandomLocation() never returns variable- based paths, this method is overwritten in the derived class LinkedResourceWithPathVariable to always return variable-based paths. To support variable-based paths wherever a file system location is used, it is mandatory first to resolve it and only then using it, except in calls to IFile#createLink and IFolder#createLink and when the location is obtained using IResource#getLocation().


Field Summary
 
Fields inherited from class org.eclipse.core.tests.resources.ResourceTest
deltaListener, PI_RESOURCES_TESTS
 
Fields inherited from class org.eclipse.core.tests.harness.CoreTest
PI_HARNESS
 
Constructor Summary
LinkedResourceTest()
           
LinkedResourceTest(java.lang.String name)
           
 
Method Summary
static junit.framework.Test suite()
           
 void testAllowMissingLocal()
          Tests creation of a linked resource whose corresponding file system path does not exist.
 void testBlockedFolder()
          Tests case where a resource in the file system cannot be added to the workspace because it is blocked by a linked resource of the same name.
 void testChangeLinkGender()
          This test creates a linked folder resource, then changes the directory in the file system to be a file.
 void testCopyFile()
           
 void testCopyFolder()
           
 void testCopyMissingFile()
          Tests copying a linked file resource that doesn't exist in the file system
 void testCopyMissingFolder()
          Tests copying a linked folder that doesn't exist in the file system
 void testCopyProjectWithLinks()
           
 void testCreateFolderInBackground()
          Tests creating a linked folder and performing refresh in the background
 void testCreateHiddenLinkedResources()
          Tests whether IFile.createLink(org.eclipse.core.runtime.IPath, int, org.eclipse.core.runtime.IProgressMonitor) and IFolder.createLink(org.eclipse.core.runtime.IPath, int, org.eclipse.core.runtime.IProgressMonitor) handle IResource.HIDDEN flag properly.
 void testCreateLinkCaseVariant()
          Tests creating a linked resource with the same name but different case as an existing resource.
 void testCreateLinkInDotProject()
          Tests creating a linked resource by modifying the .project file directly.
 void testCreateProjectWithDeepLinks()
          Tests creating a project whose .project file already defines links at depth greater than one.
 void testDeepMoveProjectWithLinks()
           
 void testDeleteFolderWithLinks()
          Tests bug 209175.
 void testDeleteLinkParent()
          Tests deleting the parent of a linked resource.
 void testDeleteProjectWithLinks()
          Tests deleting and then recreating a project
 void testFindFilesForLocationCaseVariant()
          Tests that IWorkspaceRoot.findFilesForLocation works correctly in presence of a linked resource that does not match the case in the file system
 void testIsLinked()
          Tests the IResource.isLinked(int) method.
 void testLinkedFileInLinkedFolder()
          Specific testing of links within links.
 void testLinkFile()
          Automated test of IFile#createLink
 void testLinkFolder()
          Automated test of IFolder#createLink
 void testLocationWithColon()
          Tests creating a linked resource whose location contains a colon character.
 void testModificationStamp()
          Tests the timestamp of a linked file when the local file is created or deleted.
 void testMoveFile()
           
 void testMoveFolder()
           
 void testMoveMissingFile()
          Tests moving a linked file resource that doesn't exist in the file system
 void testMoveMissingFolder()
          Tests moving a linked folder that doesn't exist in the file system
 void testMoveProjectWithLinks()
           
 void testMoveProjectWithLinks2()
          Tests bug 117402.
 void testNatureVeto()
           
 void testNestedLink()
          Tests creating a link within a link, and ensuring that both links still exist when the project is closed/opened (bug 177367).
 void testRefreshDeepLink()
          Create a project with a linked resource at depth > 2, and refresh it.
 
Methods inherited from class org.eclipse.core.tests.resources.ResourceTest
assertDoesNotExistInFileSystem, assertDoesNotExistInFileSystem, assertDoesNotExistInFileSystem, assertDoesNotExistInFileSystem, assertDoesNotExistInWorkspace, assertDoesNotExistInWorkspace, assertDoesNotExistInWorkspace, assertDoesNotExistInWorkspace, assertExistsInFileSystem, assertExistsInFileSystem, assertExistsInFileSystem, assertExistsInFileSystem, assertExistsInWorkspace, assertExistsInWorkspace, assertExistsInWorkspace, assertExistsInWorkspace, assertExistsInWorkspace, assertExistsInWorkspace, assertExistsInWorkspace, assertExistsInWorkspace, buildResources, buildResources, compareContent, createFileInFileSystem, createFileInFileSystem, createFileInFileSystem, createFileInFileSystem, createHierarchy, defineHierarchy, ensureDoesNotExistInFileSystem, ensureDoesNotExistInFileSystem, ensureDoesNotExistInWorkspace, ensureDoesNotExistInWorkspace, ensureExistsInFileSystem, ensureExistsInFileSystem, ensureExistsInFileSystem, ensureExistsInWorkspace, ensureExistsInWorkspace, ensureExistsInWorkspace, ensureExistsInWorkspace, ensureOutOfSync, getUniqueString, getWorkspace
 
Methods inherited from class org.eclipse.core.tests.harness.CoreTest
createFileInFileSystem, debug, fail, getContents, getContents, getMonitor, getRandomContents, getRandomLocation, getRandomString, getTempDir, log, log, transferData, transferDataWithoutClose
 
Methods inherited from class junit.framework.TestCase
countTestCases, getName, run, run, runBare, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LinkedResourceTest

public LinkedResourceTest()

LinkedResourceTest

public LinkedResourceTest(java.lang.String name)
Method Detail

suite

public static junit.framework.Test suite()

testAllowMissingLocal

public void testAllowMissingLocal()
Tests creation of a linked resource whose corresponding file system path does not exist. This should succeed but no operations will be available on the resulting resource.


testBlockedFolder

public void testBlockedFolder()
Tests case where a resource in the file system cannot be added to the workspace because it is blocked by a linked resource of the same name.


testChangeLinkGender

public void testChangeLinkGender()
This test creates a linked folder resource, then changes the directory in the file system to be a file. On refresh, the linked resource should still exist, should have the correct gender, and still be a linked resource.


testCopyFile

public void testCopyFile()

testCopyFolder

public void testCopyFolder()

testCopyMissingFile

public void testCopyMissingFile()
Tests copying a linked file resource that doesn't exist in the file system


testCopyMissingFolder

public void testCopyMissingFolder()
Tests copying a linked folder that doesn't exist in the file system


testCopyProjectWithLinks

public void testCopyProjectWithLinks()

testCreateFolderInBackground

public void testCreateFolderInBackground()
                                  throws org.eclipse.core.runtime.CoreException
Tests creating a linked folder and performing refresh in the background

Throws:
org.eclipse.core.runtime.CoreException

testCreateLinkCaseVariant

public void testCreateLinkCaseVariant()
Tests creating a linked resource with the same name but different case as an existing resource. On case insensitive platforms this should fail.


testCreateLinkInDotProject

public void testCreateLinkInDotProject()
Tests creating a linked resource by modifying the .project file directly. This is a regression test for bug 63331.


testCreateProjectWithDeepLinks

public void testCreateProjectWithDeepLinks()
Tests creating a project whose .project file already defines links at depth greater than one. See bug 121322.


testCreateHiddenLinkedResources

public void testCreateHiddenLinkedResources()
Tests whether IFile.createLink(org.eclipse.core.runtime.IPath, int, org.eclipse.core.runtime.IProgressMonitor) and IFolder.createLink(org.eclipse.core.runtime.IPath, int, org.eclipse.core.runtime.IProgressMonitor) handle IResource.HIDDEN flag properly.


testDeepMoveProjectWithLinks

public void testDeepMoveProjectWithLinks()

testDeleteLinkParent

public void testDeleteLinkParent()
Tests deleting the parent of a linked resource.


testDeleteProjectWithLinks

public void testDeleteProjectWithLinks()
Tests deleting and then recreating a project


testDeleteFolderWithLinks

public void testDeleteFolderWithLinks()
Tests bug 209175.


testFindFilesForLocationCaseVariant

public void testFindFilesForLocationCaseVariant()
Tests that IWorkspaceRoot.findFilesForLocation works correctly in presence of a linked resource that does not match the case in the file system


testIsLinked

public void testIsLinked()
Tests the IResource.isLinked(int) method.


testLinkedFileInLinkedFolder

public void testLinkedFileInLinkedFolder()
Specific testing of links within links.


testLinkFile

public void testLinkFile()
Automated test of IFile#createLink


testLinkFolder

public void testLinkFolder()
Automated test of IFolder#createLink


testLocationWithColon

public void testLocationWithColon()
Tests creating a linked resource whose location contains a colon character.


testModificationStamp

public void testModificationStamp()
Tests the timestamp of a linked file when the local file is created or deleted. See bug 34150 for more details.


testMoveFile

public void testMoveFile()

testMoveFolder

public void testMoveFolder()

testMoveMissingFile

public void testMoveMissingFile()
Tests moving a linked file resource that doesn't exist in the file system


testMoveMissingFolder

public void testMoveMissingFolder()
Tests moving a linked folder that doesn't exist in the file system


testMoveProjectWithLinks

public void testMoveProjectWithLinks()

testMoveProjectWithLinks2

public void testMoveProjectWithLinks2()
Tests bug 117402.


testNatureVeto

public void testNatureVeto()

testNestedLink

public void testNestedLink()
Tests creating a link within a link, and ensuring that both links still exist when the project is closed/opened (bug 177367).


testRefreshDeepLink

public void testRefreshDeepLink()
Create a project with a linked resource at depth > 2, and refresh it.