cvs commit: ant/src/testcases/org/apache/tools/ant/types RedirectorElementTest.java
mbenson 2005/04/15 13:25:36 Modified:.WHATSNEW src/main/org/apache/tools/ant/types RedirectorElement.java src/etc/testcases/types redirector.xml src/testcases/org/apache/tools/ant/types RedirectorElementTest.java Log: The refid attribute of the I/O redirector was not functional. Revision ChangesPath 1.805 +2 -0 ant/WHATSNEW Index: WHATSNEW === RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.804 retrieving revision 1.805 diff -u -r1.804 -r1.805 --- WHATSNEW 12 Apr 2005 17:19:41 - 1.804 +++ WHATSNEW 15 Apr 2005 20:25:36 - 1.805 @@ -480,6 +480,8 @@ * forkmode=perBatch or once would ignore extension attributes that had been specified for formatters. Bugzilla Report 32973. +* The refid attribute of the I/O redirector was not functional. + Changes from Ant 1.6.1 to Ant 1.6.2 === 1.7 +74 -4 ant/src/main/org/apache/tools/ant/types/RedirectorElement.java Index: RedirectorElement.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/RedirectorElement.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- RedirectorElement.java14 Mar 2005 17:47:01 - 1.6 +++ RedirectorElement.java15 Apr 2005 20:25:36 - 1.7 @@ -17,9 +17,12 @@ package org.apache.tools.ant.types; import java.io.File; +import java.util.Stack; import java.util.Vector; +import java.util.Iterator; import java.util.ArrayList; +import org.apache.tools.ant.Project; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.taskdefs.Redirector; @@ -287,7 +290,6 @@ if (isReference()) { throw tooManyAttributes(); } -//pre JDK 1.4 compatible this.logError = ((logError) ? Boolean.TRUE : Boolean.FALSE); } @@ -329,7 +331,6 @@ if (isReference()) { throw tooManyAttributes(); } -//pre JDK 1.4 compatible this.append = ((append) ? Boolean.TRUE : Boolean.FALSE); } @@ -344,7 +345,6 @@ if (isReference()) { throw tooManyAttributes(); } -//pre JDK 1.4 compatible this.alwaysLog = ((alwaysLog) ? Boolean.TRUE : Boolean.FALSE); } @@ -357,7 +357,6 @@ if (isReference()) { throw tooManyAttributes(); } -//pre JDK 1.4 compatible this.createEmptyFiles = ((createEmptyFiles) ? Boolean.TRUE : Boolean.FALSE); } @@ -432,6 +431,10 @@ * @param sourcefile CODEString/CODE. */ public void configure(Redirector redirector, String sourcefile) { +if (isReference()) { +getRef().configure(redirector, sourcefile); +return; +} if (alwaysLog != null) { redirector.setAlwaysLog(alwaysLog.booleanValue()); } @@ -550,4 +553,71 @@ return (File[]) (list.toArray(new File[list.size()])); } +/** + * Convenience method. + * @throws BuildException on error. + */ +protected void dieOnCircularReference() throws BuildException { +if (isChecked()) { +return; +} +Stack s = new Stack(); +s.push(this); +dieOnCircularReference(s, getProject()); +} + +/** + * Overrides the version of DataType to recurse on all DataType + * child elements that may have been added. + * @param stk the stack of data types to use (recursively). + * @param p the project to use to dereference the references. + * @throws BuildException on error. + */ +protected void dieOnCircularReference(Stack stk, Project p) +throws BuildException { +if (isChecked()) { +return; +} +if (isReference()) { +super.dieOnCircularReference(stk, p); +} else { +Mapper[] m = new Mapper[] {inputMapper, outputMapper, errorMapper}; +for (int i = 0; i m.length; i++) { +if (m[i] != null) { +stk.push(m[i]); +m[i].dieOnCircularReference(stk, p); +stk.pop(); +} +} +Vector[] v = new Vector[] +{inputFilterChains, outputFilterChains, errorFilterChains}; +for (int i = 0; i v.length; i++) { +if (v[i] != null) { +for (Iterator fci = v[i].iterator(); fci.hasNext();) { +FilterChain fc =
Re: cvs commit: ant/src/testcases/org/apache/tools/ant/types RedirectorElementTest.java
thanks for giving me a probe-mail, Matt. 8-) OK, CVS commits go to [EMAIL PROTECTED], will send SVN mails there as well. Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/testcases/org/apache/tools/ant/types RedirectorElementTest.java
jkf 2005/02/26 13:03:44 Modified:src/etc/testcases/types redirector.xml src/testcases/org/apache/tools/ant/types RedirectorElementTest.java Log: RedirectorElementTest stopped working on windows w/h cat on the path. Now it passes the testcase if cat is not available. Revision ChangesPath 1.4 +3 -0 ant/src/etc/testcases/types/redirector.xml Index: redirector.xml === RCS file: /home/cvs/ant/src/etc/testcases/types/redirector.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- redirector.xml10 Feb 2005 22:32:21 - 1.3 +++ redirector.xml26 Feb 2005 21:03:44 - 1.4 @@ -22,6 +22,9 @@ /target target name=testLogInputString depends=cat-check if=can-cat +echo +testLogInputString can-cat +/echo exec executable=cat redirector inputstring=foo loginputstring=false / /exec 1.3 +3 -1 ant/src/testcases/org/apache/tools/ant/types/RedirectorElementTest.java Index: RedirectorElementTest.java === RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/types/RedirectorElementTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- RedirectorElementTest.java10 Feb 2005 22:32:20 - 1.2 +++ RedirectorElementTest.java26 Feb 2005 21:03:44 - 1.3 @@ -51,6 +51,8 @@ public void testLogInputString() { executeTarget(testLogInputString); -assertDebuglogContaining(Using input string); +if (super.getLog().indexOf(testLogInputString can-cat) =0 ) { +assertDebuglogContaining(Using input string); +} } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/testcases/org/apache/tools/ant/types RedirectorElementTest.java
mbenson 2004/06/23 12:30:14 Added: src/etc/testcases/taskdefs/exec Tag: ANT_16_BRANCH apply.xml parrot.sh src/etc/testcases/taskdefs/exec/expected Tag: ANT_16_BRANCH utf-8 src/etc/testcases/taskdefs/exec/input Tag: ANT_16_BRANCH iso8859-1 src/etc/testcases/types Tag: ANT_16_BRANCH redirector.xml src/main/org/apache/tools/ant/types Tag: ANT_16_BRANCH RedirectorElement.java src/main/org/apache/tools/ant/util Tag: ANT_16_BRANCH ConcatFileInputStream.java LeadPipeInputStream.java OutputStreamFunneler.java ReaderInputStream.java src/testcases/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH ExecuteOnTest.java src/testcases/org/apache/tools/ant/types Tag: ANT_16_BRANCH RedirectorElementTest.java Log: New files for redirector merge. Revision ChangesPath No revision No revision 1.3.2.1 +0 -0 ant/src/etc/testcases/taskdefs/exec/apply.xml Index: apply.xml === RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/exec/apply.xml,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -r1.3 -r1.3.2.1 1.1.2.1 +0 -0 ant/src/etc/testcases/taskdefs/exec/parrot.sh Index: parrot.sh === RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/exec/parrot.sh,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 No revision No revision 1.1.2.1 +0 -0 ant/src/etc/testcases/taskdefs/exec/expected/utf-8 Binary file No revision No revision 1.1.2.1 +0 -0 ant/src/etc/testcases/taskdefs/exec/input/iso8859-1 Binary file No revision No revision 1.1.2.1 +0 -0 ant/src/etc/testcases/types/redirector.xml Index: redirector.xml === RCS file: /home/cvs/ant/src/etc/testcases/types/redirector.xml,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 No revision No revision 1.2.2.1 +0 -0 ant/src/main/org/apache/tools/ant/types/RedirectorElement.java Index: RedirectorElement.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/RedirectorElement.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 No revision No revision 1.1.2.1 +0 -0 ant/src/main/org/apache/tools/ant/util/ConcatFileInputStream.java Index: ConcatFileInputStream.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/ConcatFileInputStream.java,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 1.1.2.1 +48 -4 ant/src/main/org/apache/tools/ant/util/LeadPipeInputStream.java Index: LeadPipeInputStream.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/LeadPipeInputStream.java,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- LeadPipeInputStream.java 27 Mar 2004 21:22:58 - 1.1 +++ LeadPipeInputStream.java 23 Jun 2004 19:30:14 - 1.1.2.1 @@ -27,6 +27,7 @@ /** * Special CODEPipedInputStream/CODE that will not die * when the writing CODEThread/CODE is no longer alive. + * @since Ant 1.6.2 */ public class LeadPipeInputStream extends PipedInputStream { private Task managingTask; @@ -39,14 +40,36 @@ } /** + * Construct a new CODELeadPipeInputStream/CODE + * with the specified buffer size. + * @param size the size of the circular buffer. + */ +public LeadPipeInputStream(int size) { +super(); +setBufferSize(size); +} + +/** * Construct a new CODELeadPipeInputStream/CODE to pull * from the specified CODEPipedOutputStream/CODE. - * @param src the CODEPipedOutputStream/CODE source. + * @param srcthe CODEPipedOutputStream/CODE source. */ public LeadPipeInputStream(PipedOutputStream src) throws IOException { super(src); } +/** + * Construct a new CODELeadPipeInputStream/CODE to pull + * from the specified