Java Doc for TestUtil.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.TestUtil

TestUtil
public class TestUtil (Code)

author:
   rmatous
author:
   Marian Petras
version:
   1.1




Method Summary
static  booleanareAnnotationsSupported(FileObject file)
     Checks whether Java annotations are applicable in the given file.
static  booleanareAnnotationsSupported(String sourceLevel)
     Determines whether Java annotations are supported by the given Java source level.
Parameters:
  sourceLevel - Java source level (e.g.
public static  StringconvertClass2TestName(String classFileName)
     Converts given class filename to test filename, e.g. "org/netbeans/Foo" -> "org/netbeans/{test-prefix}Foo{test-suffix}"
Parameters:
  classFileName - class filename in form of"org/netbeans/Foo",i.e.
public static  StringconvertPackage2SuiteName(String packageFileName)
     Converts given package filename to test suite filename, e.g.
public static  StringcreateNewName(int i, Set usedNames)
    
static  StringfileToClassName(String fileName)
     Converts filename to the fully qualified name of the main class residing in the file.
For example: test/myapp/App.java --> test.myapp.App
Parameters:
  filename - corresponding package name.
public static  ClassTreefindMainClass(CompilationInfo compInfo)
     Finds a main class.
Parameters:
  compInfo - defines scope in which the class is to be found
Parameters:
  className - name of the class to be found the found class; or null if the class was notfound (e.g.
public static  SourceGroupfindSourceGroupOwner(FileObject file)
     Finds a SourceGroup the given file belongs to.
public static  SourceGroupfindSourceGroupOwner(Project project, FileObject file)
     Finds a SourceGroup the given file belongs to. Only Java SourceGroups are taken into account.
public static  Collection<SourceGroup>findSourceGroupOwners(Project project, String className)
     Finds all SourceGroups of the given project containing a class of the given name.
public static  Map<FileObject, SourceGroup>getFileObject2SourceGroupMap(Project project)
     Creates a map from folders to SourceGroups of a given project.
public static  FileObjectgetFileObjectFromNode(Node node)
    
public static  List<String>getJavaFileNames(FileObject packageFolder, ClassPath classPath)
     Returns full names of all primary Java classes withing the specified folder (non-recursive).
static  StringgetPackageName(String fullName)
    
public static  JUnitPlugingetPluginForProject(Project project)
    
public static  Map<CreateTestParam, Object>getSettingsMap(boolean multipleFiles)
     Creates a map of parameters according to the current JUnit module settings.
Note: The map may not contain all the necessary settings, i.g.
static  StringgetSimpleName(String fullName)
     Gets the last part of a fully qualified Java name.
static  StringgetSourceLevel(FileObject file)
     Determines source level of the given file.
Parameters:
  file - file whose source level is to be determined string denoting source level of the given file(e.g.
public static  StringgetTestClassFullName(String sourceClassName, String packageName)
    
public static  StringgetTestClassName(String sourceClassName)
    
public static  Object[]getTestTargets(FileObject fileObject)
     Finds SourceGroups where a test for the given class can be created (so that it can be found by the projects infrastructure when a test for the class is to be opened or run).
static  booleanisClassException(CompilationInfo compilationInfo, TypeElement classElem)
    
static  booleanisClassImplementingTestInterface(CompilationInfo compilationInfo, TypeElement classElem)
    
static  booleanisClassTest(CompilationInfo compilationInfo, TypeElement classElem)
    
static  booleanisJavaFile(FileObject fileObj)
    
public static  booleanisValidPackageName(String str)
    
public static  voidnotifyUser(String msg)
     Show error message box.
public static  voidnotifyUser(String msg, int messageType)
     Show message box of the specified severity.
public static  T[]skipNulls(T[] objs, T[] type)
     Creates a copy of the given array, except that null objects are omitted. The length of the returned array is (l - n), where l is length of the passed array and n is number of null elements of the array.



Method Detail
areAnnotationsSupported
static boolean areAnnotationsSupported(FileObject file)(Code)
Checks whether Java annotations are applicable in the given file. The result is true if source level of the given is known and the source level is 1.5 or higher.
Parameters:
  file - file to be checked true if the given file is known to be based onJDK 1.5 or higher; false otherwise
See Also:   TestUtil.getSourceLevel
See Also:   TestUtil.areAnnotationsSupported(String)



areAnnotationsSupported
static boolean areAnnotationsSupported(String sourceLevel)(Code)
Determines whether Java annotations are supported by the given Java source level.
Parameters:
  sourceLevel - Java source level (e.g. "1.5"),or null if the source level is unknown true if the source level is known and Java annotationsare supported in the source level, false otherwise
See Also:   TestUtil.areAnnotationsSupported(FileObject)



convertClass2TestName
public static String convertClass2TestName(String classFileName)(Code)
Converts given class filename to test filename, e.g. "org/netbeans/Foo" -> "org/netbeans/{test-prefix}Foo{test-suffix}"
Parameters:
  classFileName - class filename in form of"org/netbeans/Foo",i.e. without extension, no inner class



convertPackage2SuiteName
public static String convertPackage2SuiteName(String packageFileName)(Code)
Converts given package filename to test suite filename, e.g. "org/netbeans/foo" -> "org/netbeans/foo/{suite-prefix}Foo{suite-suffix}"
Parameters:
  packageFileName - package filename in form of "org/netbeans/foo"



createNewName
public static String createNewName(int i, Set usedNames)(Code)



fileToClassName
static String fileToClassName(String fileName)(Code)
Converts filename to the fully qualified name of the main class residing in the file.
For example: test/myapp/App.java --> test.myapp.App
Parameters:
  filename - corresponding package name. Null if the input is notwell formed.



findMainClass
public static ClassTree findMainClass(CompilationInfo compInfo)(Code)
Finds a main class.
Parameters:
  compInfo - defines scope in which the class is to be found
Parameters:
  className - name of the class to be found the found class; or null if the class was notfound (e.g. because of a broken source file)



findSourceGroupOwner
public static SourceGroup findSourceGroupOwner(FileObject file)(Code)
Finds a SourceGroup the given file belongs to. Only Java SourceGroups are taken into account.
Parameters:
  file - FileObject whose owningSourceGroup to be found Java SourceGroup containing the givenfile; or null if no suchSourceGroup was found
author:
   Marian Petras



findSourceGroupOwner
public static SourceGroup findSourceGroupOwner(Project project, FileObject file)(Code)
Finds a SourceGroup the given file belongs to. Only Java SourceGroups are taken into account.
Parameters:
  project - the Project the file belongs to
Parameters:
  file - FileObject whose owningSourceGroup to be found Java SourceGroup containing the givenfile; or null if no suchSourceGroup was found



findSourceGroupOwners
public static Collection<SourceGroup> findSourceGroupOwners(Project project, String className)(Code)
Finds all SourceGroups of the given project containing a class of the given name.
Parameters:
  project - project to be searched for matching classes
Parameters:
  className - class name pattern unmodifiable collection of SourceGroupswhich contain files corresponding to the given name(may be empty but not null)
author:
   Marian Petras



getFileObject2SourceGroupMap
public static Map<FileObject, SourceGroup> getFileObject2SourceGroupMap(Project project)(Code)
Creates a map from folders to SourceGroups of a given project. The map allows to ascertian for a given folder which SourceGroup it is a root folder of.
Parameters:
  project - project whose SourceGroups should be in thereturned map map from containing all SourceGroups of a givenproject, having their root folders as keys
author:
   Marian Petras



getFileObjectFromNode
public static FileObject getFileObjectFromNode(Node node)(Code)



getJavaFileNames
public static List<String> getJavaFileNames(FileObject packageFolder, ClassPath classPath)(Code)
Returns full names of all primary Java classes withing the specified folder (non-recursive).
Parameters:
  packageFolder - folder to search
Parameters:
  classPath - classpath to be used for the search list of full names of all primary Java classeswithin the specified package



getPackageName
static String getPackageName(String fullName)(Code)



getPluginForProject
public static JUnitPlugin getPluginForProject(Project project)(Code)



getSettingsMap
public static Map<CreateTestParam, Object> getSettingsMap(boolean multipleFiles)(Code)
Creates a map of parameters according to the current JUnit module settings.
Note: The map may not contain all the necessary settings, i.g. name of a test class is missing.
Parameters:
  multipleFiles - if true , the map should containalso settings need for creation of multipletests map of settings to be used by aorg.netbeans.modules.junit.plugin JUnitPlugin
See Also:   org.netbeans.modules.junit.plugin.JUnitPlugin



getSimpleName
static String getSimpleName(String fullName)(Code)
Gets the last part of a fully qualified Java name.



getSourceLevel
static String getSourceLevel(FileObject file)(Code)
Determines source level of the given file.
Parameters:
  file - file whose source level is to be determined string denoting source level of the given file(e.g. "1.5")or null if the source level could not be determined



getTestClassFullName
public static String getTestClassFullName(String sourceClassName, String packageName)(Code)



getTestClassName
public static String getTestClassName(String sourceClassName)(Code)



getTestTargets
public static Object[] getTestTargets(FileObject fileObject)(Code)
Finds SourceGroups where a test for the given class can be created (so that it can be found by the projects infrastructure when a test for the class is to be opened or run).
Parameters:
  fileObject - FileObject to find targetSourceGroup(s) for an array of objects - each of them can be eithera SourceGroup for a possible target folderor simply a FileObject representing a possibletarget folder (if SourceGroup) for the folderwas not found);the returned array may be empty but not null
author:
   Marian Petras



isClassException
static boolean isClassException(CompilationInfo compilationInfo, TypeElement classElem)(Code)



isClassImplementingTestInterface
static boolean isClassImplementingTestInterface(CompilationInfo compilationInfo, TypeElement classElem)(Code)



isClassTest
static boolean isClassTest(CompilationInfo compilationInfo, TypeElement classElem)(Code)



isJavaFile
static boolean isJavaFile(FileObject fileObj)(Code)



isValidPackageName
public static boolean isValidPackageName(String str)(Code)



notifyUser
public static void notifyUser(String msg)(Code)
Show error message box.



notifyUser
public static void notifyUser(String msg, int messageType)(Code)
Show message box of the specified severity.



skipNulls
public static T[] skipNulls(T[] objs, T[] type)(Code)
Creates a copy of the given array, except that null objects are omitted. The length of the returned array is (l - n), where l is length of the passed array and n is number of null elements of the array. Order of non-null elements is kept in the returned array. The returned array is always a new array, even if the passed array does not contain any null elements.
Parameters:
  objs - array to copy
Parameters:
  type - an empty array of the correct type to be returned array containing the same objects as the passed array, in thesame order, just with null elements missing
author:
   Marian Petras



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.