1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

bug 311468: JUnit failure: ErrorParserFileMatchingTest - SymbolicLink

More investigative asserts added
This commit is contained in:
Andrew Gvozdev 2010-05-12 02:03:55 +00:00
parent 25fb53e9dc
commit 207ec8f911

View file

@ -541,10 +541,26 @@ public class ResourceHelper {
try {
process.waitFor();
} catch (InterruptedException e) {
Assert.assertTrue("Command to create symbolic link was interrupted: "+e.toString(),
new File(linkedPath.toOSString()).exists());
}
if (!new File(linkedPath.toOSString()).exists()) {
// Not supposed to happen, trying to figure out what's going on
final int timeCount = 5;
for (int i=1;i<=timeCount;i++) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
if (new File(linkedPath.toOSString()).exists()) {
Assert.fail("Symbolic link created only after "+i+" seconds: [" + command +"]");
break;
}
}
Assert.fail("Symbolic link NOT created after "+timeCount+" seconds: [" + command +"]");
}
Assert.assertTrue("Symbolic link was not created: [" + command +"]",
new File(linkedPath.toOSString()).exists());
IResource resource = project.getFile(linkName);
resource.refreshLocal(IResource.DEPTH_ZERO, null);