edu.rice.cs.drjava.model.junit
Interface JUnitListener

All Known Subinterfaces:
GlobalModelListener
All Known Implementing Classes:
DebugTestCase.InterpretListener, DefinitionsPaneMemoryLeakTest.DocChangeListener, DummyGlobalModelListener, GlobalEventNotifier, GlobalModelIOTest.TestFileIOListener, GlobalModelIOTest.TestIOListener, GlobalModelJUnitTest.JUnitCompileBeforeTestListener, GlobalModelTestCase.CompileShouldFailListener, GlobalModelTestCase.CompileShouldSucceedListener, GlobalModelTestCase.InteractionListener, GlobalModelTestCase.JUnitNonTestListener, GlobalModelTestCase.JUnitTestListener, GlobalModelTestCase.TestListener, JUnitEventNotifier, MainFrame.ModelListener, MainFrameTest.SingleDisplayModelCompileListener, MainFrameTest.SingleDisplayModelFileClosedListener, MainFrameTest.SingleDisplayModelFileOpenedListener, SingleDisplayModelTest.SDTestListener

public interface JUnitListener

An interface for responding to events generated by the JUnitModel.

Version:
$Id: JUnitListener.java 5236 2010-04-27 01:43:36Z mgricken $

Method Summary
 void classFileError(ClassFileError e)
          Called when JUnit encounters an illegal class file.
 void compileBeforeJUnit(CompilerListener l, List<OpenDefinitionsDocument> outOfSync)
          Demands that all source files be in sync before running JUnit tests.
 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 nonTestCase(boolean isTestAll, boolean didCompileFail)
          Called when trying to test a non-TestCase class.
 

Method Detail

nonTestCase

void nonTestCase(boolean isTestAll,
                 boolean didCompileFail)
Called when trying to test a non-TestCase class.

Parameters:
isTestAll - whether or not it was a use of the test all button
didCompileFail - whether or not a compile before this JUnit attempt failed

classFileError

void classFileError(ClassFileError e)
Called when JUnit encounters an illegal class file.

Parameters:
e - the error or exception thrown by loading and resolving f.

junitStarted

void junitStarted()
Called after JUnit is started by the GlobalModel.


junitClassesStarted

void junitClassesStarted()
Called when testing a specific list of classes given their source files.


junitSuiteStarted

void junitSuiteStarted(int numTests)
Called to indicate that a suite of tests has started running.

Parameters:
numTests - The number of tests in the suite to be run.

junitTestStarted

void junitTestStarted(String name)
Called when a particular test is started.

Parameters:
name - The name of the test being started.

junitTestEnded

void junitTestEnded(String name,
                    boolean wasSuccessful,
                    boolean causedError)
Called when a particular test has ended.

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.

junitEnded

void junitEnded()
Called after JUnit is finished running tests.


compileBeforeJUnit

void compileBeforeJUnit(CompilerListener l,
                        List<OpenDefinitionsDocument> outOfSync)
Demands that all source files be in sync before running JUnit tests. The caller of this method must check if the documents are in sync with their class files using OpenDefinitionsDocument.checkIfClassFileInSync().