Permalink
Browse files

Fixed the build

  • Loading branch information...
1 parent 5a22063 commit f0d421579730ce803bf4cc8f31e45835cf9dbb2f @SzymonPobiega SzymonPobiega committed Feb 15, 2011
Showing with 975 additions and 348 deletions.
  1. +0 −44 Extensions/NcqrsExtensions.sln
  2. +15 −12 Extensions/src/Ncqrs.Config.Windsor.Tests/WindsorConfigurationEventBusTests.cs
  3. +1 −1 Extensions/src/Ncqrs.Config.Windsor.Tests/WindsorConfigurationTests.cs
  4. +23 −25 Extensions/src/Ncqrs.Config.Windsor/WindsorInProcessEventBus.cs
  5. +0 −10 Extensions/src/Ncqrs.SerializableSnapshots/ISerializableSnapshotStore.cs
  6. +0 −59 Extensions/src/Ncqrs.SerializableSnapshots/Ncqrs.SerializableSnapshots.csproj
  7. +0 −36 Extensions/src/Ncqrs.SerializableSnapshots/Properties/AssemblyInfo.cs
  8. +0 −109 Extensions/src/Ncqrs.SerializableSnapshots/SerializableSnapshotsDomainRepository.cs
  9. +0 −22 Extensions/src/Ncqrs.SerializableSnapshots/UnitOfWorkFactory.cs
  10. +19 −19 Framework/src/Ncqrs.Tests/Domain/AggregateRootTests.cs
  11. +5 −0 Framework/src/Ncqrs/Eventing/CommittedEventStream.cs
  12. +12 −8 Framework/src/Ncqrs/Eventing/Sourcing/EventSource.cs
  13. +16 −3 MAIN.build
  14. +604 −0 TestResult.xml
  15. +4 −0 tools/nunit/agent.conf
  16. BIN tools/nunit/lib/nunit-console-runner.dll
  17. BIN tools/nunit/lib/nunit.core.dll
  18. BIN tools/nunit/lib/nunit.core.interfaces.dll
  19. BIN tools/nunit/lib/nunit.fixtures.dll
  20. BIN tools/nunit/lib/nunit.util.dll
  21. BIN tools/nunit/nunit-agent-x86.exe
  22. +69 −0 tools/nunit/nunit-agent-x86.exe.config
  23. BIN tools/nunit/nunit-agent.exe
  24. +69 −0 tools/nunit/nunit-agent.exe.config
  25. BIN tools/nunit/nunit-console-x86.exe
  26. +69 −0 tools/nunit/nunit-console-x86.exe.config
  27. BIN tools/nunit/nunit-console.exe
  28. +69 −0 tools/nunit/nunit-console.exe.config
