1 // ****************************************************************
2 // Copyright 2007, Charlie Poole
3 // This is free software licensed under the NUnit license. You may
4 // obtain a copy of the license at http://nunit.org/?p=license&r=2.4
5 // ****************************************************************
9 using System
.Diagnostics
;
10 using System
.Reflection
;
11 using System
.Runtime
.Remoting
;
12 using System
.Runtime
.Remoting
.Proxies
;
13 using System
.Runtime
.Remoting
.Services
;
14 using System
.Runtime
.Remoting
.Channels
;
15 using System
.Runtime
.Remoting
.Channels
.Tcp
;
21 /// Summary description for ProcessRunner.
23 public class ProcessRunner
: ProxyTestRunner
, IDisposable
25 private TestAgent agent
;
28 public ProcessRunner() : base( 0 ) { }
30 public ProcessRunner( int runnerID
) : base( runnerID
) { }
33 public override bool Load(TestPackage package
)
35 if ( this.agent
== null )
36 this.agent
= Services
.TestAgency
.GetAgent( AgentType
.ProcessAgent
, 5000 );
38 if ( this.TestRunner
== null )
39 this.TestRunner
= agent
.CreateRunner(this.runnerID
);
41 return base.Load (package
);
44 #region IDisposable Members
47 if ( TestRunner
!= null )
48 this.TestRunner
.Unload();
50 if ( this.agent
!= null )
51 Services
.TestAgency
.ReleaseAgent(this.agent
);
53 this.TestRunner
= null;