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.Agents.RemoteTestAgent Class Reference

RemoteTestAgent represents a remote agent executing in another process and communicating with NUnit by TCP. Although it is similar to a TestServer, it does not publish a Uri at which clients may connect to it. Rather, it reports back to the sponsoring TestAgency upon startup so that the agency may in turn provide it to clients for use. More...

+ Inheritance diagram for NUnit.Engine.Agents.RemoteTestAgent:
+ Collaboration diagram for NUnit.Engine.Agents.RemoteTestAgent:

Public Member Functions

 RemoteTestAgent (Guid agentId, ITestAgency agency, IServiceLocator services)
 Construct a RemoteTestAgent More...
 
override ITestEngineRunner CreateRunner (TestPackage package)
 Creates a test runner More...
 
override bool Start ()
 Starts the agent, performing any required initialization More...
 
override void Stop ()
 Stops the agent, releasing any resources More...
 
void WaitForStop ()
 
TestEngineResult Explore (TestFilter filter)
 Explore a loaded TestPackage and return information about the tests found. More...
 
TestEngineResult Load ()
 Load a TestPackage for possible execution More...
 
void Unload ()
 Unload any loaded TestPackage. If none is loaded, the call is ignored. More...
 
TestEngineResult Reload ()
 Reload the loaded test package. More...
 
int CountTestCases (TestFilter filter)
 Count the test cases that would be run under the specified filter. More...
 
TestEngineResult Run (ITestEventListener listener, TestFilter filter)
 Run the tests in the loaded TestPackage and return a test result. The tests are run synchronously and the listener interface is notified as it progresses. 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 loaded TestPackage. The tests are run asynchronously and the listener interface is notified as it progresses. More...
 
void StopRun (bool force)
 Cancel the ongoing test run. If no test is running, the call is ignored. More...
 
- Public Member Functions inherited from NUnit.Engine.Agents.TestAgent
 TestAgent (Guid agentId, ITestAgency agency, IServiceLocator services)
 Initializes a new instance of the TestAgent class. More...
 
void Dispose ()
 
override object InitializeLifetimeService ()
 Overridden to cause object to live indefinitely More...
 

Properties

int ProcessId [get]
 
- Properties inherited from NUnit.Engine.Agents.TestAgent
IServiceLocator Services [get]
 The services available to the agent More...
 
ITestAgency Agency [get]
 Gets a reference to the TestAgency with which this agent is associated. Returns null if the agent is not connected to an agency. More...
 
Guid Id [get]
 Gets a Guid that uniquely identifies this agent. More...
 
- Properties inherited from NUnit.Engine.ITestAgent
ITestAgency Agency [get]
 Gets the agency with which this agent is associated. More...
 
Guid Id [get]
 Gets a Guid that uniquely identifies this agent. More...
 

Private Attributes

ITestEngineRunner _runner
 
TestPackage _package
 
ManualResetEvent stopSignal = new ManualResetEvent(false)
 

Static Private Attributes

static Logger log = InternalTrace.GetLogger(typeof(RemoteTestAgent))
 

Additional Inherited Members

- Protected Member Functions inherited from NUnit.Engine.Agents.TestAgent
virtual void Dispose (bool disposing)
 Dispose is overridden to stop the agent More...
 

Detailed Description

RemoteTestAgent represents a remote agent executing in another process and communicating with NUnit by TCP. Although it is similar to a TestServer, it does not publish a Uri at which clients may connect to it. Rather, it reports back to the sponsoring TestAgency upon startup so that the agency may in turn provide it to clients for use.

Constructor & Destructor Documentation

NUnit.Engine.Agents.RemoteTestAgent.RemoteTestAgent ( Guid  agentId,
ITestAgency  agency,
IServiceLocator  services 
)
inline

Construct a RemoteTestAgent

Member Function Documentation

