edu.rice.cs.drjava.model
Class GlobalModelTestCase.TestListener

java.lang.Object
  |
  +--edu.rice.cs.drjava.model.GlobalModelTestCase.TestListener
All Implemented Interfaces:
GlobalModelListener
Direct Known Subclasses:
GlobalModelTestCase.CompileShouldFailListener, GlobalModelTestCase.CompileShouldSucceedListener, SingleDisplayModelTest.SDTestListener
Enclosing class:
GlobalModelTestCase

public static class GlobalModelTestCase.TestListener
extends Object
implements GlobalModelListener

A GlobalModelListener for testing. By default it expects no events to be fired. To customize, subclass and override one or more methods.


Inner classes inherited from class edu.rice.cs.drjava.model.GlobalModelListener
GlobalModelListener.SaveReason
 
Field Summary
protected  int canAbandonCount
           
protected  int closeCount
           
protected  int compileEndCount
           
protected  int compileStartCount
           
protected  int consoleResetCount
           
protected  int fileRevertedCount
           
protected  int interactionEndCount
           
protected  int interactionsExitedCount
           
protected  int interactionsResetCount
           
protected  int interactionsResettingCount
           
protected  int interactionStartCount
           
protected  int junitEndCount
           
protected  int junitRunningCount
           
protected  int junitStartCount
           
protected  int lastExitStatus
           
protected  int newCount
           
protected  int nonTestCaseCount
           
protected  int openCount
           
protected  int saveAllBeforeProceedingCount
           
protected  int saveCount
           
protected  int shouldRevertFileCount
           
 
Fields inherited from interface edu.rice.cs.drjava.model.GlobalModelListener
COMPILE_REASON, DEBUG_REASON, JUNIT_REASON
 
Constructor Summary
GlobalModelTestCase.TestListener()
           
 
Method Summary
 void assertAbandonCount(int i)
           
 void assertCloseCount(int i)
           
 void assertCompileEndCount(int i)
           
 void assertCompileStartCount(int i)
           
 void assertConsoleResetCount(int i)
           
 void assertFileRevertedCount(int i)
           
 void assertInteractionEndCount(int i)
           
 void assertInteractionsExitedCount(int i)
           
 void assertInteractionsResetCount(int i)
           
 void assertInteractionsResettingCount(int i)
           
 void assertInteractionStartCount(int i)
           
 void assertJUnitEndCount(int i)
           
 void assertJUnitRunningCount(int i)
           
 void assertJUnitStartCount(int i)
           
 void assertNewCount(int i)
           
 void assertNonTestCaseCount(int i)
           
 void assertOpenCount(int i)
           
 void assertSaveAllBeforeProceedingCount(int i)
           
 void assertSaveCount(int i)
           
 void assertShouldRevertFileCount(int i)
           
 boolean canAbandonFile(OpenDefinitionsDocument doc)
          Called to ask the listener if it is OK to abandon the current document.
 void compileEnded()
          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 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 fileReverted(OpenDefinitionsDocument doc)
          Called after a document is reverted.
 void fileSaved(OpenDefinitionsDocument doc)
          Called after the current document is saved.
 void interactionEnded()
          Called when an interaction has finished running.
 void interactionsExited(int status)
          Called when the interactions JVM was closed by System.exit or by being aborted.
 void interactionsReset()
          Called when the interactions window is reset.
 void interactionsResetting()
          Called when the interactionsJVM has begun to be resetted
 void interactionStarted()
          Called after an interaction is started by the GlobalModel.
 void junitEnded()
          Called after JUnit is finished running tests.
 void junitRunning()
          Called once JUnit actually starts running the tests.
 void junitStarted(OpenDefinitionsDocument doc)
          Called after JUnit is started by the GlobalModel.
 void newFileCreated(OpenDefinitionsDocument doc)
          Called after a new document is created.
 void nonTestCase()
          Called when trying to test a non-TestCase class.
 void resetCounts()
           
 void saveAllBeforeProceeding(GlobalModelListener.SaveReason reason)
          Called to demand that the listeners save all open documents before the GlobalModel can proceed with another action.
 boolean shouldRevertFile(OpenDefinitionsDocument doc)
          Called to ask the listener if it is OK to revert the current document to a newer version saved on file.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

newCount

protected int newCount

openCount

protected int openCount

closeCount

protected int closeCount

saveCount

protected int saveCount

canAbandonCount

protected int canAbandonCount

compileStartCount

protected int compileStartCount

compileEndCount

protected int compileEndCount

junitStartCount

protected int junitStartCount

junitRunningCount

protected int junitRunningCount

junitEndCount

protected int junitEndCount

interactionStartCount

protected int interactionStartCount

interactionEndCount

protected int interactionEndCount

consoleResetCount

protected int consoleResetCount

interactionsResettingCount

protected int interactionsResettingCount

interactionsResetCount

protected int interactionsResetCount

interactionsExitedCount

protected int interactionsExitedCount

saveAllBeforeProceedingCount

protected int saveAllBeforeProceedingCount

nonTestCaseCount

protected int nonTestCaseCount

lastExitStatus

protected int lastExitStatus

fileRevertedCount

protected int fileRevertedCount

shouldRevertFileCount

protected int shouldRevertFileCount
Constructor Detail

GlobalModelTestCase.TestListener

public GlobalModelTestCase.TestListener()
Method Detail

resetCounts

public void resetCounts()

assertAbandonCount

public void assertAbandonCount(int i)

assertNewCount

public void assertNewCount(int i)

assertOpenCount

public void assertOpenCount(int i)

