git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270348 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -17,6 +17,7 @@ import java.util.Hashtable; | |||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import java.util.Properties; | import java.util.Properties; | ||||
| import java.util.Random; | import java.util.Random; | ||||
| import java.util.Enumeration; | |||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.tools.ant.AntClassLoader; | import org.apache.tools.ant.AntClassLoader; | ||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| @@ -659,23 +660,23 @@ public class JUnitTask extends Task | |||||
| cmd.createArgument().setValue( "propsfile=" + propsFile.getAbsolutePath() ); | cmd.createArgument().setValue( "propsfile=" + propsFile.getAbsolutePath() ); | ||||
| Hashtable p = getProject().getProperties(); | Hashtable p = getProject().getProperties(); | ||||
| Properties props = new Properties(); | Properties props = new Properties(); | ||||
| for( Iterator enum = p.keys(); enum.hasNext(); ) | |||||
| for( Enumeration enum = p.keys(); enum.hasMoreElements(); ) | |||||
| { | { | ||||
| Object key = enum.next(); | |||||
| final Object key = enum.nextElement(); | |||||
| props.put( key, p.get( key ) ); | props.put( key, p.get( key ) ); | ||||
| } | } | ||||
| try | try | ||||
| { | { | ||||
| FileOutputStream outstream = new FileOutputStream( propsFile ); | |||||
| final FileOutputStream outstream = new FileOutputStream( propsFile ); | |||||
| props.save( outstream, "Ant JUnitTask generated properties file" ); | props.save( outstream, "Ant JUnitTask generated properties file" ); | ||||
| outstream.close(); | outstream.close(); | ||||
| } | } | ||||
| catch( java.io.IOException e ) | |||||
| catch( IOException ioe ) | |||||
| { | { | ||||
| throw new TaskException( "Error creating temporary properties file.", e ); | |||||
| throw new TaskException( "Error creating temporary properties file.", ioe ); | |||||
| } | } | ||||
| Execute execute = new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ), watchdog ); | |||||
| final Execute execute = new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ), watchdog ); | |||||
| execute.setCommandline( cmd.getCommandline() ); | execute.setCommandline( cmd.getCommandline() ); | ||||
| if( dir != null ) | if( dir != null ) | ||||
| { | { | ||||
| @@ -17,6 +17,7 @@ import java.util.Hashtable; | |||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import java.util.Properties; | import java.util.Properties; | ||||
| import java.util.Random; | import java.util.Random; | ||||
| import java.util.Enumeration; | |||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.tools.ant.AntClassLoader; | import org.apache.tools.ant.AntClassLoader; | ||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| @@ -659,23 +660,23 @@ public class JUnitTask extends Task | |||||
| cmd.createArgument().setValue( "propsfile=" + propsFile.getAbsolutePath() ); | cmd.createArgument().setValue( "propsfile=" + propsFile.getAbsolutePath() ); | ||||
| Hashtable p = getProject().getProperties(); | Hashtable p = getProject().getProperties(); | ||||
| Properties props = new Properties(); | Properties props = new Properties(); | ||||
| for( Iterator enum = p.keys(); enum.hasNext(); ) | |||||
| for( Enumeration enum = p.keys(); enum.hasMoreElements(); ) | |||||
| { | { | ||||
| Object key = enum.next(); | |||||
| final Object key = enum.nextElement(); | |||||
| props.put( key, p.get( key ) ); | props.put( key, p.get( key ) ); | ||||
| } | } | ||||
| try | try | ||||
| { | { | ||||
| FileOutputStream outstream = new FileOutputStream( propsFile ); | |||||
| final FileOutputStream outstream = new FileOutputStream( propsFile ); | |||||
| props.save( outstream, "Ant JUnitTask generated properties file" ); | props.save( outstream, "Ant JUnitTask generated properties file" ); | ||||
| outstream.close(); | outstream.close(); | ||||
| } | } | ||||
| catch( java.io.IOException e ) | |||||
| catch( IOException ioe ) | |||||
| { | { | ||||
| throw new TaskException( "Error creating temporary properties file.", e ); | |||||
| throw new TaskException( "Error creating temporary properties file.", ioe ); | |||||
| } | } | ||||
| Execute execute = new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ), watchdog ); | |||||
| final Execute execute = new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ), watchdog ); | |||||
| execute.setCommandline( cmd.getCommandline() ); | execute.setCommandline( cmd.getCommandline() ); | ||||
| if( dir != null ) | if( dir != null ) | ||||
| { | { | ||||