Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #80 from stoveproject/dev
Browse files Browse the repository at this point in the history
dev to master
  • Loading branch information
osoykan authored Oct 3, 2017
2 parents 6e71cce + 93f26f0 commit 01a30f0
Show file tree
Hide file tree
Showing 23 changed files with 55 additions and 35 deletions.
4 changes: 2 additions & 2 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var configuration = Argument("configuration", "Release");
var toolpath = Argument("toolpath", @"tools");
var branch = Argument("branch", EnvironmentVariable("APPVEYOR_REPO_BRANCH"));
var nugetApiKey = EnvironmentVariable("nugetApiKey");
var isRelease = EnvironmentVariable("APPVEYOR_REPO_TAG");
var isRelease = EnvironmentVariable("APPVEYOR_REPO_TAG") == "true";

var testProjects = new List<Tuple<string, string[]>>
{
Expand Down Expand Up @@ -110,7 +110,7 @@ Task("Pack")

Task("NugetPublish")
.IsDependentOn("Pack")
.WithCriteria(() => branch == "master")
.WithCriteria(() => branch == "master" && isRelease)
.Does(()=>
{
foreach(var nupkgFile in GetFiles(nupkgRegex))
Expand Down
2 changes: 1 addition & 1 deletion common.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>2.0.1</VersionPrefix>
<VersionPrefix>2.0.2</VersionPrefix>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<PackageIconUrl>https://raw.githubusercontent.com/osoykan/Stove/master/stove.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/osoykan/Stove</PackageProjectUrl>
Expand Down
2 changes: 1 addition & 1 deletion src/Stove.RabbitMQ/RabbitMQ/StoveRabbitMQBootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public override void PreStart()
StoveConfiguration.GetConfigurerIfExists<IStoveRabbitMQConfiguration>().Invoke(StoveConfiguration.Modules.StoveRabbitMQ());
}

public override void PostStart()
public override void Start()
{
StoveConfiguration.Resolver.Resolve<IBusControl>().Start();
}
Expand Down
16 changes: 12 additions & 4 deletions src/Stove.RabbitMQ/RabbitMQ/StoveRabbitMQMessageBus.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;

using JetBrains.Annotations;
using System.Threading.Tasks;

using MassTransit;

Expand All @@ -10,12 +9,14 @@ namespace Stove.RabbitMQ
{
public class StoveRabbitMQMessageBus : IMessageBus
{
[NotNull]
private readonly IBus _bus;
private readonly IStoveRabbitMQConfiguration _stoveRabbitMqConfiguration;

public StoveRabbitMQMessageBus([NotNull] IBus bus)
public StoveRabbitMQMessageBus(IBus bus,
IStoveRabbitMQConfiguration stoveRabbitMqConfiguration)
{
_bus = bus;
_stoveRabbitMqConfiguration = stoveRabbitMqConfiguration;
}

public void Publish<TMessage>(TMessage message) where TMessage : class
Expand All @@ -37,5 +38,12 @@ public void Publish(object message, Type messageType)
{
_bus.Publish(message, messageType);
}

public Task<TResponse> CallRequest<TRequest, TResponse>(TRequest request, TimeSpan timeOut, string queueName)
where TRequest : class
where TResponse : class
{
return _bus.CreateRequestClient<TRequest, TResponse>(new Uri($"{_stoveRabbitMqConfiguration.HostAddress}{queueName}"), timeOut).Request(request);
}
}
}
6 changes: 3 additions & 3 deletions src/Stove.RabbitMQ/Stove.RabbitMQ.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MassTransit" Version="4.0.0.1305-develop" />
<PackageReference Include="MassTransit.Autofac" Version="4.0.0.1305-develop" />
<PackageReference Include="MassTransit.RabbitMQ" Version="4.0.0.1305-develop" />
<PackageReference Include="MassTransit" Version="4.0.0.1314-develop" />
<PackageReference Include="MassTransit.Autofac" Version="4.0.0.1314-develop" />
<PackageReference Include="MassTransit.RabbitMQ" Version="4.0.0.1314-develop" />
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions src/Stove/MQ/IMessageBus.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Threading.Tasks;

using JetBrains.Annotations;

Expand All @@ -13,5 +14,7 @@ public interface IMessageBus
void Publish([NotNull] object message);

void Publish([NotNull] object message, [NotNull] Type messageType);

Task<TResponse> CallRequest<TRequest, TResponse>(TRequest request, TimeSpan timeOut, string queueName) where TRequest : class where TResponse : class;
}
}
6 changes: 6 additions & 0 deletions src/Stove/MQ/NullMessageBus.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Threading.Tasks;

