donaldp 02/02/21 01:39:53
Modified:
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit
JUnitTask.java JUnitTest.java
Log:
getPropertys from new TaskContext method
Revision Changes Path
1.41 +9 -14
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
Index: JUnitTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- JUnitTask.java 18 Feb 2002 09:02:39 -0000 1.40
+++ JUnitTask.java 21 Feb 2002 09:39:53 -0000 1.41
@@ -13,17 +13,15 @@
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
import java.util.Iterator;
+import java.util.Map;
import java.util.Properties;
import java.util.Random;
import org.apache.aut.nativelib.ExecManager;
+import org.apache.myrmidon.api.AbstractTask;
import org.apache.myrmidon.api.TaskContext;
import org.apache.myrmidon.api.TaskException;
-import org.apache.myrmidon.api.AbstractTask;
import org.apache.myrmidon.framework.Execute;
-import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.Argument;
import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.types.CommandlineJava;
@@ -102,7 +100,7 @@
* @see JUnitTest
* @see BatchTest
*/
-public class JUnitTask extends Task
+public class JUnitTask extends AbstractTask
{
private CommandlineJava commandline = new CommandlineJava();
@@ -555,7 +553,7 @@
}
else
{
- super.handleErrorOutput( line );
+ //super.handleErrorOutput( line );
}
}
@@ -572,7 +570,7 @@
}
else
{
- super.handleOutput( line );
+ //super.handleOutput( line );
}
}
@@ -582,9 +580,6 @@
* killedProcess()</tt> method of the watchdog class.
*
* @param test the testcase to execute.
- * @param watchdog the watchdog in charge of cancelling the test if it
- * exceeds a certain amount of time. Can be <tt>null</tt> , in this
- * case the test could probably hang forever.
*/
private int executeAsForked( JUnitTest test )
throws TaskException
@@ -622,11 +617,11 @@
// Create a temporary file to pass the Ant properties to the forked
test
File propsFile = new File( "junit" + ( new Random(
System.currentTimeMillis() ) ).nextLong() + ".properties" );
cmd.addArgument( "propsfile=" + propsFile.getAbsolutePath() );
- Hashtable p = getProject().getProperties();
+ Map p = getContext().getPropertys();
Properties props = new Properties();
- for( Enumeration enum = p.keys(); enum.hasMoreElements(); )
+ for( Iterator enum = p.keySet().iterator(); enum.hasNext(); )
{
- final Object key = enum.nextElement();
+ final Object key = enum.next();
props.put( key, p.get( key ) );
}
try
@@ -668,7 +663,7 @@
private int executeInVM( JUnitTest test )
throws TaskException
{
- test.setProperties( getProject().getProperties() );
+ test.setProperties( getContext().getPropertys() );
if( dir != null )
{
getLogger().warn( "dir attribute ignored if running in the same
VM" );
1.8 +2 -3
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java
Index: JUnitTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- JUnitTest.java 14 Feb 2002 09:34:27 -0000 1.7
+++ JUnitTest.java 21 Feb 2002 09:39:53 -0000 1.8
@@ -8,10 +8,9 @@
package org.apache.tools.ant.taskdefs.optional.junit;
import java.util.ArrayList;
-import java.util.Hashtable;
import java.util.Iterator;
+import java.util.Map;
import java.util.Properties;
-import org.apache.tools.ant.Project;
import org.apache.myrmidon.api.TaskContext;
/**
@@ -95,7 +94,7 @@
m_outfile = value;
}
- public void setProperties( final Hashtable properties )
+ public void setProperties( final Map properties )
{
m_props = new Properties();
final Iterator enum = properties.keySet().iterator();
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>