assertCloseCount

public void assertCloseCount(int i)

assertSaveCount

public void assertSaveCount(int i)

assertJUnitStartCount

public void assertJUnitStartCount(int i)

assertJUnitRunningCount

public void assertJUnitRunningCount(int i)

assertJUnitEndCount

public void assertJUnitEndCount(int i)

assertInteractionStartCount

public void assertInteractionStartCount(int i)

assertInteractionEndCount

public void assertInteractionEndCount(int i)

assertCompileStartCount

public void assertCompileStartCount(int i)

assertCompileEndCount

public void assertCompileEndCount(int i)

assertInteractionsResettingCount

public void assertInteractionsResettingCount(int i)

assertInteractionsResetCount

public void assertInteractionsResetCount(int i)

assertInteractionsExitedCount

public void assertInteractionsExitedCount(int i)

assertConsoleResetCount

public void assertConsoleResetCount(int i)

assertSaveAllBeforeProceedingCount

public void assertSaveAllBeforeProceedingCount(int i)

assertNonTestCaseCount

public void assertNonTestCaseCount(int i)

assertFileRevertedCount

public void assertFileRevertedCount(int i)

assertShouldRevertFileCount

public void assertShouldRevertFileCount(int i)

newFileCreated

public void newFileCreated(OpenDefinitionsDocument doc)
Description copied from interface: GlobalModelListener
Called after a new document is created.
Specified by:
newFileCreated in interface GlobalModelListener

fileOpened

public void fileOpened(OpenDefinitionsDocument doc)
Description copied from interface: GlobalModelListener
Called after a file is opened and read into the current document.
Specified by:
fileOpened in interface GlobalModelListener

fileClosed

public void fileClosed(OpenDefinitionsDocument doc)
Description copied from interface: GlobalModelListener
Called after a document is closed.
Specified by:
fileClosed in interface GlobalModelListener

fileSaved

public void fileSaved(OpenDefinitionsDocument doc)
Description copied from interface: GlobalModelListener
Called after the current document is saved.
Specified by:
fileSaved in interface GlobalModelListener

fileReverted

public void fileReverted(OpenDefinitionsDocument doc)
Description copied from interface: GlobalModelListener
Called after a document is reverted.
Specified by:
fileReverted in interface GlobalModelListener

junitStarted

public void junitStarted(OpenDefinitionsDocument doc)
Description copied from interface: GlobalModelListener
Called after JUnit is started by the GlobalModel.
Specified by:
junitStarted in interface GlobalModelListener

junitRunning

public void junitRunning()
Description copied from interface: GlobalModelListener
Called once JUnit actually starts running the tests. (Primarily used in test cases.)
Specified by:
junitRunning in interface GlobalModelListener

junitEnded

public void junitEnded()
Description copied from interface: GlobalModelListener
Called after JUnit is finished running tests.
Specified by:
junitEnded in interface GlobalModelListener

interactionStarted

public void interactionStarted()
Description copied from interface: GlobalModelListener
Called after an interaction is started by the GlobalModel.
Specified by:
interactionStarted in interface GlobalModelListener

interactionEnded

public void interactionEnded()
Description copied from interface: GlobalModelListener
Called when an interaction has finished running.
Specified by:
interactionEnded in interface GlobalModelListener

compileStarted

public void compileStarted()
Description copied from interface: GlobalModelListener
Called after a compile is started by the GlobalModel.
Specified by:
compileStarted in interface GlobalModelListener

compileEnded

public void compileEnded()
Description copied from interface: GlobalModelListener
Called when a compile has finished running.
Specified by:
compileEnded in interface GlobalModelListener

interactionsResetting

public void interactionsResetting()
Description copied from interface: GlobalModelListener
Called when the interactionsJVM has begun to be resetted
Specified by:
interactionsResetting in interface GlobalModelListener

interactionsReset

public void interactionsReset()
Description copied from interface: GlobalModelListener
Called when the interactions window is reset.
Specified by:
interactionsReset in interface GlobalModelListener

interactionsExited

public void interactionsExited(int status)
Description copied from interface: GlobalModelListener
Called when the interactions JVM was closed by System.exit or by being aborted. Immediately after this the interactions will be reset.
Specified by:
interactionsExited in interface GlobalModelListener
Following copied from interface: edu.rice.cs.drjava.model.GlobalModelListener
Parameters:
status - The exit code

consoleReset

public void consoleReset()
Description copied from interface: GlobalModelListener
Called when the console window is reset.
Specified by:
consoleReset in interface GlobalModelListener

saveAllBeforeProceeding

public void saveAllBeforeProceeding(GlobalModelListener.SaveReason reason)
Description copied from interface: GlobalModelListener
Called to demand that the listeners save all open documents before the GlobalModel can proceed with another action.
Specified by:
saveAllBeforeProceeding in interface GlobalModelListener

nonTestCase

public void nonTestCase()
Description copied from interface: GlobalModelListener
Called when trying to test a non-TestCase class.
Specified by:
nonTestCase in interface GlobalModelListener

canAbandonFile

public boolean canAbandonFile(OpenDefinitionsDocument doc)
Description copied from interface: GlobalModelListener
Called to ask the listener if it is OK to abandon the current document.
Specified by:
canAbandonFile in interface GlobalModelListener

shouldRevertFile

public boolean shouldRevertFile(OpenDefinitionsDocument doc)
Description copied from interface: GlobalModelListener
Called to ask the listener if it is OK to revert the current document to a newer version saved on file.
Specified by:
shouldRevertFile in interface GlobalModelListener