override ITestEngineRunner NUnit.Engine.Agents.RemoteTestAgent.CreateRunner ( TestPackage  package)
inlinevirtual

Creates a test runner

Implements NUnit.Engine.Agents.TestAgent.

override bool NUnit.Engine.Agents.RemoteTestAgent.Start ( )
inlinevirtual

Starts the agent, performing any required initialization

Returns
true if the agent was started successfully.

Implements NUnit.Engine.Agents.TestAgent.

Referenced by NUnit.Agent.NUnitTestAgent.Main().

override void NUnit.Engine.Agents.RemoteTestAgent.Stop ( )
inlinevirtual

Stops the agent, releasing any resources

Implements NUnit.Engine.Agents.TestAgent.

void NUnit.Engine.Agents.RemoteTestAgent.WaitForStop ( )
inline
TestEngineResult NUnit.Engine.Agents.RemoteTestAgent.Explore ( TestFilter  filter)
inline

Explore a loaded TestPackage and return information about the tests found.

Parameters
filterCriteria used to filter the search results
Returns
A TestEngineResult.

Implements NUnit.Engine.ITestEngineRunner.

References NUnit.Engine.ITestEngineRunner.Explore().

TestEngineResult NUnit.Engine.Agents.RemoteTestAgent.Load ( )
inline

Load a TestPackage for possible execution

Returns
A TestEngineResult.

Implements NUnit.Engine.ITestEngineRunner.

References NUnit.Engine.ITestEngineRunner.Load().

void NUnit.Engine.Agents.RemoteTestAgent.Unload ( )
inline

Unload any loaded TestPackage. If none is loaded, the call is ignored.

Implements NUnit.Engine.ITestEngineRunner.

References NUnit.Engine.ITestEngineRunner.Unload().

TestEngineResult NUnit.Engine.Agents.RemoteTestAgent.Reload ( )
inline

Reload the loaded test package.

Returns
A TestEngineResult.
Exceptions
InvalidOperationExceptionIf no package is loaded.

Implements NUnit.Engine.ITestEngineRunner.

References NUnit.Engine.ITestEngineRunner.Reload().

int NUnit.Engine.Agents.RemoteTestAgent.CountTestCases ( TestFilter  filter)
inline

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

Parameters
filterA TestFilter
Returns
The count of test cases

Implements NUnit.Engine.ITestEngineRunner.

References NUnit.Engine.ITestEngineRunner.CountTestCases().

TestEngineResult NUnit.Engine.Agents.RemoteTestAgent.Run ( ITestEventListener  listener,
TestFilter  filter 
)
inline

Run the tests in the loaded TestPackage and return a test result. The tests are run synchronously and the listener interface is notified as it progresses.

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.

References NUnit.Engine.ITestEngineRunner.Run().

AsyncTestEngineResult NUnit.Engine.Agents.RemoteTestAgent.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
A AsyncTestEngineResult that will provide the result of the test execution

Implements NUnit.Engine.ITestEngineRunner.

References NUnit.Engine.ITestEngineRunner.RunAsync().

void NUnit.Engine.Agents.RemoteTestAgent.StartRun ( 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

Implements NUnit.Engine.ITestEngineRunner.

void NUnit.Engine.Agents.RemoteTestAgent.StopRun ( bool  force)
inline

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.

References NUnit.Engine.ITestEngineRunner.StopRun().

Member Data Documentation

Logger NUnit.Engine.Agents.RemoteTestAgent.log = InternalTrace.GetLogger(typeof(RemoteTestAgent))
staticprivate
ITestEngineRunner NUnit.Engine.Agents.RemoteTestAgent._runner
private
TestPackage NUnit.Engine.Agents.RemoteTestAgent._package
private
ManualResetEvent NUnit.Engine.Agents.RemoteTestAgent.stopSignal = new ManualResetEvent(false)
private

Property Documentation

int NUnit.Engine.Agents.RemoteTestAgent.ProcessId
get

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