mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-26 02:15:31 +02:00
Add test for bug 168591
This commit is contained in:
parent
cda30345b7
commit
bb350271d1
1 changed files with 11 additions and 0 deletions
|
@ -98,9 +98,14 @@ public class FileServiceTest extends RSEBaseConnectionTestCase {
|
||||||
assertTrue(hf.canRead());
|
assertTrue(hf.canRead());
|
||||||
assertTrue(hf.canWrite());
|
assertTrue(hf.canWrite());
|
||||||
assertEquals(hf.getName(), testName);
|
assertEquals(hf.getName(), testName);
|
||||||
|
assertEquals(hf.getParentPath(), tempDirPath);
|
||||||
|
assertEquals(hf.getSize(), 0);
|
||||||
|
long modDate = hf.getModifiedDate();
|
||||||
|
assertTrue(modDate > 0);
|
||||||
|
|
||||||
File theFile = new File(tempDir, testName);
|
File theFile = new File(tempDir, testName);
|
||||||
assertTrue(theFile.exists());
|
assertTrue(theFile.exists());
|
||||||
|
assertTrue(modDate == theFile.lastModified());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testCreateCaseSensitive() throws SystemMessageException {
|
public void testCreateCaseSensitive() throws SystemMessageException {
|
||||||
|
@ -114,6 +119,7 @@ public class FileServiceTest extends RSEBaseConnectionTestCase {
|
||||||
hf2 = fs.createFolder(mon, tempDirPath, testName2);
|
hf2 = fs.createFolder(mon, tempDirPath, testName2);
|
||||||
assertTrue(hf2.exists());
|
assertTrue(hf2.exists());
|
||||||
assertTrue(hf2.isDirectory());
|
assertTrue(hf2.isDirectory());
|
||||||
|
assertFalse(hf.equals(hf2));
|
||||||
} else {
|
} else {
|
||||||
//Windows: uppercase version must be the same
|
//Windows: uppercase version must be the same
|
||||||
IHostFile hf2 = fs.getFile(mon, tempDirPath, testName2);
|
IHostFile hf2 = fs.getFile(mon, tempDirPath, testName2);
|
||||||
|
@ -121,12 +127,17 @@ public class FileServiceTest extends RSEBaseConnectionTestCase {
|
||||||
try {
|
try {
|
||||||
hf2 = fs.createFolder(mon, tempDirPath, testName2);
|
hf2 = fs.createFolder(mon, tempDirPath, testName2);
|
||||||
} catch(SystemMessageException e) {
|
} catch(SystemMessageException e) {
|
||||||
|
//Windows cannot create a folder when the file is already there
|
||||||
assertNotNull(e);
|
assertNotNull(e);
|
||||||
}
|
}
|
||||||
assertTrue(hf2.exists());
|
assertTrue(hf2.exists());
|
||||||
assertFalse(hf2.isDirectory());
|
assertFalse(hf2.isDirectory());
|
||||||
assertEquals(hf.getModifiedDate(), hf2.getModifiedDate());
|
assertEquals(hf.getModifiedDate(), hf2.getModifiedDate());
|
||||||
assertEquals(hf.getSize(), hf2.getSize());
|
assertEquals(hf.getSize(), hf2.getSize());
|
||||||
|
//Different abstract path names but denote the same file
|
||||||
|
//Should be equal since java.io.File treats them as equal
|
||||||
|
assertEquals(new File(tempDirPath, testName), new File(tempDirPath, testName2));
|
||||||
|
assertEquals(hf, hf2); //bug 168591: should be equal
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue