|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.model.GlobalModelTestCase.TestListener
public static class GlobalModelTestCase.TestListener
A GlobalModelListener for testing. By default it expects no events to be fired. To customize, subclass and override one or more methods.
| Constructor Summary | |
|---|---|
GlobalModelTestCase.TestListener()
|
|
| Method Summary | ||
|---|---|---|
void |
activeCompilerChanged()
Called after the active compiler has been changed. |
|
void |
activeDocumentChanged(OpenDefinitionsDocument active)
Called when a new active document is selected |
|
void |
activeDocumentRefreshed(OpenDefinitionsDocument active)
Called when the active document is refreshed |
|
void |
assertAbandonCount(int i)
|
|
void |
assertActiveCompilerChangedCount(int i)
|
|
void |
assertClassFileErrorCount(int i)
|
|
void |
assertCloseCount(int i)
|
|
void |
assertCompileBeforeJUnitCount(int i)
|
|
void |
assertCompileEndCount(int i)
|
|
void |
assertCompileStartCount(int i)
|
|
void |
assertConsoleResetCount(int i)
|
|
void |
assertFileNotFoundCount(int i)
|
|
void |
assertFileRevertedCount(int i)
|
|
void |
assertInteractionEndCount(int i)
|
|
void |
assertInteractionErrorCount(int i)
|
|
void |
assertInteractionIncompleteCount(int i)
|
|
void |
assertInteractionsErrorCount(int i)
|
|
void |
assertInteractionStartCount(int i)
|
|
void |
assertInterpreterChangedCount(int i)
|
|
void |
assertInterpreterExitedCount(int i)
|
|
void |
assertInterpreterReadyCount(int i)
|
|
void |
assertInterpreterResetFailedCount(int i)
|
|
void |
assertInterpreterResettingCount(int i)
|
|
void |
assertJUnitEndCount(int i)
|
|
void |
assertJUnitStartCount(int i)
|
|
void |
assertJUnitSuiteStartedCount(int i)
|
|
void |
assertJUnitTestEndedCount(int i)
|
|
void |
assertJUnitTestStartedCount(int i)
|
|
void |
assertNewCount(int i)
|
|
void |
assertNonTestCaseCount(int i)
|
|
void |
assertOpenCount(int i)
|
|
void |
assertQuitFileCount(int i)
|
|
void |
assertRunStartCount(int i)
|
|
void |
assertSaveBeforeCompileCount(int i)
|
|
void |
assertSaveBeforeJavadocCount(int i)
|
|
void |
assertSaveCount(int i)
|
|
void |
assertShouldRevertFileCount(int i)
|
|
void |
assertUndoableEditCount(int i)
|
|
void |
browserChanged()
Called when the a region is added to the browswing history. |
|
boolean |
canAbandonFile(OpenDefinitionsDocument doc)
Called to ask the listener if it is OK to abandon the current document. |
|
void |
classFileError(ClassFileError e)
Called when JUnit encounters an illegal class file. |
|
void |
compileAborted(Exception e)
Called if a compilation is aborted. |
|
void |
compileBeforeJUnit(CompilerListener cl)
Demands that all source files be in sync before running JUnit tests. |
|
void |
compileEnded(File workDir,
List<? extends File> excludedFiles)
Called when a compile has finished running. |
|
void |
compileStarted()
Called after a compile is started by the GlobalModel. |
|
void |
consoleReset()
Called when the console window is reset. |
|
void |
currentDirectoryChanged(File dir)
Called when the selection in the navigator changes the current directory without changing the active document. |
|
void |
documentNotFound(OpenDefinitionsDocument d,
File f)
Called when the a document, already opened, is brought back into the cache, and it no longer exists on disk or cannot be accessed. |
|
|
executeAsyncTask(AsyncTask<P,R> task,
P param,
boolean showProgress,
boolean lockUI)
Called when an asynchronous task must be run in the model |
|
void |
fileClosed(OpenDefinitionsDocument doc)
Called after a document is closed. |
|
void |
fileOpened(OpenDefinitionsDocument doc)
Called after a file is opened and read into the current document. |
|
void |
filePathContainsPound()
Called when saving a file whose path contains a '#' symbol. |
|
void |
fileReverted(OpenDefinitionsDocument doc)
Called after a document is reverted. |
|
void |
fileSaved(OpenDefinitionsDocument doc)
Called after the current document is saved. |
|
void |
filesNotFound(File... f)
Called when trying to open one or more files that do not exist. |
|
File[] |
filesReadOnly(File... f)
Called when trying to write one or more files that are read-only. |
|
void |
focusOnDefinitionsPane()
Called when the focus must be changed to the active document in the definitions pane |
|
void |
focusOnLastFocusOwner()
Restores the focus in the main frame to the last focus owner. |
|
void |
handleAlreadyOpenDocument(OpenDefinitionsDocument doc)
Performs any UI related steps to handle the case in which a file is being opened that is already open and modified. |
|
void |
interactionEnded()
Called when an interaction has ended. |
|
void |
interactionErrorOccurred(int offset,
int length)
Called when an interaction results in a syntax error. |
|
void |
interactionIncomplete()
Called when enter was typed in the interactions pane but the interaction was incomplete. |
|
void |
interactionStarted()
Called when an interaction has started. |
|
void |
interpreterChanged(boolean inProgress)
Called when the active interpreter is changed. |
|
void |
interpreterExited(int status)
Called when the interpreter exits unexpectedly. |
|
void |
interpreterReady(File wd)
Called when the interpreter is ready to use. |
|
void |
interpreterResetFailed(Throwable t)
Called if the interpreter could not be reset. |
|
void |
interpreterResetting()
Called when the interpreter has begun resetting. |
|
void |
javadocEnded(boolean success,
File destDir,
boolean allDocs)
Called after Javadoc is finished. |
|
void |
javadocStarted()
Called after Javadoc is started by the GlobalModel. |
|
void |
junitClassesStarted()
Called when testing a specific list of classes given their source files. |
|
void |
junitEnded()
Called after JUnit is finished running tests. |
|
void |
junitStarted()
Called after JUnit is started by the GlobalModel. |
|
void |
junitSuiteStarted(int numTests)
Called to indicate that a suite of tests has started running. |
|
void |
junitTestEnded(String name,
boolean wasSuccessful,
boolean causedError)
Called when a particular test has ended. |
|
void |
junitTestStarted(String name)
Called when a particular test is started. |
|
void |
listenerFail(String message)
Appends the stack trace from the listener's creation to the end of the given failure message. |
|
void |
newFileCreated(OpenDefinitionsDocument doc)
Called after a new document is created. |
|
void |
nonTestCase(boolean isTestAll)
Called when trying to test a non-TestCase class. |
|
void |
openProject(File pfile,
FileOpenSelector files)
Called while the project is being opened. |
|
void |
prepareForRun(OpenDefinitionsDocument doc)
Called when a file's main method is about to be run. |
|
void |
projectBuildDirChanged()
Called when the build directory is modified in the model. |
|
void |
projectClosed()
Called when the project is being closed. |
|
void |
projectModified()
Called if the project's modified state has changed. |
|
void |
projectRunnableChanged()
Called when the project runnability changed (ie, when the main file is set/unset). |
|
void |
projectWorkDirChanged()
Called when the working directory is modified in the model. |
|
boolean |
quitFile(OpenDefinitionsDocument doc)
Called to ask the listener if this document should be saved before quitting. |
|
void |
resetCounts()
|
|
void |
saveBeforeCompile()
Called to demand that all open source files be saved before compiling. |
|
void |
saveBeforeJavadoc()
Called to demand that all files be saved before generating Javadoc. |
|
void |
saveUntitled()
Called to demand that the active document, which is untitled, be saved before compiling. |
|
boolean |
shouldRevertFile(OpenDefinitionsDocument doc)
Called to ask the listener if it is OK to revert the current document to the version saved on disk. |
|
void |
slaveJVMUsed()
Called when the slave JVM is used by the interpreter or unit testing. |
|
void |
undoableEditHappened()
Called when an undoable edit occurs. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected volatile Exception _startupTrace
protected volatile int fileNotFoundCount
protected volatile int newCount
protected volatile int openCount
protected volatile int closeCount
protected volatile int saveCount
protected volatile int canAbandonCount
protected volatile int quitFileCount
protected volatile int classFileErrorCount
protected volatile int compileStartCount
protected volatile int compileEndCount
protected volatile int activeCompilerChangedCount
protected volatile int runStartCount
protected volatile int junitStartCount
protected volatile int junitSuiteStartedCount
protected volatile int junitTestStartedCount
protected volatile int junitTestEndedCount
protected volatile int junitEndCount
protected volatile int interactionStartCount
protected volatile int interactionEndCount
protected volatile int interactionErrorCount
protected volatile int interpreterResettingCount
protected volatile int interpreterReadyCount
protected volatile int interpreterExitedCount
protected volatile int interpreterResetFailedCount
protected volatile int interpreterChangedCount
protected volatile int consoleResetCount
protected volatile int saveBeforeCompileCount
protected volatile int compileBeforeJUnitCount
protected volatile int saveBeforeJavadocCount
protected volatile int nonTestCaseCount
protected volatile int lastExitStatus
protected volatile int fileRevertedCount
protected volatile int shouldRevertFileCount
protected volatile int undoableEditCount
protected volatile int interactionIncompleteCount
protected volatile int filePathContainsPoundCount
| Constructor Detail |
|---|
public GlobalModelTestCase.TestListener()
| Method Detail |
|---|
public void resetCounts()
public void projectModified()
GlobalModelListener
projectModified in interface GlobalModelListener
public void openProject(File pfile,
FileOpenSelector files)
GlobalModelListener
openProject in interface GlobalModelListenerpfile - the location of the project filefiles - The files the gui should open for the modelpublic void projectClosed()
GlobalModelListener
projectClosed in interface GlobalModelListenerpublic void projectBuildDirChanged()
GlobalModelListener
projectBuildDirChanged in interface GlobalModelListenerpublic void projectWorkDirChanged()
GlobalModelListener
projectWorkDirChanged in interface GlobalModelListenerpublic void projectRunnableChanged()
GlobalModelListener
projectRunnableChanged in interface GlobalModelListenerpublic void currentDirectoryChanged(File dir)
GlobalModelListener
currentDirectoryChanged in interface GlobalModelListenerpublic void listenerFail(String message)
public void assertFileNotFoundCount(int i)
public void assertAbandonCount(int i)
public void assertQuitFileCount(int i)
public void assertClassFileErrorCount(int i)
public void assertNewCount(int i)
public void assertOpenCount(int i)
public void assertCloseCount(int i)
public void assertSaveCount(int i)
public void assertJUnitStartCount(int i)
public void assertJUnitSuiteStartedCount(int i)
public void assertJUnitTestStartedCount(int i)
public void assertJUnitTestEndedCount(int i)
public void assertJUnitEndCount(int i)
public void assertInteractionStartCount(int i)
public void assertInteractionEndCount(int i)
public void assertInteractionErrorCount(int i)
public void assertInterpreterChangedCount(int i)
public void assertCompileStartCount(int i)
public void assertCompileEndCount(int i)
public void assertActiveCompilerChangedCount(int i)
public void assertRunStartCount(int i)
public void assertInterpreterResettingCount(int i)
public void assertInterpreterReadyCount(int i)
public void assertInterpreterResetFailedCount(int i)
public void assertInterpreterExitedCount(int i)
public void assertInteractionsErrorCount(int i)
public void assertConsoleResetCount(int i)
public void assertSaveBeforeCompileCount(int i)
public void assertCompileBeforeJUnitCount(int i)
public void assertSaveBeforeJavadocCount(int i)
public void assertNonTestCaseCount(int i)
public void assertFileRevertedCount(int i)
public void assertUndoableEditCount(int i)
public void assertShouldRevertFileCount(int i)
public void assertInteractionIncompleteCount(int i)
public <P,R> void executeAsyncTask(AsyncTask<P,R> task,
P param,
boolean showProgress,
boolean lockUI)
GlobalModelListener
executeAsyncTask in interface GlobalModelListenerpublic void handleAlreadyOpenDocument(OpenDefinitionsDocument doc)
GlobalModelListener
handleAlreadyOpenDocument in interface GlobalModelListenerdoc - true if the user wishes to revert the document, false to ignorepublic void newFileCreated(OpenDefinitionsDocument doc)
GlobalModelListener
newFileCreated in interface GlobalModelListenerpublic void filesNotFound(File... f)
GlobalModelListener
filesNotFound in interface GlobalModelListenerpublic File[] filesReadOnly(File... f)
GlobalModelListener
filesReadOnly in interface GlobalModelListenerf - files that are read-only
public void fileOpened(OpenDefinitionsDocument doc)
GlobalModelListener
fileOpened in interface GlobalModelListenerpublic void fileClosed(OpenDefinitionsDocument doc)
GlobalModelListener
fileClosed in interface GlobalModelListenerpublic void fileSaved(OpenDefinitionsDocument doc)
GlobalModelListener
fileSaved in interface GlobalModelListenerpublic void fileReverted(OpenDefinitionsDocument doc)
GlobalModelListener
fileReverted in interface GlobalModelListenerpublic void undoableEditHappened()
GlobalModelListener
undoableEditHappened in interface GlobalModelListenerpublic void saveBeforeCompile()
CompilerListener
saveBeforeCompile in interface CompilerListenerpublic void junitStarted()
JUnitListener
junitStarted in interface JUnitListenerpublic void junitClassesStarted()
JUnitListener
junitClassesStarted in interface JUnitListenerpublic void junitSuiteStarted(int numTests)
JUnitListener
junitSuiteStarted in interface JUnitListenernumTests - The number of tests in the suite to be run.public void junitTestStarted(String name)
JUnitListener
junitTestStarted in interface JUnitListenername - The name of the test being started.
public void junitTestEnded(String name,
boolean wasSuccessful,
boolean causedError)
JUnitListener
junitTestEnded in interface JUnitListenername - The name of the test that has ended.wasSuccessful - Whether the test passed or not.causedError - If not successful, whether the test caused an error or simply failed.public void junitEnded()
JUnitListener
junitEnded in interface JUnitListenerpublic void javadocStarted()
JavadocListener
javadocStarted in interface JavadocListener
public void javadocEnded(boolean success,
File destDir,
boolean allDocs)
JavadocListener
javadocEnded in interface JavadocListenersuccess - whether the Javadoc operation generated proper outputdestDir - if (success == true) the location where the output was generated, otherwise undefined (null?)allDocs - Whether we are running over all open documentspublic void interactionStarted()
InteractionsListener
interactionStarted in interface InteractionsListenerpublic void interactionEnded()
InteractionsListener
interactionEnded in interface InteractionsListener
public void interactionErrorOccurred(int offset,
int length)
InteractionsListener
interactionErrorOccurred in interface InteractionsListeneroffset - the error's offset into the InteractionsDocumentlength - the length of the errorpublic void interpreterChanged(boolean inProgress)
InteractionsListener
interpreterChanged in interface InteractionsListenerinProgress - Whether the new interpreter is currently in processing an interaction (i.e., whether an
interactionEnded event is pending.)public void compileStarted()
CompilerListener
compileStarted in interface CompilerListener
public void compileEnded(File workDir,
List<? extends File> excludedFiles)
CompilerListener
compileEnded in interface CompilerListenerpublic void compileAborted(Exception e)
CompilerListener
compileAborted in interface CompilerListenerpublic void activeCompilerChanged()
CompilerListener
activeCompilerChanged in interface CompilerListenerpublic void prepareForRun(OpenDefinitionsDocument doc)
GlobalModelListener
prepareForRun in interface GlobalModelListenerpublic void interpreterResetting()
InteractionsListener
interpreterResetting in interface InteractionsListenerpublic void interpreterReady(File wd)
InteractionsListener
interpreterReady in interface InteractionsListenerpublic void interpreterExited(int status)
InteractionsListener
interpreterExited in interface InteractionsListenerstatus - the exit codepublic void interpreterResetFailed(Throwable t)
InteractionsListener
interpreterResetFailed in interface InteractionsListenert - Throwable explaining why the reset failed.public void slaveJVMUsed()
InteractionsListener
slaveJVMUsed in interface InteractionsListenerpublic void consoleReset()
GlobalModelListener
consoleReset in interface GlobalModelListenerpublic void saveUntitled()
CompilerListener
saveUntitled in interface CompilerListenerpublic void compileBeforeJUnit(CompilerListener cl)
JUnitListener
compileBeforeJUnit in interface JUnitListenerpublic void saveBeforeJavadoc()
JavadocListener
saveBeforeJavadoc in interface JavadocListenerpublic void nonTestCase(boolean isTestAll)
JUnitListener
nonTestCase in interface JUnitListenerisTestAll - whether or not it was a use of the test all buttonpublic boolean canAbandonFile(OpenDefinitionsDocument doc)
GlobalModelListener
canAbandonFile in interface GlobalModelListenerpublic boolean quitFile(OpenDefinitionsDocument doc)
GlobalModelListener
quitFile in interface GlobalModelListenerpublic void classFileError(ClassFileError e)
JUnitListener
classFileError in interface JUnitListenere - the error or exception thrown by loading and resolving f.public boolean shouldRevertFile(OpenDefinitionsDocument doc)
GlobalModelListener
shouldRevertFile in interface GlobalModelListenerpublic void interactionIncomplete()
InteractionsListener
interactionIncomplete in interface InteractionsListenerpublic void filePathContainsPound()
GlobalModelListener
filePathContainsPound in interface GlobalModelListener
public void documentNotFound(OpenDefinitionsDocument d,
File f)
GlobalModelListener
documentNotFound in interface GlobalModelListenerpublic void activeDocumentChanged(OpenDefinitionsDocument active)
GlobalModelListener
activeDocumentChanged in interface GlobalModelListenerpublic void activeDocumentRefreshed(OpenDefinitionsDocument active)
GlobalModelListener
activeDocumentRefreshed in interface GlobalModelListenerpublic void focusOnDefinitionsPane()
GlobalModelListener
focusOnDefinitionsPane in interface GlobalModelListenerpublic void focusOnLastFocusOwner()
GlobalModelListener
focusOnLastFocusOwner in interface GlobalModelListenerpublic void browserChanged()
GlobalModelListener
browserChanged in interface GlobalModelListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||