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


org.netbeans.modules.cnd.test.BaseTestCase
   org.netbeans.modules.cnd.test.base.BaseDocumentUnitTestCase

All known Subclasses:   org.netbeans.modules.cnd.editor.cplusplus.CCBaseDocumentUnitTestCase,  org.netbeans.modules.cnd.editor.cplusplus.CCFormatterBaseUnitTestCase,
BaseDocumentUnitTestCase
abstract public class BaseDocumentUnitTestCase extends BaseTestCase (Code)
Vladimir Voskresensky copied this class to prevent dependency on editor tests Support for creation of unit tests working with document.
author:
   Miloslav Metelka

Inner Class :class CaretImpl implements Caret,DocumentListener


Constructor Summary
public  BaseDocumentUnitTestCase(String testMethodName)
    

Method Summary
final protected  voidappendDebugChar(StringBuffer sb, char ch)
    
final protected  voidappendDebugText(StringBuffer sb, String text)
    
protected  voidassertDocumentText(String msg, String expectedText)
     Assert whether the document available through BaseDocumentUnitTestCase.getDocument() has a content equal to expectedText.
protected  voidassertDocumentTextAndCaret(String msg, String expectedTextAndCaretPipe)
     Assert whether the document available through BaseDocumentUnitTestCase.getDocument() has a content equal to expectedText and whether the caret position BaseDocumentUnitTestCase.getCaretOffset() indicated by "|" in the passed text is at the right place.
abstract protected  EditorKitcreateEditorKit()
     Create editor kit instance to be returned by BaseDocumentUnitTestCase.getEditorKit() .
final protected  StringdebugText(String text)
    
final protected synchronized  CaretgetCaret()
     Return the caret instance that can be used for testing.
final protected  intgetCaretOffset()
     Get the offset of where the caret resides in the document.
protected synchronized  BaseDocumentgetDocument()
     Get the document that the test should work with.
protected  StringgetDocumentText()
     Return text of the whole document.
final public  EditorKitgetEditorKit()
     Get the kit that should be used when creating the BaseDocument instance.
final protected  intgetLoadCaretOffset()
     Return caret offset based on the scanning of the text passed to BaseDocumentUnitTestCase.setLoadDocumentText(String) .
final protected  StringgetLoadDocumentText()
     Get the text that the document obtained by BaseDocumentUnitTestCase.getDocument() would be loaded with.
protected  voidsetLoadDocumentText(String loadDocumentText)
     Set the text that the document obtained by BaseDocumentUnitTestCase.getDocument() would be loaded with.


Constructor Detail
BaseDocumentUnitTestCase
public BaseDocumentUnitTestCase(String testMethodName)(Code)




Method Detail
appendDebugChar
final protected void appendDebugChar(StringBuffer sb, char ch)(Code)



appendDebugText
final protected void appendDebugText(StringBuffer sb, String text)(Code)



assertDocumentText
protected void assertDocumentText(String msg, String expectedText)(Code)
Assert whether the document available through BaseDocumentUnitTestCase.getDocument() has a content equal to expectedText.



assertDocumentTextAndCaret
protected void assertDocumentTextAndCaret(String msg, String expectedTextAndCaretPipe)(Code)
Assert whether the document available through BaseDocumentUnitTestCase.getDocument() has a content equal to expectedText and whether the caret position BaseDocumentUnitTestCase.getCaretOffset() indicated by "|" in the passed text is at the right place.



createEditorKit
abstract protected EditorKit createEditorKit()(Code)
Create editor kit instance to be returned by BaseDocumentUnitTestCase.getEditorKit() .
The returned editor kit should return BaseDocument instances from its javax.swing.text.EditorKit.createDefaultDocument() .



debugText
final protected String debugText(String text)(Code)



getCaret
final protected synchronized Caret getCaret()(Code)
Return the caret instance that can be used for testing.
The caret listens on document changes and its initial position is set to BaseDocumentUnitTestCase.getLoadCaretOffset() . caret instance.



getCaretOffset
final protected int getCaretOffset()(Code)
Get the offset of where the caret resides in the document.



getDocument
protected synchronized BaseDocument getDocument()(Code)
Get the document that the test should work with.
If the document does not exist yet it will be created and loaded with the text from BaseDocumentUnitTestCase.getLoadDocumentText() .



getDocumentText
protected String getDocumentText()(Code)
Return text of the whole document.
The document is retrieved by BaseDocumentUnitTestCase.getDocument() .



getEditorKit
final public EditorKit getEditorKit()(Code)
Get the kit that should be used when creating the BaseDocument instance.
The editor kit instance is created in BaseDocumentUnitTestCase.createEditorKit() . editor kit instance.



getLoadCaretOffset
final protected int getLoadCaretOffset()(Code)
Return caret offset based on the scanning of the text passed to BaseDocumentUnitTestCase.setLoadDocumentText(String) . valid caret offset or -1 if no caret offset was determinedin the document text.



getLoadDocumentText
final protected String getLoadDocumentText()(Code)
Get the text that the document obtained by BaseDocumentUnitTestCase.getDocument() would be loaded with. text to be loaded into the document or null if nothingshould be loaded.



setLoadDocumentText
protected void setLoadDocumentText(String loadDocumentText)(Code)
Set the text that the document obtained by BaseDocumentUnitTestCase.getDocument() would be loaded with.

The text is parsed and the first occurrence of "|" sets the caret offset which is available by BaseDocumentUnitTestCase.getLoadCaretOffset() .
The "|" itself is removed from the document text and subsequent calls to BaseDocumentUnitTestCase.getLoadDocumentText() do not contain it.




Methods inherited from org.netbeans.modules.cnd.test.BaseTestCase
public void compareReferenceFiles(String testFilename, String goldenFilename)(Code)(Java Doc)
public void compareReferenceFiles()(Code)(Java Doc)
protected File getDataFile(String filename)(Code)(Java Doc)
public File getGoldenFile(String filename)(Code)(Java Doc)
protected Class getTestCaseDataClass()(Code)(Java Doc)
protected File getTestCaseDataDir()(Code)(Java Doc)
protected Class getTestCaseGoldenDataClass()(Code)(Java Doc)
protected void setUp() throws Exception(Code)(Java Doc)
protected void tearDown() throws Exception(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.