Permalink
Browse files

Moving RemoteRunListener back to its original namespace to ensure bac…

…kward compatibility
  • Loading branch information...
1 parent b10444c commit 02c0a820973eeeb3329115e89ecdb551dba2ff8a @agross agross committed Feb 1, 2013
@@ -96,6 +96,7 @@
<Compile Include="Runner\Impl\ContextRunnerFactory.cs" />
<Compile Include="Runner\Impl\ContextRunner.cs" />
<Compile Include="Runner\Impl\Listener\AssemblyLocationAwareListener.cs" />
+ <Compile Include="Runner\Impl\RemoteRunListener.cs" />
<Compile Include="Runner\Impl\SpecAssemblyResolver.cs" />
<Compile Include="Runner\Impl\SpecificationRunner.cs" />
<Compile Include="Model\Tag.cs" />
@@ -120,7 +121,6 @@
<Compile Include="Runner\Impl\InfoExtensions.cs" />
<Compile Include="Runner\ISpecificationRunListener.cs" />
<Compile Include="Runner\ISpecificationRunner.cs" />
- <Compile Include="Runner\Impl\Listener\RemoteRunListener.cs" />
<Compile Include="Runner\SpecificationInfo.cs" />
<Compile Include="Runner\Impl\DefaultRunner.cs" />
<Compile Include="TagsAttribute.cs" />
@@ -37,7 +37,7 @@ public void RunAssemblies(IEnumerable<Assembly> assemblies)
{
_internalListener.OnRunStart();
- assemblies.Each(x => InternalRunAssembly(x));
+ assemblies.Each(InternalRunAssembly);
_internalListener.OnRunEnd();
}
@@ -46,8 +46,8 @@ public void RunAssemblies(IEnumerable<Assembly> assemblies)
public void RunNamespace(Assembly assembly, string targetNamespace)
{
_internalListener.OnRunStart();
- AppDomain appDomain = CreateAppDomain(assembly);
+ var appDomain = CreateAppDomain(assembly);
CreateRunnerAndUnloadAppDomain("Namespace", appDomain, assembly, targetNamespace);
_internalListener.OnRunEnd();
@@ -57,8 +57,8 @@ public void RunNamespace(Assembly assembly, string targetNamespace)
public void RunMember(Assembly assembly, MemberInfo member)
{
_internalListener.OnRunStart();
- AppDomain appDomain = CreateAppDomain(assembly);
+ var appDomain = CreateAppDomain(assembly);
CreateRunnerAndUnloadAppDomain("Member", appDomain, assembly, member);
_internalListener.OnRunEnd();
@@ -67,15 +67,14 @@ public void RunMember(Assembly assembly, MemberInfo member)
[SecuritySafeCritical]
void InternalRunAssembly(Assembly assembly)
{
- AppDomain appDomain = CreateAppDomain(assembly);
-
+ var appDomain = CreateAppDomain(assembly);
CreateRunnerAndUnloadAppDomain("Assembly", appDomain, assembly);
}
[SecuritySafeCritical]
void CreateRunnerAndUnloadAppDomain(string runMethod, AppDomain appDomain, Assembly assembly, params object[] args)
{
- string mspecAssemblyFilename = Path.Combine(Path.GetDirectoryName(assembly.Location), "Machine.Specifications.dll");
+ var mspecAssemblyFilename = Path.Combine(Path.GetDirectoryName(assembly.Location), "Machine.Specifications.dll");
var mspecAssemblyName = AssemblyName.GetAssemblyName(mspecAssemblyFilename);
@@ -116,18 +115,19 @@ static AppDomain CreateAppDomain(Assembly assembly)
var appDomainSetup = new AppDomainSetup();
appDomainSetup.ApplicationBase = Path.GetDirectoryName(assembly.Location);
appDomainSetup.ApplicationName = Guid.NewGuid().ToString();
-
appDomainSetup.ConfigurationFile = GetConfigFile(assembly);
return AppDomain.CreateDomain(appDomainSetup.ApplicationName, null, appDomainSetup);
}
static string GetConfigFile(Assembly assembly)
{
- string configFile = assembly.Location + ".config";
+ var configFile = assembly.Location + ".config";
if (File.Exists(configFile))
+ {
return configFile;
+ }
return null;
}
@@ -1,7 +1,7 @@
-using System;
+using System;
using System.Security;
-namespace Machine.Specifications.Runner.Impl.Listener
+namespace Machine.Specifications.Runner.Impl
{
[Serializable]
class RemoteRunListener : MarshalByRefObject, ISpecificationRunListener

0 comments on commit 02c0a82

Please sign in to comment.