Browse Source

Some very temporary diagnostic output to help find/fix a Kaffe+Gump issue

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277623 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 20 years ago
parent
commit
56e9d4dcd5
1 changed files with 18 additions and 2 deletions
  1. +18
    -2
      src/testcases/org/apache/tools/ant/DirectoryScannerTest.java

+ 18
- 2
src/testcases/org/apache/tools/ant/DirectoryScannerTest.java View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2001-2004 The Apache Software Foundation
* Copyright 2001-2005 The Apache Software Foundation
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@ package org.apache.tools.ant;


import org.apache.tools.ant.taskdefs.condition.Os; import org.apache.tools.ant.taskdefs.condition.Os;
import org.apache.tools.ant.types.Resource; import org.apache.tools.ant.types.Resource;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.JavaEnvUtils; import org.apache.tools.ant.util.JavaEnvUtils;


import junit.framework.TestCase; import junit.framework.TestCase;
@@ -225,9 +226,13 @@ public class DirectoryScannerTest extends BuildFileTest {
* to Runtime.exec() must be made to create a link to test against. * to Runtime.exec() must be made to create a link to test against.
*/ */


public void testSetFollowLinks() {
public void testSetFollowLinks() throws IOException {
if (supportsSymlinks) { if (supportsSymlinks) {
File linkFile = new File(System.getProperty("root"), "src/main/org/apache/tools/ThisIsALink"); File linkFile = new File(System.getProperty("root"), "src/main/org/apache/tools/ThisIsALink");
if (JavaEnvUtils.isKaffe()) {
System.err.println("link exists pre-test? " + linkFile.exists());
}
try { try {
// add conditions and more commands as soon as the need arises // add conditions and more commands as soon as the need arises
String[] command = new String[] { String[] command = new String[] {
@@ -245,6 +250,11 @@ public class DirectoryScannerTest extends BuildFileTest {
} }


File dir = new File(System.getProperty("root"), "src/main/org/apache/tools"); File dir = new File(System.getProperty("root"), "src/main/org/apache/tools");
if (JavaEnvUtils.isKaffe()) {
System.err.println("link exists after exec? " + linkFile.exists());
System.err.println("Ant knows it is a link? " + FileUtils.getFileUtils().isSymbolicLink(dir, "ThisIsALink"));
}

DirectoryScanner ds = new DirectoryScanner(); DirectoryScanner ds = new DirectoryScanner();


// followLinks should be true by default, but if this ever // followLinks should be true by default, but if this ever
@@ -301,9 +311,15 @@ public class DirectoryScannerTest extends BuildFileTest {
!haveTaskdefsPackage); !haveTaskdefsPackage);


} finally { } finally {
if (JavaEnvUtils.isKaffe()) {
System.err.println("link exists pre-delete? " + linkFile.exists());
}
if (!linkFile.delete()) { if (!linkFile.delete()) {
throw new RuntimeException("Failed to delete " + linkFile); throw new RuntimeException("Failed to delete " + linkFile);
} }
if (JavaEnvUtils.isKaffe()) {
System.err.println("link exists post-delete? " + linkFile.exists());
}
} }
} }
} }


Loading…
Cancel
Save