Permalink
Browse files

Removed log4net direct dependency from Hexa.Core.

Added experiemntal event sourcing support.
Playing with masstransit and RabbitMQ
Removed license files.
Updated to latest RavenDb.
Added sonar-project.properties
Removed the use of metrics.exe we will get the same info through SonarQube
  • Loading branch information...
1 parent c80ec14 commit c074d5d338731bfdb37871bd0330884327d3165f @cmendible committed Jun 25, 2013
Showing with 1,827 additions and 651 deletions.
  1. +5 −4 Build.bat
  2. +147 −0 Hexa.Core.Log4net/Hexa.Core.Log4net.csproj
  3. 0 {Hexa.Core/Logging → Hexa.Core.Log4net}/Log4NetLogger.cs
  4. +3 −4 Hexa.Core/Logging/Log4NetLoggerFactory.cs → Hexa.Core.Log4net/Log4NetManager.cs
  5. +13 −0 Hexa.Core.Log4net/Properties/AssemblyInfo.cs
  6. +5 −0 Hexa.Core.Log4net/packages.config
  7. +18 −0 Hexa.Core.NHibernate/EventSourcing/EventDescriptor.hbm.xml
  8. +10 −0 Hexa.Core.NHibernate/EventSourcing/LoadEventDescriptors.hbm.xml
  9. +229 −0 Hexa.Core.NHibernate/EventSourcing/NHEventStore.cs
  10. +5 −3 Hexa.Core.NHibernate/Hexa.Core.NHibernate.csproj
  11. +0 −1 Hexa.Core.NHibernate/packages.config
  12. +12 −53 Hexa.Core.RavenDb/Hexa.Core.RavenDb.csproj
  13. BIN Hexa.Core.RavenDb/Raven.Studio.xap
  14. +1 −0 Hexa.Core.RavenDb/RavenUnitOfWorkFactory.cs
  15. +3 −5 Hexa.Core.RavenDb/packages.config
  16. +29 −132 Hexa.Core.Tests/Core.Domain.Tests/BaseRepository.cs
  17. +29 −68 Hexa.Core.Tests/Core.Domain.Tests/BaseRepositoryTestsBase.cs
  18. +2 −2 Hexa.Core.Tests/Data/Repositories/EntityARepository.cs
  19. +2 −2 Hexa.Core.Tests/Data/Repositories/EntityBRepository.cs
  20. +147 −0 Hexa.Core.Tests/Domain/EntityC.cs
  21. +0 −2 Hexa.Core.Tests/EntityFramework/BaseDatabaseTest.cs
  22. +236 −0 Hexa.Core.Tests/EventSourcing/EventSourcingExperiment.cs
  23. +31 −54 Hexa.Core.Tests/Hexa.Core.Tests.csproj
  24. +0 −2 Hexa.Core.Tests/NHibernate/SqlTests.cs
  25. BIN Hexa.Core.Tests/Raven.Studio.xap
  26. +0 −2 Hexa.Core.Tests/RavenDb/RavenTests.cs
  27. +13 −12 Hexa.Core.Tests/app.config
  28. +8 −7 Hexa.Core.Tests/packages.config
  29. +83 −5 Hexa.Core.sln
  30. +2 −2 Hexa.Core/Data/DatabaseManager.cs
  31. +6 −2 Hexa.Core/Domain/Events/DomainEvents.cs
  32. +14 −0 Hexa.Core/Domain/Events/IDomainEvent.cs
  33. +0 −1 Hexa.Core/Domain/Events/IDomainEventHandler.cs
  34. +7 −0 Hexa.Core/Domain/Events/IEventPublisher.cs
  35. +45 −0 Hexa.Core/Domain/Model/EventSourcedEntity.cs
  36. +2 −4 Hexa.Core/Domain/Repositories/BaseRepository.cs
  37. +55 −0 Hexa.Core/Domain/Repositories/EventSourcing/BaseEventStore.cs
  38. +18 −0 Hexa.Core/Domain/Repositories/EventSourcing/EventDescriptor.cs
  39. +28 −0 Hexa.Core/Domain/Repositories/EventSourcing/EventSourcedRepository.cs
  40. +11 −0 Hexa.Core/Domain/Repositories/EventSourcing/IEventSourcedRepository.cs
  41. +13 −0 Hexa.Core/Domain/Repositories/EventSourcing/IEventStore.cs
  42. +40 −0 Hexa.Core/Domain/Repositories/EventSourcing/MemoryEventStore.cs
  43. +242 −0 Hexa.Core/DynamicExtensions/PrivateReflectionDynamicObject.cs
  44. +10 −0 Hexa.Core/DynamicExtensions/PrivateReflectionDynamicObjectExtensions.cs
  45. +9 −0 Hexa.Core/Exceptions/AggregateNotFoundException.cs
  46. +17 −8 Hexa.Core/Hexa.Core.csproj
  47. +0 −4 Hexa.Core/IoC/ApplicationContext.cs
  48. +153 −0 Hexa.Core/Logging/ConsoleLogger.cs
  49. +91 −0 Hexa.Core/Logging/EmptyLogger.cs
  50. +16 −7 Hexa.Core/Logging/{ILoggerFactory.cs → LoggerManager.cs}
  51. +6 −9 Hexa.Core/ServiceModel/Security/AuthorizationManager.cs
  52. +2 −3 Hexa.Core/ServiceModel/Security/BaseAuthorizationPolicy.cs
  53. +2 −4 Hexa.Core/ServiceModel/Security/BaseX509AuthorizationPolicy.cs
  54. +2 −2 Hexa.Core/Web/UI/Extensions/LinqExtensions.cs
  55. +0 −1 Hexa.Core/packages.config
  56. +0 −31 licenses/Microsoft.Public.license.txt
  57. +0 −201 licenses/log4net.license.txt
  58. +5 −14 msbuild.targets/CodeMetrics.targets
