org.jtiger.ant
Class Java

java.lang.Object
  extended by org.jtiger.ant.Java

public final class Java
extends Object

An element used in the Ant task to specify the environment for the Java Virtual Machine that executes the test run. The JVM will be a forked process from the JVM that the Ant task is running in. This element is the same as the core Ant <java> task except that some of the elements and attributes are not present on this element.

Version:
2.1
Build Number 0376
Build Time 2006-07-28 01:50.16.218 CET (GMT + 1)
Author:
Tony Morris
See Also:
JTigerTask

Constructor Summary
Java(org.apache.tools.ant.taskdefs.Java java)
          Create a Java that wraps the given Apache Ant Java task.
 
Method Summary
 void addAssertions(org.apache.tools.ant.types.Assertions assertions)
          Control enablement of Java 1.4 assertions with an <assertions> subelement.
 void addEnv(org.apache.tools.ant.types.Environment.Variable env)
          Adds an environment variable.
 void addSysproperty(org.apache.tools.ant.types.Environment.Variable sysproperty)
          Adds a system property.
 void addSyspropertyset(org.apache.tools.ant.types.PropertySet syspropertyset)
          Adds a system property set.
 org.apache.tools.ant.types.Path createBootclasspath()
          Creates a boot classpath.
 org.apache.tools.ant.types.Path createClasspath()
          Creates a classpath.
 org.apache.tools.ant.types.Commandline.Argument createJvmarg()
          Creates a JVM argument.
 org.apache.tools.ant.types.Permissions createPermissions()
          Creates a set of permissions.
 void execute()
          Forks the JVM using the core Ant <java> task.
 void setAppend(boolean append)
          Sets whether output and error files should be appended to (true)or overwritten (false).
 void setClasspath(org.apache.tools.ant.types.Path classpath)
          Sets a classpath.
 void setClasspathRef(org.apache.tools.ant.types.Reference classpathRef)
          Sets a classpath reference.
 void setDir(File dir)
          Sets the directory to invoke the VM in.
 void setError(File error)
          Sets the file to which the standard error of the command should be redirected.
 void setErrorProperty(String errorProperty)
          Sets the name of a property in which the standard error of the command should be stored.
 void setFailonerror(boolean failonerror)
          Sets whether to stop the build process if the command exits with a returncode other than 0.
 void setJvm(String jvm)
          Sets the command used to invoke the Java Virtual Machine, default is 'java'.
 void setLogError(boolean logError)
          This attribute is used when you wish to see error output in Ant's log and you are redirecting output to a file/property.
 void setMaxmemory(String maxmemory)
          Max amount of memory to allocate to the forked VM.
 void setNewenvironment(boolean newenvironment)
          Sets whether to propagate old environment when new environment variables are specified.
 void setOutput(File output)
          Sets the name of a file to which to write the output.
 void setOutputproperty(String outputproperty)
          Sets the name of a property in which the output of the command should be stored.
 void setResultProperty(String resultProperty)
          Sets the name of a property in which the return code of the command should be stored.
 void setSpawn(boolean spawn)
          Sets the ability to start a process which will outlive ant.
 void setTimeout(Long timeout)
          Stop the command if it doesn't finish within the specified time (given in milliseconds).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Java

public Java(org.apache.tools.ant.taskdefs.Java java)
Create a Java that wraps the given Apache Ant Java task.

Parameters:
java - The Apache Ant Java task to wrap.
Method Detail

addAssertions

public void addAssertions(org.apache.tools.ant.types.Assertions assertions)
Control enablement of Java 1.4 assertions with an <assertions> subelement.

Parameters:
assertions - The assertion set.

addEnv

public void addEnv(org.apache.tools.ant.types.Environment.Variable env)
Adds an environment variable.

Parameters:
env - The new environment variable.

addSysproperty

public void addSysproperty(org.apache.tools.ant.types.Environment.Variable sysproperty)
Adds a system property.

Parameters:
sysproperty - The new system property.

addSyspropertyset

public void addSyspropertyset(org.apache.tools.ant.types.PropertySet syspropertyset)
Adds a system property set.

Parameters:
syspropertyset - The new system property set.

createBootclasspath

public org.apache.tools.ant.types.Path createBootclasspath()
Creates a boot classpath.

