mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-04 15:45:25 +02:00
Bug 314496 - testcase for [efs] Broken symbolic links do not report a proper EFS.ATTRIBUTE_LINK_TARGET
This commit is contained in:
parent
160b8c76c1
commit
adea4eee0a
2 changed files with 32 additions and 1 deletions
|
@ -58,7 +58,7 @@ plugin@org.eclipse.rse.subsystems.shells.telnet=v200905272300,:pserver:anonymous
|
|||
plugin@org.eclipse.rse.subsystems.terminals.core=v200908051630,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.terminals.core
|
||||
plugin@org.eclipse.rse.subsystems.terminals.ssh=v200908051630,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.terminals.ssh
|
||||
plugin@org.eclipse.rse.terminals.ui=v201005221100,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.terminals.ui
|
||||
plugin@org.eclipse.rse.tests=v201005261430,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/tests/org.eclipse.rse.tests
|
||||
plugin@org.eclipse.rse.tests=v201005261600,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/tests/org.eclipse.rse.tests
|
||||
plugin@org.eclipse.rse.tests.framework=v200905272300,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/tests/org.eclipse.rse.tests.framework
|
||||
plugin@org.eclipse.rse.ui=v201005221100,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.ui
|
||||
plugin@org.eclipse.rse.useractions=v200905272300,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.useractions
|
|
@ -26,6 +26,7 @@ import junit.framework.TestSuite;
|
|||
import org.eclipse.core.filesystem.EFS;
|
||||
import org.eclipse.core.filesystem.IFileInfo;
|
||||
import org.eclipse.core.filesystem.IFileStore;
|
||||
import org.eclipse.core.filesystem.URIUtil;
|
||||
import org.eclipse.core.filesystem.provider.FileInfo;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
@ -285,6 +286,36 @@ public class RSEFileStoreTest extends FileServiceBaseTest {
|
|||
//assertTrue("2.6.2", info.getLastModified() <= parentModified); //not actually changed
|
||||
}
|
||||
|
||||
public void testBrokenSymlink() throws Exception {
|
||||
//-test-author-:MartinOberhuber
|
||||
if (isTestDisabled())
|
||||
return;
|
||||
if (fHomeDirectory != null && fHomeDirectory.getSeparatorChar() == '/' && fHomeDirectory.getParentRemoteFileSubSystem().isCaseSensitive()) {
|
||||
String testFileName = "broken.txt"; //$NON-NLS-1$
|
||||
IRemoteCmdSubSystem rcmd = getShellServiceSubSystem();
|
||||
SimpleCommandOperation op = new SimpleCommandOperation(rcmd, fHomeDirectory, true);
|
||||
op.runCommand("ln -s notExisting2.txt \"" + fTestStorePath + "/" + testFileName + "\"", true);
|
||||
while (op.isActive()) {
|
||||
Thread.sleep(200);
|
||||
}
|
||||
if ("localConnection.properties".equals(fPropertiesFileName)) {
|
||||
//RSE-Local on UNIX: check native EFS in addition to RSE-Local
|
||||
IFileStore efsStore = EFS.getStore(URIUtil.toURI(fTestStorePath+'/'+testFileName));
|
||||
IFileInfo efsInfo = efsStore.fetchInfo();
|
||||
assertFalse("0.1", efsInfo.exists());
|
||||
assertTrue("0.2", efsInfo.getAttribute(EFS.ATTRIBUTE_SYMLINK));
|
||||
assertEquals("0.3", "notExisting2.txt", efsInfo.getStringAttribute(EFS.ATTRIBUTE_LINK_TARGET));
|
||||
//bug 314494: RSE-Local does not support broken symlinks yet
|
||||
return;
|
||||
}
|
||||
IFileStore brokenStore = fTestStore.getChild(testFileName);
|
||||
IFileInfo info = brokenStore.fetchInfo();
|
||||
assertFalse("1.0", info.exists());
|
||||
assertTrue("1.1", info.getAttribute(EFS.ATTRIBUTE_SYMLINK));
|
||||
assertEquals("1.2", "notExisting2.txt", info.getStringAttribute(EFS.ATTRIBUTE_LINK_TARGET));
|
||||
}
|
||||
}
|
||||
|
||||
public void testDeleteSpecialCases() throws Exception {
|
||||
//-test-author-:MartinOberhuber
|
||||
if (isTestDisabled())
|
||||
|
|
Loading…
Add table
Reference in a new issue