Skip to content

Commit

Permalink
bam!
Browse files Browse the repository at this point in the history
  • Loading branch information
mookid8000 committed Jun 1, 2015
1 parent 7daee8f commit b0b1828
Show file tree
Hide file tree
Showing 35 changed files with 15,511 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Rebus.Autofac.Tests/AutofacContainerFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Rebus.Autofac.Tests
{
public class AutofacContainerFactory : IHandlerActivatorFactory
public class AutofacContainerFactory : IContainerAdapterFactory
{
readonly ContainerBuilder _containerBuilder = new ContainerBuilder();
readonly List<IDisposable> _disposables = new List<IDisposable>();
Expand All @@ -17,7 +17,7 @@ public IHandlerActivator GetActivator()
{
var container = _containerBuilder.Build();
_disposables.Add(container);
return new AutofacHandlerActivator(container);
return new AutofacContainerAdapter(container);
}

public void RegisterHandlerType<THandler>() where THandler : class, IHandleMessages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ namespace Rebus.Autofac
/// <summary>
/// Implementation of <see cref="IContainerAdapter"/> that is backed by an Autofac container
/// </summary>
public class AutofacHandlerActivator : IContainerAdapter
public class AutofacContainerAdapter : IContainerAdapter
{
readonly IContainer _container;

/// <summary>
/// Constructs the adapter, using the specified container
/// </summary>
public AutofacHandlerActivator(IContainer container)
public AutofacContainerAdapter(IContainer container)
{
_container = container;
}
Expand Down
2 changes: 1 addition & 1 deletion Rebus.Autofac/Rebus.Autofac.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AutofacHandlerActivator.cs" />
<Compile Include="AutofacContainerAdapter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

namespace Rebus.CastleWindsor.Tests
{
public class CastleWindsorHandlerActivatorFactory : IHandlerActivatorFactory
public class CastleWindsorContainerAdapterFactory : IContainerAdapterFactory
{
readonly WindsorContainer _windsorContainer = new WindsorContainer();

public IHandlerActivator GetActivator()
{
return new CastleWindsorHandlerActivator(_windsorContainer);
return new CastleWindsorContainerAdapter(_windsorContainer);
}

public void RegisterHandlerType<THandler>() where THandler : class, IHandleMessages
Expand Down
2 changes: 1 addition & 1 deletion Rebus.CastleWindsor.Tests/CastleWindsorContainerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Rebus.CastleWindsor.Tests
{
[TestFixture]
public class CastleWindsorContainerTests : ContainerTests<CastleWindsorHandlerActivatorFactory>
public class CastleWindsorContainerTests : ContainerTests<CastleWindsorContainerAdapterFactory>
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Rebus.CastleWindsor.Tests
{
[TestFixture]
public class CastleWindsorRealContainerTests : RealContainerTests<CastleWindsorHandlerActivatorFactory>
public class CastleWindsorRealContainerTests : RealContainerTests<CastleWindsorContainerAdapterFactory>
{
}
}
2 changes: 1 addition & 1 deletion Rebus.CastleWindsor.Tests/Rebus.CastleWindsor.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<ItemGroup>
<Compile Include="Assumptions.cs" />
<Compile Include="CastleWindsorContainerTests.cs" />
<Compile Include="CastleWindsorHandlerActivatorFactory.cs" />
<Compile Include="CastleWindsorContainerAdapterFactory.cs" />
<Compile Include="CastleWindsorRealContainerTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ namespace Rebus.CastleWindsor
/// <summary>
/// Implementation of <see cref="IContainerAdapter"/> that is backed by a Windsor Container
/// </summary>
public class CastleWindsorHandlerActivator : IContainerAdapter
public class CastleWindsorContainerAdapter : IContainerAdapter
{
readonly IWindsorContainer _windsorContainer;

/// <summary>
/// Constructs the Windsor handler activator
/// </summary>
public CastleWindsorHandlerActivator(IWindsorContainer windsorContainer)
public CastleWindsorContainerAdapter(IWindsorContainer windsorContainer)
{
if (windsorContainer == null) throw new ArgumentNullException("windsorContainer");
_windsorContainer = windsorContainer;
Expand Down
2 changes: 1 addition & 1 deletion Rebus.CastleWindsor/Rebus.CastleWindsor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CastleWindsorHandlerActivator.cs" />
<Compile Include="CastleWindsorContainerAdapter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="WindsorContainerExtensions.cs" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Rebus.Ninject.Tests/NinjectContainerAdapterFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Rebus.Ninject.Tests
{
public class NinjectContainerAdapterFactory : IHandlerActivatorFactory
public class NinjectContainerAdapterFactory : IContainerAdapterFactory
{
readonly StandardKernel _kernel = new StandardKernel();

Expand Down
36 changes: 36 additions & 0 deletions Rebus.SimpleInjector.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Rebus.SimpleInjector.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Rebus.SimpleInjector.Tests")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("15c0d869-d45f-43e3-8a27-52e05a5829e5")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
78 changes: 78 additions & 0 deletions Rebus.SimpleInjector.Tests/Rebus.SimpleInjector.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F6F18EF3-AE32-4C3E-92FD-8F7F9C008EC2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Rebus.SimpleInjector.Tests</RootNamespace>
<AssemblyName>Rebus.SimpleInjector.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="SimpleInjector">
<HintPath>..\packages\SimpleInjector.2.8.0\lib\net45\SimpleInjector.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="SimpleInjectorContainerAdapterFactory.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SimpleInjectorContainerTests.cs" />
<Compile Include="SimpleInjectorRealContainerTests.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Rebus.SimpleInjector\Rebus.SimpleInjector.csproj">
<Project>{9B02CFA1-54CE-4E23-BF44-A74FEE385DF5}</Project>
<Name>Rebus.SimpleInjector</Name>
</ProjectReference>
<ProjectReference Include="..\Rebus.Tests\Rebus.Tests.csproj">
<Project>{959C65AB-D21A-4582-BC4F-06D1425FF274}</Project>
<Name>Rebus.Tests</Name>
</ProjectReference>
<ProjectReference Include="..\Rebus\Rebus.csproj">
<Project>{7D7B7B36-6298-4E85-9A0E-1B415C5B9D12}</Project>
<Name>Rebus</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Rebus.Activation;
using Rebus.Handlers;
using Rebus.Tests.Contracts.Activation;
using SimpleInjector;

namespace Rebus.SimpleInjector.Tests
{
public class SimpleInjectorContainerAdapterFactory : IContainerAdapterFactory
{
readonly Container _container = new Container();

public IHandlerActivator GetActivator()
{
return new SimpleInjectorContainerAdapter(_container);
}

public void RegisterHandlerType<THandler>() where THandler : class, IHandleMessages
{
_container.Register(typeof(THandler));

_container.Register<THandler, THandler>();

return;
foreach (var handlerInterfaceType in GetHandlerInterfaces<THandler>())
{
var componentName = string.Format("{0}:{1}", typeof(THandler).FullName, handlerInterfaceType.FullName);

//_container.RegisterType(handlerInterfaceType, typeof(THandler), componentName, new TransientLifetimeManager(), new InjectionMember[0]);
}
}

public void CleanUp()
{
}

static IEnumerable<Type> GetHandlerInterfaces<THandler>() where THandler : class, IHandleMessages
{
return typeof(THandler).GetInterfaces().Where(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IHandleMessages<>));
}
}
}
10 changes: 10 additions & 0 deletions Rebus.SimpleInjector.Tests/SimpleInjectorContainerTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using NUnit.Framework;
using Rebus.Tests.Contracts.Activation;

namespace Rebus.SimpleInjector.Tests
{
[TestFixture]
public class SimpleInjectorContainerTests : ContainerTests<SimpleInjectorContainerAdapterFactory>
{
}
}
10 changes: 10 additions & 0 deletions Rebus.SimpleInjector.Tests/SimpleInjectorRealContainerTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using NUnit.Framework;
using Rebus.Tests.Contracts.Activation;

namespace Rebus.SimpleInjector.Tests
{
[TestFixture]
public class SimpleInjectorRealContainerTests : RealContainerTests<SimpleInjectorContainerAdapterFactory>
{
}
}
5 changes: 5 additions & 0 deletions Rebus.SimpleInjector.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="2.6.4" targetFramework="net45" />
<package id="SimpleInjector" version="2.8.0" targetFramework="net45" />
</packages>
36 changes: 36 additions & 0 deletions Rebus.SimpleInjector/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Rebus.SimpleInjector")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Rebus.SimpleInjector")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("34a7aa21-c36f-4908-b6be-ebaf09e28d7d")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Loading

0 comments on commit b0b1828

Please sign in to comment.