Returns:
A new boot classpath.

createClasspath

public org.apache.tools.ant.types.Path createClasspath()
Creates a classpath.

Returns:
A new classpath.

createJvmarg

public org.apache.tools.ant.types.Commandline.Argument createJvmarg()
Creates a JVM argument.

Returns:
A new JVM argument.

createPermissions

public org.apache.tools.ant.types.Permissions createPermissions()
Creates a set of permissions.

Returns:
A new set of permissions.

setAppend

public void setAppend(boolean append)
Sets whether output and error files should be appended to (true)or overwritten (false).

Parameters:
append - The value of whether output and error files should be appended to (true)or overwritten (false).

setClasspath

public void setClasspath(org.apache.tools.ant.types.Path classpath)
Sets a classpath.

Parameters:
classpath - A new classpath.

setClasspathRef

public void setClasspathRef(org.apache.tools.ant.types.Reference classpathRef)
Sets a classpath reference.

Parameters:
classpathRef - A new classpath reference.

setDir

public void setDir(File dir)
Sets the directory to invoke the VM in.

Parameters:
dir - The directory to invoke the VM in.

setError

public void setError(File error)
Sets the file to which the standard error of the command should be redirected.

Parameters:
error - The file to which the standard error of the command should be redirected.

setErrorProperty

public void setErrorProperty(String errorProperty)
Sets the name of a property in which the standard error of the command should be stored.

Parameters:
errorProperty - The name of a property in which the standard error of the command should be stored.

setFailonerror

public void setFailonerror(boolean failonerror)
Sets whether to stop the build process if the command exits with a returncode other than 0.

Parameters:
failonerror - The value of whether to stop the build process if the command exits with a returncode other than 0.

setJvm

public void setJvm(String jvm)
Sets the command used to invoke the Java Virtual Machine, default is 'java'. The command is resolved by java.lang.Runtime.exec().

Parameters:
jvm - The command used to invoke the Java Virtual Machine, default is 'java'. The command is resolved by java.lang.Runtime.exec().

setLogError

public void setLogError(boolean logError)
This attribute is used when you wish to see error output in Ant's log and you are redirecting output to a file/property. The error output will not be included in the output file/property. If you redirect error with the "error" or "errorProperty" attributes, this will have no effect.

Parameters:
logError - This attribute is used when you wish to see error output in Ant's log and you are redirecting output to a file/property. The error output will not be included in the output file/property. If you redirect error with the "error" or "errorProperty" attributes, this will have no effect.

setMaxmemory

public void setMaxmemory(String maxmemory)
Max amount of memory to allocate to the forked VM.

Parameters:
maxmemory - The maximum amount of memory to allocate to the forked VM.

setNewenvironment

public void setNewenvironment(boolean newenvironment)
Sets whether to propagate old environment when new environment variables are specified.

Parameters:
newenvironment - The value of whether to propagate old environment when new environment variables are specified.

setOutput

public void setOutput(File output)
Sets the name of a file to which to write the output. If the error stream is not also redirected to a file or property, it will appear in this output.

Parameters:
output - The name of a file to which to write the output. If the error stream is not also redirected to a file or property, it will appear in this output.

setOutputproperty

public void setOutputproperty(String outputproperty)
Sets the name of a property in which the output of the command should be stored. Unless the error stream is redirected to a separate file or stream, this property will include the error output.

Parameters:
outputproperty - The name of a property in which the output of the command should be stored. Unless the error stream is redirected to a separate file or stream, this property will include the error output.

setResultProperty

public void setResultProperty(String resultProperty)
Sets the name of a property in which the return code of the command should be stored. Only of interest if failonerror=false.

Parameters:
resultProperty - The name of a property in which the return code of the command should be stored. Only of interest if failonerror=false.

setSpawn

public void setSpawn(boolean spawn)
Sets the ability to start a process which will outlive ant.

Parameters:
spawn - The ability to start a process which will outlive ant.

setTimeout

public void setTimeout(Long timeout)
Stop the command if it doesn't finish within the specified time (given in milliseconds).

Parameters:
timeout - The specified time (given in milliseconds).

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Forks the JVM using the core Ant <java> task.

Throws:
org.apache.tools.ant.BuildException - IF a problem occurs during execution of the forked JVM.