@@ -1,16 +1,12 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ncqrs.Eventing.Storage.MongoDB", "src\Ncqrs.Eventing.Storage.MongoDB\Ncqrs.Eventing.Storage.MongoDB.csproj", "{E421E735-2833-4948-9BA0-94924BDC502E}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ncqrs.Config.StructureMap", "src\Ncqrs.Config.StructureMap\Ncqrs.Config.StructureMap.csproj", "{2558F4AD-8D5D-43A2-AAEA-75B966F9B4DE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ncqrs.NServiceBus", "src\Ncqrs.NServiceBus\Ncqrs.NServiceBus.csproj", "{9B796256-E9D6-4F21-BB89-C5333A880BFE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ncqrs.NServiceBus.Tests", "src\Ncqrs.NServiceBus.Tests\Ncqrs.NServiceBus.Tests.csproj", "{86D87653-EC64-4388-A5F7-2F64F690C5F5}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ncqrs.SerializableSnapshots", "src\Ncqrs.SerializableSnapshots\Ncqrs.SerializableSnapshots.csproj", "{EEBD674D-B482-4A84-9C4C-3EECCDA14369}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ncqrs.Eventing.Storage.RavenDB.Tests", "src\Ncqrs.Eventing.Storage.RavenDB.Tests\Ncqrs.Eventing.Storage.RavenDB.Tests.csproj", "{7714E2D3-372D-4B0A-9393-F7A0EDA331F5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ncqrs.Messaging", "src\Ncqrs.Messaging\Ncqrs.Messaging.csproj", "{3624C541-6D6E-4AAC-B70A-7A769FB5C442}"
@@ -49,16 +45,6 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {E421E735-2833-4948-9BA0-94924BDC502E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E421E735-2833-4948-9BA0-94924BDC502E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E421E735-2833-4948-9BA0-94924BDC502E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {E421E735-2833-4948-9BA0-94924BDC502E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {E421E735-2833-4948-9BA0-94924BDC502E}.Debug|x86.ActiveCfg = Debug|Any CPU
- {E421E735-2833-4948-9BA0-94924BDC502E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E421E735-2833-4948-9BA0-94924BDC502E}.Release|Any CPU.Build.0 = Release|Any CPU
- {E421E735-2833-4948-9BA0-94924BDC502E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {E421E735-2833-4948-9BA0-94924BDC502E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {E421E735-2833-4948-9BA0-94924BDC502E}.Release|x86.ActiveCfg = Release|Any CPU
{2558F4AD-8D5D-43A2-AAEA-75B966F9B4DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2558F4AD-8D5D-43A2-AAEA-75B966F9B4DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2558F4AD-8D5D-43A2-AAEA-75B966F9B4DE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -89,16 +75,6 @@ Global
{86D87653-EC64-4388-A5F7-2F64F690C5F5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{86D87653-EC64-4388-A5F7-2F64F690C5F5}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{86D87653-EC64-4388-A5F7-2F64F690C5F5}.Release|x86.ActiveCfg = Release|Any CPU
- {EEBD674D-B482-4A84-9C4C-3EECCDA14369}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EEBD674D-B482-4A84-9C4C-3EECCDA14369}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EEBD674D-B482-4A84-9C4C-3EECCDA14369}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {EEBD674D-B482-4A84-9C4C-3EECCDA14369}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {EEBD674D-B482-4A84-9C4C-3EECCDA14369}.Debug|x86.ActiveCfg = Debug|Any CPU
- {EEBD674D-B482-4A84-9C4C-3EECCDA14369}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EEBD674D-B482-4A84-9C4C-3EECCDA14369}.Release|Any CPU.Build.0 = Release|Any CPU
- {EEBD674D-B482-4A84-9C4C-3EECCDA14369}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {EEBD674D-B482-4A84-9C4C-3EECCDA14369}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {EEBD674D-B482-4A84-9C4C-3EECCDA14369}.Release|x86.ActiveCfg = Release|Any CPU
{7714E2D3-372D-4B0A-9393-F7A0EDA331F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7714E2D3-372D-4B0A-9393-F7A0EDA331F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7714E2D3-372D-4B0A-9393-F7A0EDA331F5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -199,26 +175,6 @@ Global
{CAF2E548-87C8-422B-A62C-8C3ED83FF3C3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{CAF2E548-87C8-422B-A62C-8C3ED83FF3C3}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{CAF2E548-87C8-422B-A62C-8C3ED83FF3C3}.Release|x86.ActiveCfg = Release|Any CPU
- {EE6E54C8-D108-49E7-9E2A-6BAEF6D5339F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EE6E54C8-D108-49E7-9E2A-6BAEF6D5339F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EE6E54C8-D108-49E7-9E2A-6BAEF6D5339F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {EE6E54C8-D108-49E7-9E2A-6BAEF6D5339F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {EE6E54C8-D108-49E7-9E2A-6BAEF6D5339F}.Debug|x86.ActiveCfg = Debug|Any CPU
- {EE6E54C8-D108-49E7-9E2A-6BAEF6D5339F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EE6E54C8-D108-49E7-9E2A-6BAEF6D5339F}.Release|Any CPU.Build.0 = Release|Any CPU
- {EE6E54C8-D108-49E7-9E2A-6BAEF6D5339F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {EE6E54C8-D108-49E7-9E2A-6BAEF6D5339F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {EE6E54C8-D108-49E7-9E2A-6BAEF6D5339F}.Release|x86.ActiveCfg = Release|Any CPU
- {76062319-4F5D-4055-9D1A-5680DD2DA882}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {76062319-4F5D-4055-9D1A-5680DD2DA882}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {76062319-4F5D-4055-9D1A-5680DD2DA882}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {76062319-4F5D-4055-9D1A-5680DD2DA882}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {76062319-4F5D-4055-9D1A-5680DD2DA882}.Debug|x86.ActiveCfg = Debug|Any CPU
- {76062319-4F5D-4055-9D1A-5680DD2DA882}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {76062319-4F5D-4055-9D1A-5680DD2DA882}.Release|Any CPU.Build.0 = Release|Any CPU
- {76062319-4F5D-4055-9D1A-5680DD2DA882}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {76062319-4F5D-4055-9D1A-5680DD2DA882}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {76062319-4F5D-4055-9D1A-5680DD2DA882}.Release|x86.ActiveCfg = Release|Any CPU
{9CBAEAFE-9265-47BA-82C5-5E0774CBF2C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9CBAEAFE-9265-47BA-82C5-5E0774CBF2C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9CBAEAFE-9265-47BA-82C5-5E0774CBF2C5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -13,38 +13,41 @@ namespace Ncqrs.Config.Windsor.Tests
public class WindsorConfigurationEventBusTests
{
WindsorContainer _container;
- FakeEvent _testEvent;
+ UncommittedEvent _testEvent;
IEventHandler<FakeEvent> _handler1;
- IEventHandler<SourcedEvent> _handler2;
- IEventHandler<IEvent> _handler3;
+ IEventHandler<FakeEventBase> _handler2;
+ IEventHandler<IFakeEventInterface> _handler3;
[SetUp]
public void SetUp()
{
- _testEvent = new FakeEvent();
+ _testEvent = new UncommittedEvent(Guid.NewGuid(), Guid.NewGuid(), 1, 1, DateTime.UtcNow, new FakeEvent(),
+ new Version(1, 0));
_handler1 = MockRepository.GenerateMock<IEventHandler<FakeEvent>>();
- _handler2 = MockRepository.GenerateMock<IEventHandler<SourcedEvent>>();
- _handler3 = MockRepository.GenerateMock<IEventHandler<IEvent>>();
+ _handler2 = MockRepository.GenerateMock<IEventHandler<FakeEventBase>>();
+ _handler3 = MockRepository.GenerateMock<IEventHandler<IFakeEventInterface>>();
_container = new WindsorContainer();
_container.Register(
Component.For<IWindsorContainer>().Instance(_container),
Component.For<IEventHandler<FakeEvent>>().Instance(_handler1),
- Component.For<IEventHandler<SourcedEvent>>().Instance(_handler2),
- Component.For<IEventHandler<IEvent>>().Instance(_handler3),
+ Component.For<IEventHandler<FakeEventBase>>().Instance(_handler2),
+ Component.For<IEventHandler<IFakeEventInterface>>().Instance(_handler3),
Component.For<IEventBus>().ImplementedBy<WindsorInProcessEventBus>());
var svc = _container.Resolve<IEventBus>();
svc.Publish(_testEvent);
}
[Test]
- public void it_should_call_the_class_handler_once() { _handler1.AssertWasCalled(x => x.Handle(_testEvent), o => o.Repeat.Once()); }
+ public void it_should_call_the_class_handler_once() { _handler1.AssertWasCalled(x => x.Handle(null), o => o.Repeat.Once().IgnoreArguments()); }
[Test]
- public void it_should_call_the_base_class_handler_once() { _handler2.AssertWasCalled(x => x.Handle(_testEvent), o => o.Repeat.Once()); }
+ public void it_should_call_the_base_class_handler_once() { _handler2.AssertWasCalled(x => x.Handle(null), o => o.Repeat.Once().IgnoreArguments()); }
[Test]
- public void it_should_call_the_interface_handler_once() { _handler3.AssertWasCalled(x => x.Handle(_testEvent), o => o.Repeat.Once()); }
+ public void it_should_call_the_interface_handler_once() { _handler3.AssertWasCalled(x => x.Handle(null), o => o.Repeat.Once().IgnoreArguments()); }
}
- public class FakeEvent : SourcedEvent {}
+ public class FakeEvent : FakeEventBase, IFakeEventInterface { }
+ public class FakeEventBase { }
+ public interface IFakeEventInterface { }
}
@@ -21,7 +21,7 @@ public void When_component_is_registered_it_should_be_retrievable()
success.Should().BeTrue();
component.Should().NotBeNull();
- component.Should().BeOfType<IReplicant>();
+ component.Should().BeOfType<Nexus6>();
}
[Test]
@@ -11,30 +11,41 @@ namespace Ncqrs.Config.Windsor
{
public class WindsorInProcessEventBus : IEventBus
{
+ static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
readonly IWindsorContainer _container;
- public WindsorInProcessEventBus(IWindsorContainer container) { _container = container; }
- static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ public WindsorInProcessEventBus(IWindsorContainer container)
+ {
+ _container = container;
+ }
- public virtual void Publish(IEvent eventMessage)
+
+ public void Publish(IPublishableEvent eventMessage)
{
var eventMessageType = eventMessage.GetType();
Log.InfoFormat("Started publishing event {0}.", eventMessageType.FullName);
- var handlers = GetHandlersForEvent(eventMessage);
+ var handlers = GetHandlersForEvent(eventMessage).ToList();
+
+ var publishedEventClosedType = typeof(PublishedEvent<>).MakeGenericType(eventMessage.Payload.GetType());
+ var publishedEvent = (PublishedEvent)Activator.CreateInstance(publishedEventClosedType, eventMessage);
if (handlers.Count() == 0)
+ {
Log.WarnFormat("Did not found any handlers for event {0}.", eventMessageType.FullName);
+ }
else
- PublishToHandlers(eventMessage, eventMessageType, handlers);
+ {
+ PublishToHandlers(publishedEvent, eventMessageType, handlers);
+ }
}
- public virtual void Publish(IEnumerable<IEvent> eventMessages)
+ public void Publish(IEnumerable<IPublishableEvent> eventMessages)
{
eventMessages.ForEach(Publish);
}
-
+
static void PublishToHandlers(dynamic eventMessage, Type eventMessageType, IEnumerable<dynamic> handlers)
{
Log.DebugFormat("Found {0} handlers for event {1}.", handlers.Count(), eventMessageType.FullName);
@@ -50,25 +61,12 @@ static void PublishToHandlers(dynamic eventMessage, Type eventMessageType, IEnum
}
}
- protected virtual IEnumerable<dynamic> GetHandlersForEvent(IEvent eventMessage)
+ protected virtual IEnumerable<dynamic> GetHandlersForEvent(IPublishableEvent eventMessage)
{
- var eventTypes = new List<Type>();
- var type = eventMessage.GetType();
- while (type != null)
- {
- var interfaces = type.GetInterfaces().Where(i => typeof (IEvent).IsAssignableFrom(i));
- eventTypes.Add(type);
- eventTypes.AddRange(interfaces);
- type = typeof (IEvent).IsAssignableFrom(type.BaseType) ? type.BaseType : null;
- }
- eventTypes = eventTypes.Distinct().ToList();
- foreach (var eventType in eventTypes)
- {
- var handlerType = typeof (IEventHandler<>).MakeGenericType(eventType);
- var handlers = _container.ResolveAll(handlerType);
- foreach (var handler in handlers)
- yield return handler;
- }
+ var type = eventMessage.Payload.GetType();
+ var handlerType = typeof (IEventHandler<>).MakeGenericType(type);
+ var handlers = _container.ResolveAll(handlerType);
+ return handlers.Cast<dynamic>();
}
}
}
@@ -1,10 +0,0 @@
-using System;
-
-namespace Ncqrs.SerializableSnapshots
-{
- public interface ISerializableSnapshotStore
- {
- object GetSnapshot(Guid id);
- void SaveSnapshot(object aggreate);
- }
-}
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{EEBD674D-B482-4A84-9C4C-3EECCDA14369}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Ncqrs.SerializableSnapshots</RootNamespace>
- <AssemblyName>Ncqrs.SerializableSnapshots</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <OutputPath>..\..\..\lib\$(Configuration)\$(AssemblyName)\</OutputPath>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Ncqrs">
- <HintPath>..\..\..\lib\$(Configuration)\Ncqrs\Ncqrs.dll</HintPath>
- <Private>False</Private>
- </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="SerializableSnapshotsDomainRepository.cs" />
- <Compile Include="ISerializableSnapshotStore.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="UnitOfWorkFactory.cs" />
- </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>
@@ -1,36 +0,0 @@
-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("Ncqrs.SerializableSnapshots")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("HP")]
-[assembly: AssemblyProduct("Ncqrs.SerializableSnapshots")]
-[assembly: AssemblyCopyright("Copyright © HP 2010")]
-[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("97bf7a24-cd74-4bbe-86b6-e46ef887783d")]
-
-// 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")]
Oops, something went wrong.

0 comments on commit f0d4215

Please sign in to comment.