IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
NUnit.Engine.Runners.AbstractTestRunner Class Referenceabstract

AbstractTestRunner is the base class for all runners within the NUnit Engine. It implements the ITestRunner interface, which is used by clients of the engine and uses a Template pattern with abstract methods overridden by the derived runners. More...

+ Inheritance diagram for NUnit.Engine.Runners.AbstractTestRunner:
+ Collaboration diagram for NUnit.Engine.Runners.AbstractTestRunner:

Public Member Functions

 AbstractTestRunner (IServiceLocator services, TestPackage package)
 
virtual void UnloadPackage ()
 Unload any loaded TestPackage. Overridden in derived classes to take any necessary action. More...
 
abstract void StopRun (bool force)
 Cancel the ongoing test run. If no test is running, the call is ignored. More...
 
TestEngineResult Explore (TestFilter filter)
 Explores the TestPackage and returns information about the tests found. Loads the package if not done previously. More...
 
TestEngineResult Load ()
 Loads the TestPackage for exploration or execution, saving the result. More...
 
TestEngineResult Reload ()
 Reload the currently loaded test package, saving the result. More...
 
void Unload ()
 Unload any loaded TestPackage. More...
 
int CountTestCases (TestFilter filter)
 Count the test cases that would be run under the specified filter, loading the TestPackage if it is not already loaded. More...
 
TestEngineResult Run (ITestEventListener listener, TestFilter filter)
 Run the tests in the TestPackage, loading the package if this has not already been done. More...
 
AsyncTestEngineResult RunAsync (ITestEventListener listener, TestFilter filter)
 Start a run of the tests in the loaded TestPackage. The tests are run asynchronously and the listener interface is notified as it progresses. More...
 
void StartRun (ITestEventListener listener, TestFilter filter)
 Start a run of the tests in the TestPackage. The tests are run asynchronously and the listener interface is notified as it progresses. Loads the TestPackage if not already loaded. More...
 
void Dispose ()
 

Protected Member Functions

abstract TestEngineResult LoadPackage ()
 Loads the TestPackage for exploration or execution. More...
 
virtual TestEngineResult ReloadPackage ()
 Reload the currently loaded test package. Overridden in derived classes to take any additional action. More...
 
abstract TestEngineResult ExploreTests (TestFilter filter)
 Explores a previously loaded TestPackage and returns information about the tests found. More...
 
abstract int CountTests (TestFilter filter)
 Count the test cases that would be run under the specified filter. More...
 
abstract TestEngineResult RunTests (ITestEventListener listener, TestFilter filter)
 Run the tests in the loaded TestPackage. More...
 
virtual AsyncTestEngineResult RunTestsAsync (ITestEventListener listener, TestFilter filter)
 Start a run of the tests in the loaded TestPackage, returning immediately. The tests are run asynchronously and the listener interface is notified as it progresses. More...
 
virtual void Dispose (bool disposing)
 
bool IsProjectPackage (TestPackage package)
 

Protected Attributes

const string TEST_RUN_ELEMENT = "test-run"
 
bool _disposed = false
 

Properties

IServiceLocator Services [get, private set]
 Our Service Context More...
 
IProjectService ProjectService [get, private set]
 
ITestRunnerFactory TestRunnerFactory [get, private set]
 
TestPackage TestPackage [get, set]
 The TestPackage for which this is the runner More...
 
TestEngineResult LoadResult [get, set]
 The result of the last call to LoadPackage More...
 
bool IsPackageLoaded [get]
 Gets an indicator of whether the package has been loaded. More...
 

Private Member Functions

void EnsurePackageIsLoaded ()
 

Detailed Description

AbstractTestRunner is the base class for all runners within the NUnit Engine. It implements the ITestRunner interface, which is used by clients of the engine and uses a Template pattern with abstract methods overridden by the derived runners.

Constructor & Destructor Documentation

NUnit.Engine.Runners.AbstractTestRunner.AbstractTestRunner ( IServiceLocator  services,
TestPackage  package 
)
inline

