Browse Source

Test failed on Windows, don't know why I never noticed before

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@953366 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 15 years ago
parent
commit
af9defd74a
1 changed files with 14 additions and 14 deletions
  1. +14
    -14
      src/tests/junit/org/apache/tools/ant/DefaultLoggerTest.java

+ 14
- 14
src/tests/junit/org/apache/tools/ant/DefaultLoggerTest.java View File

@@ -31,24 +31,24 @@ public class DefaultLoggerTest extends TestCase {
private static String msg(Throwable error, boolean verbose) {
StringBuffer m = new StringBuffer();
DefaultLogger.throwableMessage(m, error, verbose);
return m.toString().replace(StringUtils.LINE_SEP.charAt(0), '\n');
return m.toString();
}

public void testThrowableMessage() throws Exception { // #43398
BuildException be = new BuildException("oops", new Location("build.xml", 1, 0));
assertEquals(
"build.xml:1: oops\n",
"build.xml:1: oops" + StringUtils.LINE_SEP,
msg(be, false));
be = ProjectHelper.addLocationToBuildException(be, new Location("build.xml", 2, 0));
assertEquals(
"build.xml:2: The following error occurred while executing this line:\n" +
"build.xml:1: oops\n",
"build.xml:2: The following error occurred while executing this line:" + StringUtils.LINE_SEP +
"build.xml:1: oops" + StringUtils.LINE_SEP,
msg(be, false));
be = ProjectHelper.addLocationToBuildException(be, new Location("build.xml", 3, 0));
assertEquals(
"build.xml:3: The following error occurred while executing this line:\n" +
"build.xml:2: The following error occurred while executing this line:\n" +
"build.xml:1: oops\n",
"build.xml:3: The following error occurred while executing this line:" + StringUtils.LINE_SEP +
"build.xml:2: The following error occurred while executing this line:" + StringUtils.LINE_SEP +
"build.xml:1: oops" + StringUtils.LINE_SEP,
msg(be, false));
Exception x = new Exception("problem") {
public void printStackTrace(PrintWriter w) {
@@ -57,19 +57,19 @@ public class DefaultLoggerTest extends TestCase {
}
};
assertEquals(
"problem\n" +
" at p.C.m\n",
"problem" + StringUtils.LINE_SEP +
" at p.C.m" + StringUtils.LINE_SEP,
msg(x, false));
be = new BuildException(x, new Location("build.xml", 1, 0));
assertEquals(
"build.xml:1: problem\n" +
" at p.C.m\n",
"build.xml:1: problem" + StringUtils.LINE_SEP +
" at p.C.m" + StringUtils.LINE_SEP,
msg(be, false));
be = ProjectHelper.addLocationToBuildException(be, new Location("build.xml", 2, 0));
assertEquals(
"build.xml:2: The following error occurred while executing this line:\n" +
"build.xml:1: problem\n" +
" at p.C.m\n",
"build.xml:2: The following error occurred while executing this line:" + StringUtils.LINE_SEP +
"build.xml:1: problem" + StringUtils.LINE_SEP +
" at p.C.m" + StringUtils.LINE_SEP,
msg(be, false));
}



Loading…
Cancel
Save