namespace Stove.MQ
{
Expand All @@ -21,5 +22,10 @@ public void Publish(object message)
public void Publish(object message, Type messageType)
{
}

public Task<TResponse> CallRequest<TRequest, TResponse>(TRequest request, TimeSpan timeOut, string queueName) where TRequest : class where TResponse : class
{
return Task.FromResult(default(TResponse));
}
}
}
2 changes: 1 addition & 1 deletion test/Stove.Dapper.Tests/Stove.Dapper.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<ProjectReference Include="..\..\src\Stove.EntityFramework\Stove.EntityFramework.csproj" />
<ProjectReference Include="..\Stove.TestBase\Stove.TestBase.csproj" />
<PackageReference Include="Shouldly" Version="3.0.0-beta0003" />
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit" Version="2.3.0-rc1-build3809" />
<PackageReference Include="NSubstitute" Version="2.0.3" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion test/Stove.Demo.WebApi.Core/Stove.Demo.WebApi.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.2.0" />
<PackageReference Include="Autofac.Extras.IocManager" Version="3.2.0" />
<PackageReference Include="Hangfire.SqlServer" Version="1.6.17" />
<PackageReference Include="MassTransit.Extensions.DependencyInjection" Version="4.0.0.1305-develop" />
<PackageReference Include="MassTransit.Extensions.DependencyInjection" Version="4.0.0.1314-develop" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<ProjectReference Include="..\..\src\Stove.EntityFramework\Stove.EntityFramework.csproj" />
<ProjectReference Include="..\Stove.TestBase\Stove.TestBase.csproj" />
<PackageReference Include="Shouldly" Version="3.0.0-beta0003" />
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit" Version="2.3.0-rc1-build3809" />
<PackageReference Include="NSubstitute" Version="2.0.3" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170923-02" />
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit" Version="2.3.0-rc1-build3809" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-rc1-build3809" />
<PackageReference Include="Shouldly" Version="3.0.0-beta0003" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<PackageReference Include="Microsoft.Extensions.Options" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170923-02" />
<PackageReference Include="Shouldly" Version="3.0.0-beta0003" />
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit" Version="2.3.0-rc1-build3809" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-rc1-build3809" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.0" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions test/Stove.Hangfire.Tests/Stove.Hangfire.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170923-02" />
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit" Version="2.3.0-rc1-build3809" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-rc1-build3809" />
<PackageReference Include="Shouldly" Version="3.0.0-beta0003" />
<PackageReference Include="NSubstitute" Version="2.0.3" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions test/Stove.Mapster.Tests/Stove.Mapster.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170923-02" />
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit" Version="2.3.0-rc1-build3809" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-rc1-build3809" />
<PackageReference Include="Shouldly" Version="3.0.0-beta0003" />
<PackageReference Include="NSubstitute" Version="2.0.3" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/Stove.NHibernate.Tests/Stove.NHibernate.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<ProjectReference Include="..\..\src\Stove.NHibernate\Stove.NHibernate.csproj" />
<ProjectReference Include="..\Stove.TestBase\Stove.TestBase.csproj" />
<PackageReference Include="Shouldly" Version="3.0.0-beta0003" />
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit" Version="2.3.0-rc1-build3809" />
<PackageReference Include="NSubstitute" Version="2.0.3" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions test/Stove.NLog.Tests/Stove.NLog.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170923-02" />
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit" Version="2.3.0-rc1-build3809" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-rc1-build3809" />
<PackageReference Include="Shouldly" Version="3.0.0-beta0003" />
</ItemGroup>

Expand Down
3 changes: 3 additions & 0 deletions test/Stove.RabbitMQ.Tests/RabbitMQMessageBus_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,20 @@ namespace Stove.RabbitMQ.Tests
public class RabbitMQMessageBus_Tests : TestBaseWithLocalIocResolver
{
private readonly IBus _bus;
private readonly IStoveRabbitMQConfiguration _configuration;

public RabbitMQMessageBus_Tests()
{
_bus = Substitute.For<IBus>();
_configuration = Substitute.For<IStoveRabbitMQConfiguration>();

Building(builder =>
{
builder.RegisterServices(r =>
{
r.Register<IMessageBus, StoveRabbitMQMessageBus>();
r.Register(ctx => _bus);
r.Register(ctx=>_configuration);
});
})
.Ok();
Expand Down
4 changes: 2 additions & 2 deletions test/Stove.RabbitMQ.Tests/Stove.RabbitMQ.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170923-02" />
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit" Version="2.3.0-rc1-build3809" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-rc1-build3809" />
<PackageReference Include="Shouldly" Version="3.0.0-beta0003" />
<PackageReference Include="NSubstitute" Version="2.0.3" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/Stove.RavenDB.Tests/Stove.RavenDB.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageReference Include="RavenDB.TestDriver" Version="4.0.0-rc-40019" />

<PackageReference Include="Shouldly" Version="3.0.0-beta0003" />
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit" Version="2.3.0-rc1-build3809" />
<PackageReference Include="NSubstitute" Version="2.0.3" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions test/Stove.Redis.Tests/Stove.Redis.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170923-02" />
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit" Version="2.3.0-rc1-build3809" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-rc1-build3809" />
<PackageReference Include="Shouldly" Version="3.0.0-beta0003" />
<PackageReference Include="NSubstitute" Version="2.0.3" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions test/Stove.Serilog.Tests/Stove.Serilog.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170923-02" />
<PackageReference Include="Serilog.Sinks.Trace" Version="2.1.0" />
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit" Version="2.3.0-rc1-build3809" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-rc1-build3809" />
<PackageReference Include="Shouldly" Version="3.0.0-beta0003" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<ProjectReference Include="..\..\src\Stove.Mapster\Stove.Mapster.csproj" />
<ProjectReference Include="..\Stove.TestBase\Stove.TestBase.csproj" />
<PackageReference Include="Shouldly" Version="3.0.0-beta0003" />
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit" Version="2.3.0-rc1-build3809" />
<PackageReference Include="NSubstitute" Version="2.0.3" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions test/Stove.Tests/Stove.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170923-02" />
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit" Version="2.3.0-rc1-build3809" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-rc1-build3809" />
<PackageReference Include="Shouldly" Version="3.0.0-beta0003" />
<PackageReference Include="NSubstitute" Version="2.0.3" />
<PackageReference Include="System.Runtime" Version="4.3.0" />
Expand Down

0 comments on commit 01a30f0

Please sign in to comment.