Member Function Documentation

abstract TestEngineResult NUnit.Engine.Runners.AbstractTestRunner.LoadPackage ( )
protectedpure virtual
virtual TestEngineResult NUnit.Engine.Runners.AbstractTestRunner.ReloadPackage ( )
inlineprotectedvirtual

Reload the currently loaded test package. Overridden in derived classes to take any additional action.

Returns
A TestEngineResult.
virtual void NUnit.Engine.Runners.AbstractTestRunner.UnloadPackage ( )
inlinevirtual

Unload any loaded TestPackage. Overridden in derived classes to take any necessary action.

Reimplemented in NUnit.Engine.Runners.ProcessRunner, NUnit.Engine.Runners.AggregatingTestRunner, NUnit.Engine.Runners.MasterTestRunner, and NUnit.Engine.Runners.TestDomainRunner.

abstract TestEngineResult NUnit.Engine.Runners.AbstractTestRunner.ExploreTests ( TestFilter  filter)
protectedpure virtual

Explores a previously loaded TestPackage and returns information about the tests found.

Parameters
filterThe TestFilter to be used to select tests
Returns
A TestEngineResult.

Implemented in NUnit.Engine.Runners.ProcessRunner, NUnit.Engine.Runners.DirectTestRunner, NUnit.Engine.Runners.AggregatingTestRunner, and NUnit.Engine.Runners.MasterTestRunner.

abstract int NUnit.Engine.Runners.AbstractTestRunner.CountTests ( TestFilter  filter)
protectedpure virtual

Count the test cases that would be run under the specified filter.

Parameters
filterA TestFilter
Returns
The count of test cases.

Implemented in NUnit.Engine.Runners.ProcessRunner, NUnit.Engine.Runners.DirectTestRunner, NUnit.Engine.Runners.AggregatingTestRunner, and NUnit.Engine.Runners.MasterTestRunner.

abstract TestEngineResult NUnit.Engine.Runners.AbstractTestRunner.RunTests ( ITestEventListener  listener,
TestFilter  filter 
)
protectedpure virtual

Run the tests in the loaded TestPackage.

Parameters
listenerAn ITestEventHandler to receive events
filterA TestFilter used to select tests
Returns
A TestEngineResult giving the result of the test execution

Implemented in NUnit.Engine.Runners.ProcessRunner, NUnit.Engine.Runners.DirectTestRunner, NUnit.Engine.Runners.AggregatingTestRunner, and NUnit.Engine.Runners.MasterTestRunner.

virtual AsyncTestEngineResult NUnit.Engine.Runners.AbstractTestRunner.RunTestsAsync ( ITestEventListener  listener,
TestFilter  filter 
)
inlineprotectedvirtual

Start a run of the tests in the loaded TestPackage, returning immediately. The tests are run asynchronously and the listener interface is notified as it progresses.

Parameters
listenerAn ITestEventHandler to receive events
filterA TestFilter used to select tests
Returns
An AsyncTestEngineResult that will provide the result of the test execution

Reimplemented in NUnit.Engine.Runners.ProcessRunner.

abstract void NUnit.Engine.Runners.AbstractTestRunner.StopRun ( bool  force)
pure virtual

Cancel the ongoing test run. If no test is running, the call is ignored.

Parameters
forceIf true, cancel any ongoing test threads, otherwise wait for them to complete.

Implements NUnit.Engine.ITestEngineRunner.

Implemented in NUnit.Engine.Runners.ProcessRunner, NUnit.Engine.Runners.AggregatingTestRunner, NUnit.Engine.Runners.DirectTestRunner, and NUnit.Engine.Runners.MasterTestRunner.

TestEngineResult NUnit.Engine.Runners.AbstractTestRunner.Explore ( TestFilter  filter)
inline

Explores the TestPackage and returns information about the tests found. Loads the package if not done previously.

Parameters
filterThe TestFilter to be used to select tests
Returns
A TestEngineResult.

Implements NUnit.Engine.ITestEngineRunner.

