Java Doc for JBlanketModifierTask.java in  » Code-Analyzer » JBlanket » csdl » jblanket » ant » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Code Analyzer » JBlanket » csdl.jblanket.ant 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


csdl.jblanket.ant.JBlanketTask
   csdl.jblanket.ant.JBlanketModifierTask

JBlanketModifierTask
public class JBlanketModifierTask extends JBlanketTask (Code)
Implements the JBlanket Apache Ant task definition that instruments the byte code. All files (.class or .jar files) specified by the fileSet element in the Ant task are processed by the Modifier class and stored in the directory specified by the jblanket.dir system property. If not set, the default directory is <user_home>/<user_account>/jblanket/.

Required nested element for the instrumentation task:

    'fileset' - describes the files to be modified
    For example: see Ant

Use multiple 'fileset' elements to specify different locations of files to modify.

Optional nested element for the instrumentation task:

    'packageprefix' - describes the package prefixes to be modified in a JAR file. To instrument all classes in a JAR file, do not included this nested element.
    For example: see PackagePrefix

    'sysproperty' - describes additional system properties not set in the environment. If jblanket.dir is not set as an environment variable, include this nested element to set it. For example: see Ant

Required attribute for the instrumentation task:

    'testgrammar' - grammar describing the names of JUnit test classes
    For example: testgrammar="Test*.class"

Optional attributes for the instrumentation task:

    'enable' - describes if the byte code should be modified. Valid values include "true", "on", "yes" to modify byte code or "false", "off", or "no" to not modify byte code.
    For example: enable="true"

    'verbose' - describes if additional output should be sent to standard out. Valid values include "true", "on", "yes" for additional output or "false", "off", or "no" for no additional output.
    For example: verbose="false"

    'excludeonelinemethods' - describes if methods with one line of code should be excluded from the coverage measurement. Values include "true", "on", "yes" to exclude one-line methods or "false", "off", or "no" to include them.
    For example: excludeonelinemethods="false"

    'excludeconstructors' - describes if constructors should be excluded from the coverage measurement. Values include "true", "on", "yes" to exclude constructors or "false", "off", or "no" to include them.
    For example: excludeconstructors="false"

    'totalfile' - name of XML file to contain all methods included in the coverage measurement
    For example: totalfile="totalMethods.xml"

    'untestablefile' - name of XML file to contain all abstract or native methods
    For example: untestablefile="untestableMethods.xml"

    'excludedfile' - name of XML file to contain all methods excluded from the coverage measurement by either the fileset or packageprefix nested element
    For example: excludedfile="excludedMethods.xml"

    'onelinefile' - name of XML file to contain all one-line methods
    For example: onelinefile="oneLineMethods.xml"

    'constructionfile' - name of XML file to contain all constructors
    For example: constructorfile="constructorMethods.xml"

If any of the optional attributes are not specified, their default values specified in the examples are used. For example, to exclude methods with one line of source code from the coverage measurement, specify the 'excludeonelinemethods' attribute with a 'true' value. When not specified, one-line methods will be included in the coverage measurement.

Use this class to execute JBlanket with Ant. One example of the 'jblanket' Ant target is:

 <taskdef name="jblanket" classname="csdl.jblanket.ant.JBlanketModifierTask"/>
 <jblanket testgrammar="Test*.class"
 excludeonelinemethods="true"
 totalfile="myTotalMethods.xml"
 untestablefile="myUntestableMethods.xml">
 <fileset dir="${basedir}">
 <include name="**/stackmvc/**/*.class"/>
 </fileset>
 <fileset dir="${lib.dir}">
 <include name="stack.jar"/>
 </fileset>
 </jblanket>
 
From the example, one-line methods are excluded and constructors are included. The total methods will be stored in 'myTotalMethods.xml' and untestable methods are stored in 'myUntestableMethods.xml'. The default file names for excluded methods and one-line methods are used. No additional output will be sent to standard out. The files to be modified are the .class files found in the subdirectories beginning with 'stackmvc' and the 'stack.jar' file in ${lib.dir}.

Another example is:

 <jblanket testgrammar="*Test.class"
 verbose="true">
 <fileset dir="${src.dir}">
 <include name="**/foo/*.class"/>
 </fileset>
 </jblanket>
 
