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

java.lang.Object
  extended by edu.rice.cs.drjava.model.GlobalModelTestCase.TestListener
      extended by edu.rice.cs.drjava.model.GlobalModelTestCase.InteractionListener
          extended by edu.rice.cs.drjava.model.GlobalModelTestCase.CompileShouldSucceedListener
              extended by edu.rice.cs.drjava.model.GlobalModelTestCase.JUnitTestListener
All Implemented Interfaces:
CompilerListener, GlobalModelListener, JavadocListener, JUnitListener, InteractionsListener
Direct Known Subclasses:
GlobalModelJUnitTest.JUnitCompileBeforeTestListener, GlobalModelTestCase.JUnitNonTestListener
Enclosing class:
GlobalModelTestCase

public static class GlobalModelTestCase.JUnitTestListener
extends GlobalModelTestCase.CompileShouldSucceedListener


Field Summary
protected  boolean _junitDone
           
protected  Object _junitLock
           
protected  boolean printMessages
           
 
Fields inherited from class edu.rice.cs.drjava.model.GlobalModelTestCase.TestListener
_startupTrace, activeCompilerChangedCount, canAbandonCount, classFileErrorCount, closeCount, compileBeforeJUnitCount, compileEndCount, compileStartCount, consoleResetCount, fileNotFoundCount, filePathContainsPoundCount, fileRevertedCount, interactionEndCount, interactionErrorCount, interactionIncompleteCount, interactionStartCount, interpreterChangedCount, interpreterExitedCount, interpreterReadyCount, interpreterResetFailedCount, interpreterResettingCount, junitEndCount, junitStartCount, junitSuiteStartedCount, junitTestEndedCount, junitTestStartedCount, lastExitStatus, newCount, nonTestCaseCount, openCount, quitFileCount, runStartCount, saveBeforeCompileCount, saveBeforeJavadocCount, saveCount, shouldRevertFileCount, undoableEditCount
 
Constructor Summary
GlobalModelTestCase.JUnitTestListener()
          Construct JUnitTestListener without resetting interactions
GlobalModelTestCase.JUnitTestListener(boolean printListenerMessages)
           
 
Method Summary
 void classFileError(ClassFileError e)
          Called when JUnit encounters an illegal class file.
 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 logJUnitStart()
           
 void nonTestCase(boolean isTestAll)
          Called when trying to test a non-TestCase class.
 void resetCompileCounts()
           
 void resetJUnitCounts()
           
 void runJUnit(JUnitModel jm)
           
 void runJUnit(OpenDefinitionsDocument doc)
          Runs JUnit on doc to completion.
 void waitJUnitDone()
           
 
Methods inherited from class edu.rice.cs.drjava.model.GlobalModelTestCase.CompileShouldSucceedListener
activeCompilerChanged, checkCompileOccurred, compile, compileAborted, compileEnded, compileStarted, logCompileStart, newFileCreated, waitCompileDone
 
Methods inherited from class edu.rice.cs.drjava.model.GlobalModelTestCase.InteractionListener
consoleReset, getLastExitStatus, interactionEnded, interactionStarted, interpreterExited, interpreterReady, interpreterResetting, logInteractionStart, resetConsoleResetCount, waitInteractionDone, waitResetDone
 
Methods inherited from class edu.rice.cs.drjava.model.GlobalModelTestCase.TestListener
activeDocumentChanged, activeDocumentRefreshed, assertAbandonCount, assertActiveCompilerChangedCount, assertClassFileErrorCount, assertCloseCount, assertCompileBeforeJUnitCount, assertCompileEndCount, assertCompileStartCount, assertConsoleResetCount, assertFileNotFoundCount, assertFileRevertedCount, assertInteractionEndCount, assertInteractionErrorCount, assertInteractionIncompleteCount, assertInteractionsErrorCount, assertInteractionStartCount, assertInterpreterChangedCount, assertInterpreterExitedCount, assertInterpreterReadyCount, assertInterpreterResetFailedCount, assertInterpreterResettingCount, assertJUnitEndCount, assertJUnitStartCount, assertJUnitSuiteStartedCount, assertJUnitTestEndedCount, assertJUnitTestStartedCount, assertNewCount, assertNonTestCaseCount, assertOpenCount, assertQuitFileCount, assertRunStartCount, assertSaveBeforeCompileCount, assertSaveBeforeJavadocCount, assertSaveCount, assertShouldRevertFileCount, assertUndoableEditCount, browserChanged, canAbandonFile, compileBeforeJUnit, currentDirectoryChanged, documentNotFound, executeAsyncTask, fileClosed, fileOpened, filePathContainsPound, fileReverted, fileSaved, filesNotFound, filesReadOnly, focusOnDefinitionsPane, focusOnLastFocusOwner, handleAlreadyOpenDocument, interactionErrorOccurred, interactionIncomplete, interpreterChanged, interpreterResetFailed, javadocEnded, javadocStarted, junitClassesStarted, listenerFail, openProject, prepareForRun, projectBuildDirChanged, projectClosed, projectModified, projectRunnableChanged, projectWorkDirChanged, quitFile, resetCounts, saveBeforeCompile, saveBeforeJavadoc, saveUntitled, shouldRevertFile, slaveJVMUsed, undoableEditHappened
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_junitDone

