Browse Source

tweaking tests affecting by having made flush a no-op in fixing bug 50507

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1095768 13f79535-47bb-0310-9956-ffa450edef68
master
Antoine Levy-Lambert 14 years ago
parent
commit
ab38cf7504
2 changed files with 9 additions and 6 deletions
  1. +4
    -4
      src/etc/testcases/taskdefs/java.xml
  2. +5
    -2
      src/tests/junit/org/apache/tools/ant/util/LineOrientedOutputStreamTest.java

+ 4
- 4
src/etc/testcases/taskdefs/java.xml View File

@@ -208,11 +208,11 @@
<loadfile property="redirect.out.contents" srcfile="${outfile}" />

<condition property="r1file">
<equals arg1="${redirect.out.contents}" arg2="foo" />
<equals arg1="${redirect.out.contents}" arg2="foo${line.separator}" />
</condition>

<fail unless="r1file">${outfile}:
&quot;${redirect.out.contents}&quot; expected &quot;foo&quot;</fail>
&quot;${redirect.out.contents}&quot; expected &quot;foo&#010;&quot;</fail>

<condition property="r1prop">
<equals arg1="${redirect.err}" arg2="" />
@@ -248,11 +248,11 @@ redirect.err=&quot;${redirect.err}&quot; should be empty</fail>
<loadfile property="redirect.out.contents2" srcfile="${outfile}" />

<condition property="r2file">
<equals arg1="${redirect.out.contents2}" arg2="foobar" />
<equals arg1="${redirect.out.contents2}" arg2="foo${line.separator}bar${line.separator}" />
</condition>

<fail unless="r2file">${outfile}:
&quot;${redirect.out.contents2}&quot; expected &quot;foobar&quot;</fail>
&quot;${redirect.out.contents2}&quot; expected &quot;foo&#010;bar&#010;&quot;</fail>

<condition property="r2prop">
<!-- property should not change -->


+ 5
- 2
src/tests/junit/org/apache/tools/ant/util/LineOrientedOutputStreamTest.java View File

@@ -84,13 +84,13 @@ public class LineOrientedOutputStreamTest extends TestCase {
public void testFlushArray() throws IOException {
writeByteArray();
stream.flush();
stream.assertInvoked();
stream.assertNotInvoked();
}

public void testFlushSingleBytes() throws IOException {
writeSingleBytes();
stream.flush();
stream.assertInvoked();
stream.assertNotInvoked();
}

public void testCloseArray() throws IOException {
@@ -133,5 +133,8 @@ public class LineOrientedOutputStreamTest extends TestCase {
private void assertInvoked() {
assertTrue("At least one line", invoked);
}
private void assertNotInvoked() {
assertTrue("No output", invoked==false);
}
}
}// LineOrientedOutputStreamTest

Loading…
Cancel
Save