View
@@ -5,10 +5,11 @@ if exist "%programfiles%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" call "%p
if exist "%programfiles(x86)%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" call "%programfiles(x86)%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86
if exist "%programfiles%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" call "%programfiles%\Microsoft Visual Studio 11 .0\VC\vcvarsall.bat" x86
-set /p answer="Want to Build(1) or Build & Test(2) or Build & Test & Metrics(3)?"
+set /p answer="Want to Build(1) or Want to Build & Metrics(2) or Build & Test(3) or Build & Test & Metrics(4)?"
-if "%answer%" EQU "1" call msbuild.exe Build.msbuild /fl
-if "%answer%" EQU "2" call msbuild.exe Build.msbuild /fl /p:"EnableNUnit=true"
-if "%answer%" EQU "3" call msbuild.exe Build.msbuild /fl /p:"EnableMetrics=true" /p:"EnableFxCop=true" /p:"EnableSimian=true" /p:"EnableNUnit=true"
+if "%answer%" EQU "1" call msbuild.exe Build.msbuild /fl
+if "%answer%" EQU "2" call msbuild.exe Build.msbuild /fl /p:"EnableMetrics=true" /p:"EnableFxCop=true" /p:"EnableSimian=true"
+if "%answer%" EQU "3" call msbuild.exe Build.msbuild /fl /p:"EnableNUnit=true"
+if "%answer%" EQU "4" call msbuild.exe Build.msbuild /fl /p:"EnableMetrics=true" /p:"EnableFxCop=true" /p:"EnableSimian=true" /p:"EnableNUnit=true"
pause
@@ -0,0 +1,147 @@
+<?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)' == '' ">x86</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{5BD390A6-3DEA-4E44-A8FD-0942F6B4E188}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Hexa.Core.Log4net</RootNamespace>
+ <AssemblyName>Hexa.Core.Log4net</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkProfile>
+ </TargetFrameworkProfile>
+ <FileAlignment>512</FileAlignment>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <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|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup>
+ <StartupObject />
+ </PropertyGroup>
+ <PropertyGroup>
+ <SignAssembly>true</SignAssembly>
+ </PropertyGroup>
+ <PropertyGroup>
+ <AssemblyOriginatorKeyFile>..\Hexa.Core.snk</AssemblyOriginatorKeyFile>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DebugType>full</DebugType>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <CodeAnalysisLogFile>bin\Debug\Hexa.Core.Log4net.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+ <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+ <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+ <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+ <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <Optimize>true</Optimize>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <CodeAnalysisLogFile>bin\Release\Hexa.Core.Log4net.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+ <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+ <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+ <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+ <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="log4net">
+ <HintPath>..\packages\log4net.2.0.0\lib\net40-full\log4net.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.ComponentModel.Composition" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.ServiceModel" />
+ <Reference Include="System.ServiceModel.Channels" />
+ <Reference Include="System.Web" />
+ <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="..\CommonAssemblyInfo.cs">
+ <Link>Properties\CommonAssemblyInfo.cs</Link>
+ </Compile>
+ <Compile Include="Log4NetLogger.cs" />
+ <Compile Include="Log4NetManager.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\Hexa.Core.snk">
+ <Link>Hexa.Core.snk</Link>
+ </None>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Hexa.Core\Hexa.Core.csproj">
+ <Project>{F25CB899-7469-4870-82C8-939989F60322}</Project>
+ <Name>Hexa.Core</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(SolutionDir)\msbuild.targets\CodeMetrics.targets" />
+ <Import Project="$(SolutionDir)\.nuget\nuget.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>
+ -->
+ <PropertyGroup>
+ <StyleCopMSBuildTargetsFile>..\packages\StyleCop.MSBuild.4.7.44.1\tools\StyleCop.targets</StyleCopMSBuildTargetsFile>
+ </PropertyGroup>
+ <Import Condition="Exists('$(StyleCopMSBuildTargetsFile)')" Project="$(StyleCopMSBuildTargetsFile)" />
+ <PropertyGroup>
+ <StyleCopMSBuildMessageMissing>Failed to import StyleCop.MSBuild targets from '$(StyleCopMSBuildTargetsFile)'. The StyleCop.MSBuild package was either missing or incomplete when the project was loaded. Ensure that the package is present and then restart the build. If you are using an IDE (e.g. Visual Studio), reload the project before restarting the build.</StyleCopMSBuildMessageMissing>
+ <StyleCopMSBuildMessagePresent>Failed to import StyleCop.MSBuild targets from '$(StyleCopMSBuildTargetsFile)'. The StyleCop.MSBuild package was either missing or incomplete when the project was loaded (but is now present). To fix this, restart the build. If you are using an IDE (e.g. Visual Studio), reload the project before restarting the build.</StyleCopMSBuildMessagePresent>
+ <StyleCopMSBuildMessageRestore>Failed to import StyleCop.MSBuild targets from '$(StyleCopMSBuildTargetsFile)'. The StyleCop.MSBuild package was either missing or incomplete when the project was loaded. To fix this, restore the package and then restart the build. If you are using an IDE (e.g. Visual Studio), you may need to reload the project before restarting the build. Note that regular NuGet package restore (during build) does not work with this package because the package needs to be present before the project is loaded. If this is an automated build (e.g. CI server), you may want to ensure that the build process restores the StyleCop.MSBuild package before the project is built.</StyleCopMSBuildMessageRestore>
+ <StyleCopMSBuildMessageRestored>Failed to import StyleCop.MSBuild targets from '$(StyleCopMSBuildTargetsFile)'. The StyleCop.MSBuild package was either missing or incomplete when the project was loaded (but is now present). To fix this, restart the build. If you are using an IDE (e.g. Visual Studio), reload the project before restarting the build. Note that when using regular NuGet package restore (during build) the package will not be available for the initial build because the package needs to be present before the project is loaded. If package restore executes successfully in the intitial build then the package will be available for subsequent builds. If this is an automated build (e.g. CI server), you may want to ensure that the build process restores the StyleCop.MSBuild package before the initial build.</StyleCopMSBuildMessageRestored>
+ </PropertyGroup>
+ <Target Name="StyleCopMSBuildTargetsNotFound">
+ <Warning Condition="!Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)!=true And $(StyleCopTreatErrorsAsWarnings)!=false" Text="$(StyleCopMSBuildMessageMissing)" />
+ <Warning Condition="Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)!=true And $(StyleCopTreatErrorsAsWarnings)!=false" Text="$(StyleCopMSBuildMessagePresent)" />
+ <Warning Condition="!Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)==true And $(StyleCopTreatErrorsAsWarnings)!=false" Text="$(StyleCopMSBuildMessageRestore)" />
+ <Warning Condition="Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)==true And $(StyleCopTreatErrorsAsWarnings)!=false" Text="$(StyleCopMSBuildMessageRestored)" />
+ <Error Condition="!Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)!=true And $(StyleCopTreatErrorsAsWarnings)==false" Text="$(StyleCopMSBuildMessageMissing)" />
+ <Error Condition="Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)!=true And $(StyleCopTreatErrorsAsWarnings)==false" Text="$(StyleCopMSBuildMessagePresent)" />
+ <Error Condition="!Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)==true And $(StyleCopTreatErrorsAsWarnings)==false" Text="$(StyleCopMSBuildMessageRestore)" />
+ <Error Condition="Exists('$(StyleCopMSBuildTargetsFile)') And $(RestorePackages)==true And $(StyleCopTreatErrorsAsWarnings)==false" Text="$(StyleCopMSBuildMessageRestored)" />
+ </Target>
+ <PropertyGroup>
+ <PrepareForBuildDependsOn Condition="!Exists('$(StyleCopMSBuildTargetsFile)')">StyleCopMSBuildTargetsNotFound;$(PrepareForBuildDependsOn)</PrepareForBuildDependsOn>
+ </PropertyGroup>
+</Project>
@@ -29,8 +29,7 @@ namespace Hexa.Core.Logging
using log4net;
using log4net.Config;
- [Export(typeof(ILoggerFactory))]
- public class Log4NetLoggerFactory : ILoggerFactory
+ public class Log4NetManager
{
#region Fields
@@ -40,12 +39,12 @@ public class Log4NetLoggerFactory : ILoggerFactory
#region Constructors
- public Log4NetLoggerFactory()
+ public Log4NetManager()
: this(null)
{
}
- public Log4NetLoggerFactory(FileInfo configFile)
+ public Log4NetManager(FileInfo configFile)
{
if (!initialized)
{
@@ -0,0 +1,13 @@
+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("Hexa.Core.Log4net")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyProduct("Hexa.Core.Log4net")]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("3df10a3d-6ba5-4840-b128-37f8dfc4596b")]
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="log4net" version="2.0.0" targetFramework="net40" />
+ <package id="StyleCop.MSBuild" version="4.7.44.1" targetFramework="net40" />
+</packages>
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
+ assembly="SimpleCQRS"
+ namespace="SimpleCQRS.EventStore">
+ <typedef class="SimpleCQRS.EventStore.NHibernate.JsonType, SimpleCQRS.EventStore.NHibernate"
+ name="json" />
+ <class name="EventDescriptor" table="Events"
+ mutable="false" lazy="false">
+ <composite-id>
+ <key-property name="Id" />
+ <key-property name="Version" />
+ </composite-id>
+ <property name="EventData" type="json" >
+ <column name="Type"/>
+ <column name="Data"/>
+ </property>
+ </class>
+</hibernate-mapping>
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
+ <query name="LoadEventDescriptors">
+ <![CDATA[
+ from EventDescriptor ed
+ where ed.Id = :aggregateId
+ order by ed.Version
+ ]]>
+ </query>
+</hibernate-mapping>
Oops, something went wrong.

0 comments on commit c074d5d

Please sign in to comment.