Java Doc for AbstractTestGenerator.java in  » IDE-Netbeans » junit » org » netbeans » modules » junit » 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 » IDE Netbeans » junit » org.netbeans.modules.junit 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.modules.junit.AbstractTestGenerator

All known Subclasses:   org.netbeans.modules.junit.JUnit3TestGenerator,  org.netbeans.modules.junit.JUnit4TestGenerator,
AbstractTestGenerator
abstract class AbstractTestGenerator implements CancellableTask<WorkingCopy>(Code)
A base class for generators of JUnit test classes and test methods.
author:
   Marian Petras


Field Summary
final protected  TestGeneratorSetupsetup
    

Constructor Summary
protected  AbstractTestGenerator(TestGeneratorSetup setup)
     Used when creating a new empty test class.
protected  AbstractTestGenerator(TestGeneratorSetup setup, List<ElementHandle<TypeElement>> srcTopClassHandles, List<String> suiteMembers, boolean isNewTestClass)
     Used when creating a test class for a given source class or when creating a test suite.

Method Summary
protected static  EnumSet<Modifier>accessModifiers()
     Returns EnumSet of all access modifiers.
public  voidcancel()
     Stops this creator - cancels creation of a test class.
abstract protected  ClassTreecomposeNewTestClass(WorkingCopy workingCopy, String name, List<? extends Tree> members)
     Generates a new test class containing the given list of test methods.
abstract protected  MethodTreecomposeNewTestMethod(String testMethodName, BlockTree testMethodBody, List<ExpressionTree> throwsList, WorkingCopy workingCopy)
    
static  Set<Modifier>createModifierSet(Modifier... modifiers)
     Creates a Set of Modifier s from the given list of modifiers.
protected  ModifiersTreecreateModifiersTree(String annotationClassName, Set<Modifier> modifiers, WorkingCopy workingCopy)
    
abstract protected  ClassTreefinishSuiteClass(ClassTree tstClass, TreePath tstClassTreePath, List<Tree> tstMembers, List<String> suiteMembers, boolean membersChanged, ClassMap classMap, WorkingCopy workingCopy)
    
abstract protected  List<? extends Tree>generateInitMembers(WorkingCopy workingCopy)
    
abstract protected  ClassTreegenerateMissingInitMembers(ClassTree tstClass, TreePath tstClassTreePath, WorkingCopy workingCopy)
     Generates missing set-up and tear-down methods in the given test class.
abstract protected  booleangenerateMissingInitMembers(List<Tree> tstMembers, ClassMap clsMap, WorkingCopy workingCopy)
     Generates missing set-up and tear-down methods and adds them to the list of class members.
abstract protected  voidgenerateMissingPostInitMethods(TreePath tstClassTreePath, List<Tree> tstMembers, ClassMap clsMap, WorkingCopy workingCopy)
    
protected  ClassTreegenerateMissingTestMethods(TypeElement srcClass, List<ExecutableElement> srcMethods, ClassTree tstClass, TreePath tstClassTreePath, boolean generateMissingInitMembers, WorkingCopy workingCopy)
    
protected  MethodTreegenerateTestMethod(TypeElement srcClass, ExecutableElement srcMethod, String testMethodName, boolean useNoArgConstructor, WorkingCopy workingCopy)
     Generates a test methods for the given source method.
protected  BlockTreegenerateTestMethodBody(TypeElement srcClass, ExecutableElement srcMethod, boolean useNoArgConstructor, WorkingCopy workingCopy)
     Generates a default body of a test method.
protected  ExpressionTreegetClassIdentifierTree(String className, WorkingCopy workingCopy)
    
protected static  TypeElementgetElemForClassName(String className, Elements elements)
    
protected  intgetPlaceForFirstInitMethod(ClassMap clsMap)
     Finds position for the first init method.
 List<String>getProcessedClassNames()
    
protected  booleanhasAccessibleNoArgConstructor(TypeElement srcClass)
    
protected static  EnumSet<Modifier>noModifiers()
     Returns an empty EnumSet of Modifier s.
public  voidrun(WorkingCopy workingCopy)
    

Field Detail
setup
final protected TestGeneratorSetup setup(Code)




Constructor Detail
AbstractTestGenerator
protected AbstractTestGenerator(TestGeneratorSetup setup)(Code)
Used when creating a new empty test class.



AbstractTestGenerator
protected AbstractTestGenerator(TestGeneratorSetup setup, List<ElementHandle<TypeElement>> srcTopClassHandles, List<String> suiteMembers, boolean isNewTestClass)(Code)
Used when creating a test class for a given source class or when creating a test suite.




Method Detail
accessModifiers
protected static EnumSet<Modifier> accessModifiers()(Code)
Returns EnumSet of all access modifiers. EnumSet of all access modifiers;it is guaranteed that the returned set always containsthe same set of Modifier s, but the returnedinstance may not always be the same



