| 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 FileMovedWarningException extends RuntimeException | |
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 | |
Method Summary | |
protected void | assertCompileErrorsPresent(boolean b) | protected void | assertCompileErrorsPresent(String name, boolean b) | protected void | assertContents(String s, OpenDefinitionsDocument doc) | protected void | assertInteractionsContains(String text) Asserts that the given string exists in the Interactions Document. | protected void | assertInteractionsDoesNotContain(String text) Asserts that the given string does not exist in the Interactions Document. | protected void | assertInteractionsDoesNotMatch(String regex) Asserts that the text in the Interactions Document does NOT match the given regex. | protected void | assertInteractionsMatches(String regex) Asserts that the text in the Interactions Document matches the given regex. | protected void | assertLength(int len, OpenDefinitionsDocument doc) | protected void | assertModified(boolean b, OpenDefinitionsDocument doc) | protected void | assertNumOpenDocs(int num) | protected void | changeDocumentText(String s, OpenDefinitionsDocument doc) Clear all old text and insert the given text. | protected File | classForJava(File sourceFile, String className) Given a .java file and a class file name, returns the corresponding .class file. | protected File | createFile(String name) | protected synchronized OpenDefinitionsDocument | doCompile(String text, File file) Compiles a new file with the given text. | protected void | doCompile(OpenDefinitionsDocument doc, File file) Saves to the given file, and then compiles the given document. | protected String | getCompilerErrorString() Returns a string with all compiler errors. | protected String | getInteractionsText() | protected String | interpret(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 void | interpretIgnoreResult(String input) Appends the input string to the interactions pane and interprets it. | public void | setUp() Setup for each test case, which does the following. | protected OpenDefinitionsDocument | setupDocument(String text) Creates and returns a new document, makes sure newFile is fired, and then adds some text. | public void | tearDown() Teardown for each test case, which recursively deletes the temporary directory created in setUp. | protected File | tempDirectory() Create a new temporary directory in _tempDir. | protected File | tempFile() Create a new temporary file in _tempDir. | protected File | tempFile(int i) Create a new temporary file in _tempDir. | protected File | writeToNewTempFile(String text) Creates a new temporary file and writes the given text to it. |
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) | | |
GlobalModelTestCase | public GlobalModelTestCase()(Code) | | |
assertCompileErrorsPresent | protected void assertCompileErrorsPresent(boolean b)(Code) | | |
assertCompileErrorsPresent | protected void assertCompileErrorsPresent(String name, boolean b)(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.
|
assertNumOpenDocs | protected void assertNumOpenDocs(int num)(Code) | | |
classForJava | protected File classForJava(File sourceFile, String className)(Code) | | Given a .java file and a class file name, returns the corresponding .class file.
|
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.
|
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.
|
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(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)
|
|
|