protected volatile boolean _junitDone

_junitLock

protected final Object _junitLock

printMessages

protected volatile boolean printMessages
Constructor Detail

GlobalModelTestCase.JUnitTestListener

public GlobalModelTestCase.JUnitTestListener()
Construct JUnitTestListener without resetting interactions


GlobalModelTestCase.JUnitTestListener

public GlobalModelTestCase.JUnitTestListener(boolean printListenerMessages)
Method Detail

logJUnitStart

public void logJUnitStart()

runJUnit

public void runJUnit(OpenDefinitionsDocument doc)
              throws IOException,
                     ClassNotFoundException,
                     InterruptedException
Runs JUnit on doc to completion.

Throws:
IOException
ClassNotFoundException
InterruptedException

runJUnit

public void runJUnit(JUnitModel jm)
              throws IOException,
                     ClassNotFoundException,
                     InterruptedException
Throws:
IOException
ClassNotFoundException
InterruptedException

waitJUnitDone

public void waitJUnitDone()
                   throws InterruptedException
Throws:
InterruptedException

resetCompileCounts

public void resetCompileCounts()

resetJUnitCounts

public void resetJUnitCounts()

junitStarted

public void junitStarted()
Description copied from interface: JUnitListener
Called after JUnit is started by the GlobalModel.

Specified by:
junitStarted in interface JUnitListener
Overrides:
junitStarted in class GlobalModelTestCase.TestListener

junitSuiteStarted

public void junitSuiteStarted(int numTests)
Description copied from interface: JUnitListener
Called to indicate that a suite of tests has started running.

Specified by:
junitSuiteStarted in interface JUnitListener
Overrides:
junitSuiteStarted in class GlobalModelTestCase.TestListener
Parameters:
numTests - The number of tests in the suite to be run.

junitTestStarted

public void junitTestStarted(String name)
Description copied from interface: JUnitListener
Called when a particular test is started.

Specified by:
junitTestStarted in interface JUnitListener
Overrides:
junitTestStarted in class GlobalModelTestCase.TestListener
Parameters:
name - The name of the test being started.

junitTestEnded

public void junitTestEnded(String name,
                           boolean wasSuccessful,
                           boolean causedError)
Description copied from interface: JUnitListener
Called when a particular test has ended.

Specified by:
junitTestEnded in interface JUnitListener
Overrides:
junitTestEnded in class GlobalModelTestCase.TestListener
Parameters:
name - 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.

nonTestCase

public void nonTestCase(boolean isTestAll)
Description copied from interface: JUnitListener
Called when trying to test a non-TestCase class.

Specified by:
nonTestCase in interface JUnitListener
Overrides:
nonTestCase in class GlobalModelTestCase.TestListener
Parameters:
isTestAll - whether or not it was a use of the test all button

classFileError

public void classFileError(ClassFileError e)
Description copied from interface: JUnitListener
Called when JUnit encounters an illegal class file.

Specified by:
classFileError in interface JUnitListener
Overrides:
classFileError in class GlobalModelTestCase.TestListener
Parameters:
e - the error or exception thrown by loading and resolving f.

junitEnded

public void junitEnded()
Description copied from interface: JUnitListener
Called after JUnit is finished running tests.

Specified by:
junitEnded in interface JUnitListener
Overrides:
junitEnded in class GlobalModelTestCase.TestListener