Java Doc for GlobalModelTestCase.java in  » IDE » DrJava » edu » rice » cs » drjava » model » 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 » DrJava » edu.rice.cs.drjava.model 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


edu.rice.cs.drjava.model.MultiThreadedTestCase
   edu.rice.cs.drjava.model.GlobalModelTestCase

All known Subclasses:   edu.rice.cs.drjava.model.GlobalModelCompileSuccessTestCase,  edu.rice.cs.drjava.model.GlobalModelJUnitTest,  edu.rice.cs.drjava.model.GlobalModelOtherTest,  edu.rice.cs.drjava.model.GlobalModelCompileTest,  edu.rice.cs.drjava.model.debug.DebugTestCase,  edu.rice.cs.drjava.model.GlobalIndentTest,  edu.rice.cs.drjava.ui.ConsoleControllerTest,  edu.rice.cs.drjava.model.SingleDisplayModelTest,  edu.rice.cs.drjava.model.GlobalModelIOTest,  edu.rice.cs.drjava.model.GlobalModelCompileErrorsTest,  edu.rice.cs.drjava.model.junit.JUnitErrorModelTest,  edu.rice.cs.drjava.model.GlobalModelCompileIOTest,
GlobalModelTestCase
abstract public class GlobalModelTestCase extends MultiThreadedTestCase (Code)
Base class for tests over the GlobalModel . This class provides a number of convenience methods for testing the GlobalModel. It also contains a model instance (reset in GlobalModelTestCase.setUp and a temporary directory that's created per test invocation (and subsequently cleaned in GlobalModelTestCase.tearDown . This reduces the burden for such file management stuff in the test cases themselves.
version:
   $Id: GlobalModelTestCase.java 4255 2007-08-28 19:17:37Z mgricken $

Inner Class :public static class OverwriteException extends RuntimeException
Inner Class :public static class OpenWarningException extends RuntimeException
Inner Class :public static class FileMovedWarningException extends RuntimeException
Inner Class :public static class WarningFileSelector implements FileOpenSelector,FileSaveSelector
Inner Class :public static class FileSelector implements FileOpenSelector,FileSaveSelector
Inner Class :public static class CancelingSelector implements FileOpenSelector,FileSaveSelector
Inner Class :public static class TestListener implements GlobalModelListener
Inner Class :public static class InteractionListener extends TestListener
Inner Class :public static class CompileShouldSucceedListener extends InteractionListener
Inner Class :public static class CompileShouldFailListener extends TestListener
Inner Class :public static class JUnitTestListener extends CompileShouldSucceedListener
Inner Class :public static class JUnitNonTestListener extends JUnitTestListener
Inner Class :public class TestGlobalModel extends DefaultGlobalModel

Field Summary
final protected static  StringBAR_TEXT
    
final protected static  StringBAZ_TEXT
    
final protected static  StringFOO_MISSING_CLOSE_TEXT
    
final protected static  StringFOO_PACKAGE_AFTER_IMPORT
    
final protected static  StringFOO_PACKAGE_AS_FIELD
    
final protected static  StringFOO_PACKAGE_AS_FIELD_2
    
final protected static  StringFOO_PACKAGE_AS_PART_OF_FIELD
    
final protected static  StringFOO_PACKAGE_INSIDE_CLASS
    
final protected static  StringFOO_TEXT
    
protected volatile  OpenDefinitionsDocument_doc
    
final protected static  Log_log
    
protected volatile  DefaultGlobalModel_model
    
protected volatile  File_tempDir
    

Constructor Summary
public  GlobalModelTestCase()
    

Method Summary
protected  voidassertCompileErrorsPresent(boolean b)
    
protected  voidassertCompileErrorsPresent(String name, boolean b)
    
protected  voidassertContents(String s, OpenDefinitionsDocument doc)
    
protected  voidassertInteractionsContains(String text)
     Asserts that the given string exists in the Interactions Document.
protected  voidassertInteractionsDoesNotContain(String text)
     Asserts that the given string does not exist in the Interactions Document.
protected  voidassertInteractionsDoesNotMatch(String regex)
     Asserts that the text in the Interactions Document does NOT match the given regex.
protected  voidassertInteractionsMatches(String regex)
     Asserts that the text in the Interactions Document matches the given regex.
protected  voidassertLength(int len, OpenDefinitionsDocument doc)
    
protected  voidassertModified(boolean b, OpenDefinitionsDocument doc)
    
protected  voidassertNumOpenDocs(int num)
    
protected  voidchangeDocumentText(String s, OpenDefinitionsDocument doc)
     Clear all old text and insert the given text.
protected  FileclassForJava(File sourceFile, String className)
     Given a .java file and a class file name, returns the corresponding .class file.
protected  FilecreateFile(String name)
    
protected synchronized  OpenDefinitionsDocumentdoCompile(String text, File file)
     Compiles a new file with the given text.
protected  voiddoCompile(OpenDefinitionsDocument doc, File file)
     Saves to the given file, and then compiles the given document.
protected  StringgetCompilerErrorString()
     Returns a string with all compiler errors.
protected  StringgetInteractionsText()
    
protected  Stringinterpret(String input)
     Puts the given input into the interactions document and then interprets it, returning the result that was put into the interactions document.
protected  voidinterpretIgnoreResult(String input)
     Appends the input string to the interactions pane and interprets it.
public  voidsetUp()
     Setup for each test case, which does the following.
protected  OpenDefinitionsDocumentsetupDocument(String text)
     Creates and returns a new document, makes sure newFile is fired, and then adds some text.
public  voidtearDown()
     Teardown for each test case, which recursively deletes the temporary directory created in setUp.
protected  FiletempDirectory()
     Create a new temporary directory in _tempDir.
protected  FiletempFile()
     Create a new temporary file in _tempDir.
protected  FiletempFile(int i)
     Create a new temporary file in _tempDir.
protected  FilewriteToNewTempFile(String text)
     Creates a new temporary file and writes the given text to it.

Field Detail
BAR_TEXT
final protected static String BAR_TEXT(Code)



BAZ_TEXT
final protected static String BAZ_TEXT(Code)



FOO_MISSING_CLOSE_TEXT
final protected static String FOO_MISSING_CLOSE_TEXT(Code)



FOO_PACKAGE_AFTER_IMPORT
final protected static String FOO_PACKAGE_AFTER_IMPORT(Code)



FOO_PACKAGE_AS_FIELD
final protected static String FOO_PACKAGE_AS_FIELD(Code)



FOO_PACKAGE_AS_FIELD_2
final protected static String FOO_PACKAGE_AS_FIELD_2(Code)



FOO_PACKAGE_AS_PART_OF_FIELD
final protected static String FOO_PACKAGE_AS_PART_OF_FIELD(Code)



FOO_PACKAGE_INSIDE_CLASS
final protected static String FOO_PACKAGE_INSIDE_CLASS(Code)



FOO_TEXT
final protected static String FOO_TEXT(Code)



_doc
protected volatile OpenDefinitionsDocument _doc(Code)



_log
final protected static Log _log(Code)



_model
protected volatile DefaultGlobalModel _model(Code)



_tempDir
protected volatile File _tempDir(Code)




Constructor Detail
GlobalModelTestCase
public GlobalModelTestCase()(Code)




Method Detail
assertCompileErrorsPresent
protected void assertCompileErrorsPresent(boolean b)(Code)



assertCompileErrorsPresent
protected void assertCompileErrorsPresent(String name, boolean b)(Code)



assertContents
protected void assertContents(String s, OpenDefinitionsDocument doc) throws BadLocationException(Code)



assertInteractionsContains
protected void assertInteractionsContains(String text) throws EditDocumentException(Code)
Asserts that the given string exists in the Interactions Document.



assertInteractionsDoesNotContain
protected void assertInteractionsDoesNotContain(String text) throws EditDocumentException(Code)
Asserts that the given string does not exist in the Interactions Document.



assertInteractionsDoesNotMatch
protected void assertInteractionsDoesNotMatch(String regex) throws EditDocumentException(Code)
Asserts that the text in the Interactions Document does NOT match the given regex.



assertInteractionsMatches
protected void assertInteractionsMatches(String regex) throws EditDocumentException(Code)
Asserts that the text in the Interactions Document matches the given regex.



assertLength
protected void assertLength(int len, OpenDefinitionsDocument doc)(Code)



assertModified
protected void assertModified(boolean b, OpenDefinitionsDocument doc)(Code)



assertNumOpenDocs
protected void assertNumOpenDocs(int num)(Code)



changeDocumentText
protected void changeDocumentText(String s, OpenDefinitionsDocument doc) throws BadLocationException(Code)
Clear all old text and insert the given text.



classForJava
protected File classForJava(File sourceFile, String className)(Code)
Given a .java file and a class file name, returns the corresponding .class file.



createFile
protected File createFile(String name)(Code)



doCompile
protected synchronized OpenDefinitionsDocument doCompile(String text, File file) throws IOException, BadLocationException, InterruptedException(Code)
Compiles a new file with the given text. The compile is expected to succeed and it is checked to make sure it worked reasonably. This method does not return until the Interactions JVM has reset and is ready to use.
Parameters:
  text - Code for the class to be compiled
Parameters:
  file - File to save the class in Document after it has been saved and compiled



doCompile
protected void doCompile(OpenDefinitionsDocument doc, File file) throws IOException, InterruptedException(Code)
Saves to the given file, and then compiles the given document. The compile is expected to succeed and it is checked to make sure it worked reasonably. This method does not return until the Interactions JVM has reset and is ready to use.
Parameters:
  doc - Document containing the code to be compiled
Parameters:
  file - File to save the class in



getCompilerErrorString
protected String getCompilerErrorString()(Code)
Returns a string with all compiler errors.



getInteractionsText
protected String getInteractionsText() throws EditDocumentException(Code)
Returns the current contents of the interactions document



interpret
protected String interpret(String input) throws EditDocumentException(Code)
Puts the given input into the interactions document and then interprets it, returning the result that was put into the interactions document. This assumes the interactions document is in a state with no text after the prompt. To be sure this is the case, you can reset interactions first. This method provides its own listener to synchronized with the completion of the interaction.
Parameters:
  input - text to interpret The output from this interpretation, in String form, as it was printed to the interactions document.



interpretIgnoreResult
protected void interpretIgnoreResult(String input) throws EditDocumentException(Code)
Appends the input string to the interactions pane and interprets it.



setUp
public void setUp() throws Exception(Code)
Setup for each test case, which does the following.
  1. Creates a new GlobalModel in GlobalModelTestCase._model for each test case run.
  2. Creates a new temporary directory in GlobalModelTestCase._tempDir .



setupDocument
protected OpenDefinitionsDocument setupDocument(String text) throws BadLocationException(Code)
Creates and returns a new document, makes sure newFile is fired, and then adds some text. When this method is done newCount is reset to 0. the new modified document



tearDown
public void tearDown() throws Exception(Code)
Teardown for each test case, which recursively deletes the temporary directory created in setUp.



tempDirectory
protected File tempDirectory() throws IOException(Code)
Create a new temporary directory in _tempDir.



tempFile
protected File tempFile() throws IOException(Code)
Create a new temporary file in _tempDir.



tempFile
protected File tempFile(int i) throws IOException(Code)
Create a new temporary file in _tempDir. Calls with the same int will return the same filename, while calls with different ints will return different filenames.



writeToNewTempFile
protected File writeToNewTempFile(String text) throws IOException(Code)
Creates a new temporary file and writes the given text to it. The File object for the new file is returned.



Fields inherited from edu.rice.cs.drjava.model.MultiThreadedTestCase
protected static volatile boolean _testFailed(Code)(Java Doc)

Methods inherited from edu.rice.cs.drjava.model.MultiThreadedTestCase
public static void join(Thread t)(Code)(Java Doc)
protected static void listenerFail(String s)(Code)(Java Doc)
public void setUp() throws Exception(Code)(Java Doc)
public void tearDown() throws Exception(Code)(Java Doc)
public static void wait(Object o)(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.