where the total methods, untestable methods, and excluded methods are stored in the default files. One-line methods and constructors are included in coverage. Additional output will be sent to standard out. The files to be modified are the .class files found in the subdirectories beginning with 'foo'.

NOTE: For JBlanket to collect data, all files MUST be compiled with debug turned "on".
author:
   Joy M. Agustin
version:
   $Id: JBlanketModifierTask.java,v 1.2 2005/02/19 05:55:19 timshadel Exp $id



Field Summary
protected  StringexcludedFile
    
protected  StringuntestableFile
    

Constructor Summary
public  JBlanketModifierTask()
     Constructs a new JBlanketModifierTask object.

Method Summary
public  voidaddFileSet(FileSet fileSet)
     Adds a set of files specified by a nested fileset element.
public  voidaddPackagePrefix(PackagePrefix packagePrefix)
     Adds a PackagePrefix specified by a nested packageprefix element.
public  voidexecute()
     Executes the byte code instrumentation Ant taskdef.
public  voidsetExcludedfile(String excludedFile)
     Sets the name of the XML file for excluded methods.
public  voidsetTestgrammar(String testGrammar)
     Sets the grammar describing the names of test classes.
public  voidsetUntestablefile(String untestableFile)
     Sets the name of the XML file for untestable methods.

Field Detail
excludedFile
protected String excludedFile(Code)
Name of file for excluded methods, i.e., methods in classes user specifically excludes



untestableFile
protected String untestableFile(Code)
Name of file for untestable methods, i.e., abstract and native methods




Constructor Detail
JBlanketModifierTask
public JBlanketModifierTask()(Code)
Constructs a new JBlanketModifierTask object.




Method Detail
addFileSet
public void addFileSet(FileSet fileSet)(Code)
Adds a set of files specified by a nested fileset element.
Parameters:
  fileSet - set of files to be modified.



addPackagePrefix
public void addPackagePrefix(PackagePrefix packagePrefix)(Code)
Adds a PackagePrefix specified by a nested packageprefix element.
Parameters:
  packagePrefix - the PackagePrefix to include in coverage.



execute
public void execute()(Code)
Executes the byte code instrumentation Ant taskdef.



setExcludedfile
public void setExcludedfile(String excludedFile)(Code)
Sets the name of the XML file for excluded methods. I.e., methods found in classes that are excluded by either the fileset or the packageprefix.
Parameters:
  excludedFile - the excluded file name.



setTestgrammar
public void setTestgrammar(String testGrammar)(Code)
Sets the grammar describing the names of test classes.

For example, testGrammar="Test*.class" means that the names of all test class begin with "Test".
Parameters:
  testGrammar - the new grammar.




setUntestablefile
public void setUntestablefile(String untestableFile)(Code)
Sets the name of the XML file for untestable methods. I.e., abstract and native methods.
Parameters:
  untestableFile - the untestable file name.



Fields inherited from csdl.jblanket.ant.JBlanketTask
protected String constructorFile(Code)(Java Doc)
protected boolean enable(Code)(Java Doc)
protected boolean excludeConstructors(Code)(Java Doc)
protected boolean excludeIndividualMethods(Code)(Java Doc)
protected boolean excludeOneLineMethods(Code)(Java Doc)
protected String excludedIndividualFile(Code)(Java Doc)
protected String oneLineFile(Code)(Java Doc)
protected String totalFile(Code)(Java Doc)
protected boolean verbose(Code)(Java Doc)

Methods inherited from csdl.jblanket.ant.JBlanketTask
public void addConfiguredSysproperty(Environment.Variable systemProperty)(Code)(Java Doc)
public void setConstructorfile(String constructorFile)(Code)(Java Doc)
public void setEnable(String enable)(Code)(Java Doc)
public void setExcludeconstructors(String excludeConstructors)(Code)(Java Doc)
public void setExcludedindividualfile(String excludedIndividualFile)(Code)(Java Doc)
public void setExcludeindividualmethods(String excludeIndividualMethods)(Code)(Java Doc)
public void setExcludeonelinemethods(String excludeOneLineMethods)(Code)(Java Doc)
public void setFork(String value)(Code)(Java Doc)
public void setOnelinefile(String oneLineFile)(Code)(Java Doc)
public void setPrintsummary(String value)(Code)(Java Doc)
public void setTotalfile(String totalFile)(Code)(Java Doc)
public void setVerbose(String value)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.