Browse Source

1) make JarTest pass on Windows, these testcases were failing :

testRecreateWithUpdateNewerFile
   testRecreateZipfilesetWithUpdateNewerFile,
   the problem is the granularity of time stamps on the FAT
   see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/filetime_str.asp
   for more information

2) prevent XalanLiaisonTest and XslpLiaisonTest from running in batch
   when Xerces1 is not available,

3) fix one of the 3 failing testcases (testSimple) from JDependTest
   it was failing due to an overdose of \r in the output coming from
   BuildFileTest


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275733 13f79535-47bb-0310-9956-ffa450edef68
master
Antoine Levy-Lambert 21 years ago
parent
commit
566ea426c3
3 changed files with 14 additions and 6 deletions
  1. +7
    -0
      build.xml
  2. +1
    -5
      src/testcases/org/apache/tools/ant/BuildFileTest.java
  3. +6
    -1
      src/testcases/org/apache/tools/ant/taskdefs/JarTest.java

+ 7
- 0
build.xml View File

@@ -556,6 +556,9 @@
<available property="beanshell.present" <available property="beanshell.present"
classname="bsh.StringUtil" classname="bsh.StringUtil"
classpathref="classpath"/> classpathref="classpath"/>
<available property="xerces1.present"
classname="org.apache.xerces.framework.XMLParser"
classpathref="classpath"/>
<available property="jsch.present" <available property="jsch.present"
classname="com.jcraft.jsch.Session" classname="com.jcraft.jsch.Session"
classpathref="classpath"/> classpathref="classpath"/>
@@ -1498,6 +1501,10 @@
<!-- needs BSF to work --> <!-- needs BSF to work -->
<exclude name="${optional.package}/XalanLiaisonTest.java" <exclude name="${optional.package}/XalanLiaisonTest.java"
unless="bsf.present"/> unless="bsf.present"/>
<exclude name="${optional.package}/XalanLiaisonTest.java"
unless="xerces1.present"/>
<exclude name="${optional.package}/XslpLiaisonTest.java"
unless="xerces1.present"/>


<!-- needs resolver.jar to work --> <!-- needs resolver.jar to work -->
<exclude name="${optional.package}/XmlValidateCatalogTest.java" <exclude name="${optional.package}/XmlValidateCatalogTest.java"


+ 1
- 5
src/testcases/org/apache/tools/ant/BuildFileTest.java View File

@@ -215,11 +215,7 @@ public abstract class BuildFileTest extends TestCase {
if (!cr) { if (!cr) {
cleanedBuffer.append(ch); cleanedBuffer.append(ch);
} else { } else {
if (ch == '\n') {
cleanedBuffer.append(ch);
} else {
cleanedBuffer.append('\r').append(ch);
}
cleanedBuffer.append(ch);
} }
} }
return cleanedBuffer.toString(); return cleanedBuffer.toString();


+ 6
- 1
src/testcases/org/apache/tools/ant/taskdefs/JarTest.java View File

@@ -66,6 +66,7 @@ import java.util.Enumeration;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipFile; import java.util.zip.ZipFile;
import org.apache.tools.ant.BuildFileTest; import org.apache.tools.ant.BuildFileTest;
import org.apache.tools.ant.taskdefs.condition.Os;


/** /**
* @author Erik Meade <emeade@geekfarm.org> * @author Erik Meade <emeade@geekfarm.org>
@@ -160,8 +161,12 @@ public class JarTest extends BuildFileTest {


private void testRecreate(String firstTarget, String secondTarget) { private void testRecreate(String firstTarget, String secondTarget) {
executeTarget(firstTarget); executeTarget(firstTarget);
int sleeptime = 2500;
if (Os.isFamily("windows")) {
sleeptime += 2500;
}
try { try {
Thread.currentThread().sleep(2500);
Thread.currentThread().sleep(sleeptime);
} catch (InterruptedException e) { } catch (InterruptedException e) {
} // end of try-catch } // end of try-catch
File jarFile = new File(getProjectDir(), tempJar); File jarFile = new File(getProjectDir(), tempJar);


Loading…
Cancel
Save