cancel
public void cancel()(Code)
Stops this creator - cancels creation of a test class.



composeNewTestClass
abstract protected ClassTree composeNewTestClass(WorkingCopy workingCopy, String name, List<? extends Tree> members)(Code)
Generates a new test class containing the given list of test methods.
Parameters:
  name - desired name of the test class
Parameters:
  members - desired content of the test class generated test class



composeNewTestMethod
abstract protected MethodTree composeNewTestMethod(String testMethodName, BlockTree testMethodBody, List<ExpressionTree> throwsList, WorkingCopy workingCopy)(Code)



createModifierSet
static Set<Modifier> createModifierSet(Modifier... modifiers)(Code)
Creates a Set of Modifier s from the given list of modifiers.
Parameters:
  modifiers - modifiers that should be contained in the set set containing exactly the given modifiers



createModifiersTree
protected ModifiersTree createModifiersTree(String annotationClassName, Set<Modifier> modifiers, WorkingCopy workingCopy)(Code)



finishSuiteClass
abstract protected ClassTree finishSuiteClass(ClassTree tstClass, TreePath tstClassTreePath, List<Tree> tstMembers, List<String> suiteMembers, boolean membersChanged, ClassMap classMap, WorkingCopy workingCopy)(Code)



generateInitMembers
abstract protected List<? extends Tree> generateInitMembers(WorkingCopy workingCopy)(Code)



generateMissingInitMembers
abstract protected ClassTree generateMissingInitMembers(ClassTree tstClass, TreePath tstClassTreePath, WorkingCopy workingCopy)(Code)
Generates missing set-up and tear-down methods in the given test class.
Parameters:
  tstClass - test class in which the methods should be generated a class tree with the missing methods added;or the passed class tree if no method was missing



generateMissingInitMembers
abstract protected boolean generateMissingInitMembers(List<Tree> tstMembers, ClassMap clsMap, WorkingCopy workingCopy)(Code)
Generates missing set-up and tear-down methods and adds them to the list of class members.
Parameters:
  tstMembers - current list of test class members- generated members will be added to it
Parameters:
  clsMap - index of the test class contents- it will be updated if some members are addedto the list true if the list of members was modified, false otherwise



generateMissingPostInitMethods
abstract protected void generateMissingPostInitMethods(TreePath tstClassTreePath, List<Tree> tstMembers, ClassMap clsMap, WorkingCopy workingCopy)(Code)



generateMissingTestMethods
protected ClassTree generateMissingTestMethods(TypeElement srcClass, List<ExecutableElement> srcMethods, ClassTree tstClass, TreePath tstClassTreePath, boolean generateMissingInitMembers, WorkingCopy workingCopy)(Code)

Parameters:
  srcMethods - methods to create/update tests for



generateTestMethod
protected MethodTree generateTestMethod(TypeElement srcClass, ExecutableElement srcMethod, String testMethodName, boolean useNoArgConstructor, WorkingCopy workingCopy)(Code)
Generates a test methods for the given source method.
Parameters:
  srcClass - source class - parent of the source method
Parameters:
  srcMethod - source method for which the test method should becreated
Parameters:
  useNoArgConstrutor - whether a no-argument constructor should beused in the default test method body;it should not be true unlessthe source class contains an accessibleno-argument constructor the generated test method



generateTestMethodBody
protected BlockTree generateTestMethodBody(TypeElement srcClass, ExecutableElement srcMethod, boolean useNoArgConstructor, WorkingCopy workingCopy)(Code)
Generates a default body of a test method.
Parameters:
  srcClass - class - parent of the tested source method
Parameters:
  srcMethod - source method which should be tested by the test
Parameters:
  useNoArgConstrutor - whether a no-argument constructor should beused in the body;it should not be true unlessthe source class contains an accessibleno-argument constructor



getClassIdentifierTree
protected ExpressionTree getClassIdentifierTree(String className, WorkingCopy workingCopy)(Code)



getElemForClassName
protected static TypeElement getElemForClassName(String className, Elements elements)(Code)



getPlaceForFirstInitMethod
protected int getPlaceForFirstInitMethod(ClassMap clsMap)(Code)
Finds position for the first init method.
Parameters:
  clsMap - index of the test class contents index where the first init method should be put,or -1 if the method should be put to the endof the class



getProcessedClassNames
List<String> getProcessedClassNames()(Code)



hasAccessibleNoArgConstructor
protected boolean hasAccessibleNoArgConstructor(TypeElement srcClass)(Code)



noModifiers
protected static EnumSet<Modifier> noModifiers()(Code)
Returns an empty EnumSet of Modifier s. empty EnumSet of all Modifier s;it is guaranteed that the returned set is always emptybut the returned instance may not always be the same



run
public void run(WorkingCopy workingCopy) throws IOException(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.