Skip to content

Commit

Permalink
Prepare for RTM (#285)
Browse files Browse the repository at this point in the history
* Prepare for RTM

* Tweaks

---------

Co-authored-by: Brandon Ording <bording@gmail.com>
  • Loading branch information
andreasohlund and bording authored Feb 21, 2024
1 parent 14773d2 commit 7b0f339
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 118 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
uses: actions/setup-dotnet@v4.0.0
with:
dotnet-version: 8.0.x
dotnet-quality: 'preview'
- name: Build
run: dotnet build src --configuration Release
- name: Upload packages
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
uses: actions/setup-dotnet@v4.0.0
with:
dotnet-version: 8.0.x
dotnet-quality: 'preview'
- name: Build
run: dotnet build src --configuration Release
- name: Sign NuGet packages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,31 @@ namespace NServiceBus.TransactionalSession.AcceptanceTests

public class DefaultServer : IEndpointSetupTemplate
{
public virtual async Task<EndpointConfiguration> GetConfiguration(RunDescriptor runDescriptor, EndpointCustomizationConfiguration endpointConfiguration,
public virtual async Task<EndpointConfiguration> GetConfiguration(RunDescriptor runDescriptor, EndpointCustomizationConfiguration endpointCustomization,
Func<EndpointConfiguration, Task> configurationBuilderCustomization)
{
var builder = new EndpointConfiguration(endpointConfiguration.EndpointName);
builder.EnableInstallers();
var endpointConfiguration = new EndpointConfiguration(endpointCustomization.EndpointName);

builder.Recoverability()
endpointConfiguration.EnableInstallers();
endpointConfiguration.UseSerialization<SystemJsonSerializer>();
endpointConfiguration.Recoverability()
.Delayed(delayed => delayed.NumberOfRetries(0))
.Immediate(immediate => immediate.NumberOfRetries(0));
builder.SendFailedMessagesTo("error");
endpointConfiguration.SendFailedMessagesTo("error");

var storageDir = Path.Combine(Path.GetTempPath(), "learn", TestContext.CurrentContext.Test.ID);

builder.UseTransport(new AcceptanceTestingTransport
endpointConfiguration.UseTransport(new AcceptanceTestingTransport
{
StorageLocation = storageDir
});

await configurationBuilderCustomization(builder).ConfigureAwait(false);
await configurationBuilderCustomization(endpointConfiguration).ConfigureAwait(false);

// scan types at the end so that all types used by the configuration have been loaded into the AppDomain
builder.TypesToIncludeInScan(endpointConfiguration.GetTypesScopedByTestClass());
endpointConfiguration.TypesToIncludeInScan(endpointCustomization.GetTypesScopedByTestClass());

return builder;
return endpointConfiguration;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
Expand All @@ -7,16 +7,16 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\NServiceBus.TransactionalSession.CustomTestingPersistence\NServiceBus.TransactionalSession.CustomTestingPersistence.csproj" />
<ProjectReference Include="..\NServiceBus.TransactionalSession\NServiceBus.TransactionalSession.csproj" />
<ProjectReference Include="..\NServiceBus.TransactionalSession.CustomTestingPersistence\NServiceBus.TransactionalSession.CustomTestingPersistence.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NServiceBus.AcceptanceTesting" Version="9.0.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NServiceBus.AcceptanceTesting" Version="9.0.0-alpha.9" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NServiceBus.AcceptanceTesting" Version="9.0.0-alpha.9" />
<PackageReference Include="NServiceBus.AcceptanceTesting" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NServiceBus" Version="9.0.0-alpha.9" />
<PackageReference Include="NServiceBus.Testing" Version="9.0.0-alpha.1" />
<PackageReference Include="NServiceBus" Version="9.0.0" />
<PackageReference Include="NServiceBus.Testing" Version="9.0.0" />
<PackageReference Include="Particular.Approvals" Version="1.0.0" />
<PackageReference Include="PublicApiGenerator" Version="11.1.0" />
</ItemGroup>
Expand Down
80 changes: 0 additions & 80 deletions src/NServiceBus.TransactionalSession/Guard.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NServiceBus" Version="9.0.0-alpha.9" />
<PackageReference Include="NServiceBus" Version="[9.0.0, 10.0.0)" />
<PackageReference Include="Particular.Packaging" Version="4.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="NServiceBus.TransactionalSession.Tests" Key="$(NServiceBusTestsKey)" />
<InternalsVisibleTo Include="NServiceBus.TransactionalSession.AcceptanceTests" Key="$(NServiceBusTestsKey)" />
<InternalsVisibleTo Include="NServiceBus.TransactionalSession.Tests" Key="$(NServiceBusTestsKey)" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public static class TransactionalSessionExtensions
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
public static Task Send(this ITransactionalSession session, object message, CancellationToken cancellationToken = default)
{
Guard.AgainstNull(nameof(session), session);
Guard.AgainstNull(nameof(message), message);
ArgumentNullException.ThrowIfNull(session);
ArgumentNullException.ThrowIfNull(message);

return session.Send(message, new SendOptions(), cancellationToken);
}
Expand All @@ -35,8 +35,8 @@ public static Task Send(this ITransactionalSession session, object message, Canc
/// </remarks>
public static Task Send<T>(this ITransactionalSession session, Action<T> messageConstructor, CancellationToken cancellationToken = default)
{
Guard.AgainstNull(nameof(session), session);
Guard.AgainstNull(nameof(messageConstructor), messageConstructor);
ArgumentNullException.ThrowIfNull(session);
ArgumentNullException.ThrowIfNull(messageConstructor);

return session.Send(messageConstructor, new SendOptions(), cancellationToken);
}
Expand All @@ -50,9 +50,9 @@ public static Task Send<T>(this ITransactionalSession session, Action<T> message
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
public static Task Send(this ITransactionalSession session, string destination, object message, CancellationToken cancellationToken = default)
{
Guard.AgainstNull(nameof(session), session);
Guard.AgainstNullAndEmpty(nameof(destination), destination);
Guard.AgainstNull(nameof(message), message);
ArgumentNullException.ThrowIfNull(session);
ArgumentException.ThrowIfNullOrWhiteSpace(destination);
ArgumentNullException.ThrowIfNull(message);

var options = new SendOptions();

Expand All @@ -71,9 +71,9 @@ public static Task Send(this ITransactionalSession session, string destination,
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
public static Task Send<T>(this ITransactionalSession session, string destination, Action<T> messageConstructor, CancellationToken cancellationToken = default)
{
Guard.AgainstNull(nameof(session), session);
Guard.AgainstNullAndEmpty(nameof(destination), destination);
Guard.AgainstNull(nameof(messageConstructor), messageConstructor);
ArgumentNullException.ThrowIfNull(session);
ArgumentException.ThrowIfNullOrWhiteSpace(destination);
ArgumentNullException.ThrowIfNull(messageConstructor);

var options = new SendOptions();

Expand All @@ -90,8 +90,8 @@ public static Task Send<T>(this ITransactionalSession session, string destinatio
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
public static Task SendLocal(this ITransactionalSession session, object message, CancellationToken cancellationToken = default)
{
Guard.AgainstNull(nameof(session), session);
Guard.AgainstNull(nameof(message), message);
ArgumentNullException.ThrowIfNull(session);
ArgumentNullException.ThrowIfNull(message);

var options = new SendOptions();

Expand All @@ -109,8 +109,8 @@ public static Task SendLocal(this ITransactionalSession session, object message,
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
public static Task SendLocal<T>(this ITransactionalSession session, Action<T> messageConstructor, CancellationToken cancellationToken = default)
{
Guard.AgainstNull(nameof(session), session);
Guard.AgainstNull(nameof(messageConstructor), messageConstructor);
ArgumentNullException.ThrowIfNull(session);
ArgumentNullException.ThrowIfNull(messageConstructor);

var options = new SendOptions();

Expand All @@ -127,8 +127,8 @@ public static Task SendLocal<T>(this ITransactionalSession session, Action<T> me
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
public static Task Publish(this ITransactionalSession session, object message, CancellationToken cancellationToken = default)
{
Guard.AgainstNull(nameof(session), session);
Guard.AgainstNull(nameof(message), message);
ArgumentNullException.ThrowIfNull(session);
ArgumentNullException.ThrowIfNull(message);

return session.Publish(message, new PublishOptions(), cancellationToken);
}
Expand All @@ -141,7 +141,7 @@ public static Task Publish(this ITransactionalSession session, object message, C
/// <typeparam name="T">The message type.</typeparam>
public static Task Publish<T>(this ITransactionalSession session, CancellationToken cancellationToken = default)
{
Guard.AgainstNull(nameof(session), session);
ArgumentNullException.ThrowIfNull(session);

return session.Publish<T>(_ => { }, new PublishOptions(), cancellationToken);
}
Expand All @@ -155,8 +155,8 @@ public static Task Publish<T>(this ITransactionalSession session, CancellationTo
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
public static Task Publish<T>(this ITransactionalSession session, Action<T> messageConstructor, CancellationToken cancellationToken = default)
{
Guard.AgainstNull(nameof(session), session);
Guard.AgainstNull(nameof(messageConstructor), messageConstructor);
ArgumentNullException.ThrowIfNull(session);
ArgumentNullException.ThrowIfNull(messageConstructor);

return session.Publish(messageConstructor, new PublishOptions(), cancellationToken);
}
Expand Down

0 comments on commit 7b0f339

Please sign in to comment.