diff --git a/docs/manual/CoreTasks/java.html b/docs/manual/CoreTasks/java.html index 5f65dabac..5854d6bab 100644 --- a/docs/manual/CoreTasks/java.html +++ b/docs/manual/CoreTasks/java.html @@ -235,6 +235,14 @@ a non zero return code will lead to a BuildException.

since Ant 1.6.

+

assertions

+ +

You can control enablement of Java 1.4 assertions with an +<assertions> +subelement.

+ +

since Ant 1.6.

+

Errors and return codes

By default the return code of a <java> is ignored. Alternatively, you can set resultproperty to the name of a property and have it assigned to the result code (barring immutability, @@ -283,7 +291,7 @@ and with a maximum memory of 128MB. Any non zero return code breaks the build. JVM, as it takes different parameters for other JVMs, That JVM can be started from <exec> if required.
-

Copyright © 2000-2003 Apache Software Foundation. All rights +

Copyright © 2000-2004 Apache Software Foundation. All rights Reserved.

diff --git a/docs/manual/CoreTypes/assertions.html b/docs/manual/CoreTypes/assertions.html index c78b91a95..4c85afa9a 100644 --- a/docs/manual/CoreTypes/assertions.html +++ b/docs/manual/CoreTypes/assertions.html @@ -9,30 +9,30 @@

Assertions

-The assertion type enables or disables the Java1.4 assertion feature, -on a whole java program, or components of a program. It can be used -in <java> and <junit> to add extra validation to code. +The assertions type enables or disables the Java 1.4 assertions feature, +on a whole Java program, or components of a program. It can be used +in <java> and +<junit> to add extra validation to code.

Assertions are covered in the - -Java 1.4.2 documentation, and the - -Java Language Specification +J2SDK 1.4 documentation, +and the +Java Language Specification.

-The key points to note are that a java.lang.AssertionError error +The key points to note are that a java.lang.AssertionError is thrown when an assertion fails, and that the facility is only available -on Java1.4 and later. To enable assertions one must set source="1.4", - "1.5" or later in <javac> when the source is being compiled, and +on Java 1.4 and later. To enable assertions one must set source="1.4" +(or later) in <javac> when the source is being compiled, and that the code must contain assert statements to be tested. The result of such an action is code that neither compiles or runs on earlier versions of Java. For this reason Ant itself currently contains no assertions.

When assertions are enabled (or disabled) in a task through nested -assertions elements, the classloader or command line is modified with the -appopriate options. This means that the JVM executed must be a Java1.4 +assertions elements, the class loader or command line is modified with the +appropriate options. This means that the JVM executed must be a Java 1.4 or later JVM, even if there are no assertions in the code. Attempting to enable assertions on earlier VMs will result in an "Unrecognized option" error and the JVM will not start. @@ -52,23 +52,23 @@ error and the JVM will not start. enableSystemAssertions Flag to turn system assertions on or off. - No, default is 'unspecified' + No; default is "unspecified"

-When the System assertions have neither been enabled or disabled, then -the JVM is not given any assertion information -the default action of the +When system assertions have been neither enabled nor disabled, then +the JVM is not given any assertion information - the default action of the current JVMs is to disable system assertions.

Note also that there is no apparent documentation for what parts of the -system have built in assertions. +JRE come with useful assertions.

Nested elements

enable

Enable assertions in portions of code. - +If neither a package nor class is specified, assertions are turned on in all (user) code.

@@ -78,14 +78,14 @@ Enable assertions in portions of code. - + @@ -104,14 +104,14 @@ Disable assertions in portions of code. - + @@ -124,32 +124,42 @@ assertions where they have been enabled in a parent package.

Examples

+
Example: enable assertions in all user classes
+ +All classes not in the JRE (i.e. all non-system classes) will have assertions turned on. +
+<assertions>
+  <enable/>
+</assertions>
+
+
Example: enable a single class
Enable assertions in a class called Test
-<assertions >
-  <enable class="Test" />
+<assertions>
+  <enable class="Test"/>
 </assertions>
 
Example: enable a package
-Enable assertions in a all packages below org.apache +Enable assertions in the org.apache package +and all packages starting with the org.apache. prefix
-<assertions >
-  <enable package="org.apache" />
+<assertions>
+  <enable package="org.apache"/>
 </assertions>
 
Example: System assertions
-Example: set system assertions and all org.apache packages except -for ant, and the class org.apache.tools.ant.Main. +Example: enable system assertions and assertions in all org.apache packages except +for Ant (but including org.apache.tools.ant.Main)
-<assertions enableSystemAssertions="true" >
-  <enable package="org.apache" />
-  <disable package="org.apache.ant" />
+<assertions enableSystemAssertions="true">
+  <enable package="org.apache"/>
+  <disable package="org.apache.tools.ant"/>
   <enable class="org.apache.tools.ant.Main"/>
 </assertions>
 
@@ -158,8 +168,8 @@ for ant, and the class org.apache.tools.ant.Main. Disable system assertions; enable those in the anonymous package
-<assertions enableSystemAssertions="false" >
-  <enable package="..." />
+<assertions enableSystemAssertions="false">
+  <enable package="..."/>
 </assertions>
 
@@ -169,15 +179,15 @@ Disable system assertions; enable those in the anonymous package This type is a datatype, so you can declare assertions and use them later
-<assertions id="project.assertions" >
-  <enable project="org.apache.test" />
+<assertions id="project.assertions">
+  <enable package="org.apache.test"/>
 </assertions>
 
-<assertions refid="project.assertions" />
+<assertions refid="project.assertions"/>
 

-

Copyright © 2003 Apache Software Foundation. All rights +

Copyright © 2003-2004 Apache Software Foundation. All rights Reserved.

diff --git a/docs/manual/OptionalTasks/junit.html b/docs/manual/OptionalTasks/junit.html index f840299d5..c221033ee 100644 --- a/docs/manual/OptionalTasks/junit.html +++ b/docs/manual/OptionalTasks/junit.html @@ -253,6 +253,14 @@ see permissions

since Ant 1.6.

+

assertions

+ +

You can control enablement of Java 1.4 assertions with an +<assertions> +subelement.

+ +

since Ant 1.6.

+

formatter

The results of the tests can be printed in different @@ -527,7 +535,7 @@ aborted. Results are collected in files named ${reports.tests}.


-

Copyright © 2000-2003 Apache Software Foundation. All rights +

Copyright © 2000-2004 Apache Software Foundation. All rights Reserved.

classThe name of a class to enable assertions on.The name of a class on which to enable assertions. No
package - The name of a package to turn assertions on. Use "..." for - the anonymous package. + The name of a package in which to enable assertions on all classes. (Includes subpackages.) + Use "..." for the anonymous package. No
classThe name of a class to disable assertions for.The name of a class on which to disable assertions. No
package - The name of a package to turn assertions off on. Use "..." for - the anonymous package. + The name of a package in which to disable assertions on all classes. (Includes subpackages.) + Use "..." for the anonymous package. No