TestEngineResult NUnit.Engine.Runners.AbstractTestRunner.Load ( )
inline

Loads the TestPackage for exploration or execution, saving the result.

Returns
A TestEngineResult.

Implements NUnit.Engine.ITestEngineRunner.

TestEngineResult NUnit.Engine.Runners.AbstractTestRunner.Reload ( )
inline

Reload the currently loaded test package, saving the result.

Returns
A TestEngineResult.
Exceptions
InvalidOperationExceptionIf no package has been loaded

Implements NUnit.Engine.ITestEngineRunner.

void NUnit.Engine.Runners.AbstractTestRunner.Unload ( )
inline

Unload any loaded TestPackage.

Implements NUnit.Engine.ITestEngineRunner.

int NUnit.Engine.Runners.AbstractTestRunner.CountTestCases ( TestFilter  filter)
inline

Count the test cases that would be run under the specified filter, loading the TestPackage if it is not already loaded.

Parameters
filterA TestFilter
Returns
The count of test cases.

Implements NUnit.Engine.ITestEngineRunner.

TestEngineResult NUnit.Engine.Runners.AbstractTestRunner.Run ( ITestEventListener  listener,
TestFilter  filter 
)
inline

Run the tests in the TestPackage, loading the package if this has not already been done.

Parameters
listenerAn ITestEventHandler to receive events
filterA TestFilter used to select tests
Returns
A TestEngineResult giving the result of the test execution

Implements NUnit.Engine.ITestEngineRunner.

AsyncTestEngineResult NUnit.Engine.Runners.AbstractTestRunner.RunAsync ( ITestEventListener  listener,
TestFilter  filter 
)
inline

Start a run of the tests in the loaded TestPackage. The tests are run asynchronously and the listener interface is notified as it progresses.

Parameters
listenerAn ITestEventHandler to receive events
filterA TestFilter used to select tests
Returns
An AsyncTestEngineResult that will provide the result of the test execution

Implements NUnit.Engine.ITestEngineRunner.

void NUnit.Engine.Runners.AbstractTestRunner.StartRun ( ITestEventListener  listener,
TestFilter  filter 
)
inline

Start a run of the tests in the TestPackage. The tests are run asynchronously and the listener interface is notified as it progresses. Loads the TestPackage if not already loaded.

Parameters
listenerAn ITestEventHandler to receive events
filterA TestFilter used to select tests

Implements NUnit.Engine.ITestEngineRunner.

void NUnit.Engine.Runners.AbstractTestRunner.Dispose ( )
inline
virtual void NUnit.Engine.Runners.AbstractTestRunner.Dispose ( bool  disposing)
inlineprotectedvirtual
bool NUnit.Engine.Runners.AbstractTestRunner.IsProjectPackage ( TestPackage  package)
inlineprotected
void NUnit.Engine.Runners.AbstractTestRunner.EnsurePackageIsLoaded ( )
inlineprivate

Member Data Documentation

const string NUnit.Engine.Runners.AbstractTestRunner.TEST_RUN_ELEMENT = "test-run"
protected
bool NUnit.Engine.Runners.AbstractTestRunner._disposed = false
protected

Property Documentation

IServiceLocator NUnit.Engine.Runners.AbstractTestRunner.Services
getprivate setprotected

Our Service Context

IProjectService NUnit.Engine.Runners.AbstractTestRunner.ProjectService
getprivate setprotected
ITestRunnerFactory NUnit.Engine.Runners.AbstractTestRunner.TestRunnerFactory
getprivate setprotected
TestPackage NUnit.Engine.Runners.AbstractTestRunner.TestPackage
getsetprotected

The TestPackage for which this is the runner

TestEngineResult NUnit.Engine.Runners.AbstractTestRunner.LoadResult
getsetprotected

The result of the last call to LoadPackage

bool NUnit.Engine.Runners.AbstractTestRunner.IsPackageLoaded
getprotected

Gets an indicator of whether the package has been loaded.


The documentation for this class was generated from the following file: