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


org.netbeans.modules.web.core.test.TestUtil

TestUtil
final public class TestUtil extends ProxyLookup (Code)
Help set up org.netbeans.api.project.*Test.
author:
   Jesse Glick


Field Summary
public static  ObjectBROKEN_PROJECT_LOAD_LOCK
     If set to something non-null, loading a broken project will wait for notification on this monitor before throwing an exception.

Constructor Summary
public  TestUtil()
    

Method Summary
public static  FileObjectcreateFileFromContent(URL content, FileObject parent, String path)
     Open a URL of content (for example from Class.getResource ) and copy it to a named file.
public static  voiddeleteRec(File f)
     Delete a file and all subfiles.
public static  voidgc()
     Try to force a GC.
public static  EditablePropertiesloadProjectProperties(FileObject projectDir)
    
public static  FileObjectmakeScratchDir(NbTestCase test)
     Create a scratch directory for tests.
public static  voidmodify(Project p)
     Mark a test project as modified.
public static  voidnotifyDeleted(Project p)
     Mark a test project as modified.
public static  intprojectLoadCount(FileObject dir)
     Check how many times ProjectFactory.loadProject has been called (with any outcome) on a given project directory.
public static  intprojectSaveCount(Project p)
     Get the number of times a test project was successfully saved with no error.
public static  StringregisterSunAppServer(NbTestCase test)
     Register Sun Application Server in the "IDE" to be used by unit test. This method creates dummy userdir as well as dummy NetBeans home in test's working directory.
public static  StringregisterSunAppServer(NbTestCase test, Object[] additionalLookupItems)
    
public static  voidsetLookup(Lookup l)
     Set the global default lookup. Caution: if you don't include Lookups.metaInfServices, you may have trouble, e.g.
public static  voidsetLookup(Object[] instances)
     Set the global default lookup with some fixed instances including META-INF/services/*.
public static  voidsetProjectSaveWillFail(Project p, Throwable error)
     Mark a test project to fail with a given error when it is next saved.
public static  voidstoreProjectProperties(FileObject projectDir, EditableProperties props)
    
public static  ProjectFactorytestProjectFactory()
     Create a testing project factory which recognizes directories containing a subdirectory called "testproject".

Field Detail
BROKEN_PROJECT_LOAD_LOCK
public static Object BROKEN_PROJECT_LOAD_LOCK(Code)
If set to something non-null, loading a broken project will wait for notification on this monitor before throwing an exception.
See Also:   ProjectManagerTest.testLoadExceptionWithConcurrentLoad




Constructor Detail
TestUtil
public TestUtil()(Code)
Do not call directly




Method Detail
createFileFromContent
public static FileObject createFileFromContent(URL content, FileObject parent, String path) throws IOException(Code)
Open a URL of content (for example from Class.getResource ) and copy it to a named file. The new file can be given as a parent directory plus a relative (slash-separated) path. The file may not already exist, but intermediate directories may or may not. If the content URL is null, the file is just created, no more; if it already existed it is touched (timestamp updated) and its contents are cleared. the file object



deleteRec
public static void deleteRec(File f) throws IOException(Code)
Delete a file and all subfiles.



gc
public static void gc()(Code)
Try to force a GC.



loadProjectProperties
public static EditableProperties loadProjectProperties(FileObject projectDir) throws IOException(Code)



makeScratchDir
public static FileObject makeScratchDir(NbTestCase test) throws IOException(Code)
Create a scratch directory for tests. Will be in /tmp or whatever, and will be empty. If you just need a java.io.File use clearWorkDir + getWorkDir.



modify
public static void modify(Project p)(Code)
Mark a test project as modified.
Parameters:
  p - a test project



notifyDeleted
public static void notifyDeleted(Project p)(Code)
Mark a test project as modified.
Parameters:
  p - a test project



projectLoadCount
public static int projectLoadCount(FileObject dir)(Code)
Check how many times ProjectFactory.loadProject has been called (with any outcome) on a given project directory.



projectSaveCount
public static int projectSaveCount(Project p)(Code)
Get the number of times a test project was successfully saved with no error.
Parameters:
  p - a test project the save count



registerSunAppServer
public static String registerSunAppServer(NbTestCase test) throws Exception(Code)
Register Sun Application Server in the "IDE" to be used by unit test. This method creates dummy userdir as well as dummy NetBeans home in test's working directory. Both properties - netbeans.home and netbeans.user - will be set by this method if they are not already defined.
Parameters:
  test - a test which requires SunAppServer id of registered server



registerSunAppServer
public static String registerSunAppServer(NbTestCase test, Object[] additionalLookupItems) throws Exception(Code)



setLookup
public static void setLookup(Lookup l)(Code)
Set the global default lookup. Caution: if you don't include Lookups.metaInfServices, you may have trouble, e.g. TestUtil.makeScratchDir will not work.



setLookup
public static void setLookup(Object[] instances)(Code)
Set the global default lookup with some fixed instances including META-INF/services/*.



setProjectSaveWillFail
public static void setProjectSaveWillFail(Project p, Throwable error)(Code)
Mark a test project to fail with a given error when it is next saved. The error only applies to the next save, not subsequent ones.
Parameters:
  p - a test project
Parameters:
  error - an error to throw (IOException or Error or RuntimeException),or null if it should succeed



storeProjectProperties
public static void storeProjectProperties(FileObject projectDir, EditableProperties props) throws IOException(Code)



testProjectFactory
public static ProjectFactory testProjectFactory()(Code)
Create a testing project factory which recognizes directories containing a subdirectory called "testproject". If that subdirectory contains a file named "broken" then loading the project will fail with an IOException.



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