Books
in black and white
Main menu
Share a book About us Home
Books
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics
Ads

Java Tools for Extreme programming mastering open source tools including - Hightower R.

Hightower R. Java Tools for Extreme programming mastering open source tools including - Wiley publishing , 2002. - 417 p.
ISBN: 0-471-20708
Download (direct link): javatoolsforextremeprog2002.pdf
Previous << 1 .. 114 115 116 117 118 119 < 120 > 121 122 123 124 125 126 .. 159 >> Next

running
? haltonerror When set to "on", fails the build if an error occurs during the testing
? haltonfailure When set to "on", fails the build if a test fails
? todir Directory the reports will write to
? outfile Base name of the report file
? if Evaluates whether a property exists before running a test
? unless Evaluates whether a property does not exists before running a test
? batchtest Runs many Junit test with a nested file set
? fork When set to "on", runs the test in a JVM separate from the one in which Ant is
running
? haltonerror When set to "on", fails the build if an error occurs during the testing
? todir Directory the reports will write to
? if Evaluates whether a property exists before running a test
? unless Evaluates whether a property does not exist before running a test
JunitReport Task
The junitreport task transforms the XML output from a Junit task's tests into an HTML-based report: <junitreport todir="./foo">
<fileset dir="./bla">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="./reports"/>
</junitreport>
Parameters
? tofile File name to hold a list of all the files generated by the Junit task; defaults to TESTS-TestSuites.xml
? todir Directory to which to write the file specified in the tofile parameter
Nested Parameters
? fileset Specifies a collections of files (see section "Frequently Used Nested Parameters and Elements" at the end of this chapter for more information).
? report Generates reports for the Junit tests
? format Set to "frames" or "no frames"; defaults to "frames"
? styledir Directory where style sheets are defined; defaults to embedded style sheets
? todir Directory where the final HTML files are written
? extension Extension for the final reports; defaults to HTML
Frequently Used Nested Parameters and Elements
Nested parameters can be used within certain tasks tags, as children. Some of the most frequent ones are listed below in order to shorten the definition a tasks, by avoiding repetition.
Classpath Element
The classpath task allows tasks to use paths and class paths efficiently:
316
<classpath path-"[path]"/>
Nested Parameters
? pathelement Class used to specify both paths and class paths. Pathelement is used as a nested element for many other tasks:
? <classpath>
? <pathelement path-"[path]"/>
? </classpath>
? path A comma-separated list of paths:
? <classpath>
? <pathelement path-"[path]"/>
? </classpath>
? location a comma-separated list of paths, relative to the base directory of the project:
? <classpath>
? <pathelement location-'classes''/>
? </classpath>
fileset Specifies a collections of files (see section "Frequently Used Nested Parameters and Elements" at the end of this chapter for more information).
<fileset dir-'/src/java" >
<include name-"**/*.java"/>
<exclude name-"**/*Test*"/>
</fileset>
The above example includes all Java source except those with the substring "Test" in their filename.
Mapper Element
The mapper task simply maps a file to a target. Keep in mind that this task is used in conjunction with other tasks.
<mapper type-"identity"/>
In the above the to and from are ignored and the files are copied into a parallel subdirectory hierarchy as the source to the destination (e.g., c:\src\xptool\Hello.java copied to d:\backup\src\xptool\Hello.java).
<mapper type-"flatten"/>
Unlike the first example, copy all the files from the source to the destination, but all in the source directory with no subdirectory hierarchy (e.g., c:\src\xptool\Hello.java copied to d:\backup\Hello.java).
<mapper type-'glob" from-"*.java" to-"*.java.bak"/>
Copy *.java files to *.java.bak files (e.g., c:\src\xptool\Hello.java copied to d:\backup\src\xptool\Hello.java.bak).
Parameters
? type Several types have been defined internally to this class:
? identity The target is identical to the source name.
? flatten The target is identical to the source name and is stripped of any directory
structure, effectively making the branch flat.
? merge The type will map all entries to the same target using the mapper's "to"
parameter.
? glob Patterns will be matched using the mapper's "to" and "from" parameters. The "to"
parameter will be used to specify the pattern-matching names. The "from" parameter will be used to specify the target pattern.
? regexp Patterns will be evaluated against a regular expression using the mapper's "to"
and "from" parameters. The "to" parameter will be used to specify the regular expression to match names. The "from" parameter will be used to specify the regular expression for the target pattern.
? classname Specifies the implementation by class name.
317
? classpath The class path to use when looking up the class name.
? classpathref A class path used in looking up a class specified by the reference id of one of the build files elements:
? <project ... >
? <path id="project.class.path">
? <pathelement location="lib/"/>
? <pathelement path="${java.class.path}/"/>
Previous << 1 .. 114 115 116 117 118 119 < 120 > 121 122 123 124 125 126 .. 159 >> Next