Skip to content

Commit

Permalink
Port to 1.21.2
Browse files Browse the repository at this point in the history
  • Loading branch information
JPWatson committed Aug 23, 2019
1 parent 434181c commit 2844488
Show file tree
Hide file tree
Showing 244 changed files with 11,768 additions and 2,670 deletions.
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#### Port
Aeron.NET has been ported against Java version:
- Agrona: 0.9.30
- Aeron: 1.15.0
- Agrona: 1.0.7
- Aeron: 1.21.2
2 changes: 1 addition & 1 deletion driver/Aeron.Driver.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>Aeron.Driver</id>
<version>1.15.0</version>
<version>1.21.2</version>
<title>Aeron Driver</title>
<authors>Adaptive Financial Consulting Ltd.</authors>
<owners>Adaptive Financial Consulting Ltd.</owners>
Expand Down
Binary file modified driver/media-driver.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion driver/version.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Driver source:
https://repo1.maven.org/maven2/io/aeron/aeron-all/1.15.0/aeron-all-1.15.0.jar
https://repo1.maven.org/maven2/io/aeron/aeron-all/1.21.2/aeron-all-1.21.2.jar
2 changes: 1 addition & 1 deletion src/Adaptive.Aeron.Tests/Adaptive.Aeron.Tests.csproj
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>
<TargetFrameworks>netcoreapp2.0;net45</TargetFrameworks>
Expand Down
29 changes: 17 additions & 12 deletions src/Adaptive.Aeron.Tests/ClientConductorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public class ClientConductorTest
{
private static readonly int TERM_BUFFER_LENGTH = LogBufferDescriptor.TERM_MIN_LENGTH;

protected internal const int SESSION_ID_1 = 13;
protected internal const int SESSION_ID_2 = 15;
private const int SESSION_ID_1 = 13;
private const int SESSION_ID_2 = 15;

private const string CHANNEL = "aeron:udp?endpoint=localhost:40124";
private const int STREAM_ID_1 = 2;
Expand Down Expand Up @@ -75,12 +75,14 @@ public class ClientConductorTest
private readonly TestNanoClock NanoClock = new TestNanoClock();
private ErrorHandler MockClientErrorHandler;

private DriverProxy DriverProxy;
private ClientConductor Conductor;
private DriverProxy DriverProxy;
private AvailableImageHandler MockAvailableImageHandler;
private UnavailableImageHandler MockUnavailableImageHandler;
private Action MockCloseHandler;
private ILogBuffersFactory LogBuffersFactory;
private ILock mockClientLock = A.Fake<ILock>();
private Aeron MockAeron;
private bool SuppressPrintError = false;


Expand Down Expand Up @@ -113,10 +115,13 @@ public void SetUp()

MockAvailableImageHandler = A.Fake<AvailableImageHandler>();
MockUnavailableImageHandler = A.Fake<UnavailableImageHandler>();
MockCloseHandler = A.Fake<Action>();

LogBuffersFactory = A.Fake<ILogBuffersFactory>();

DriverProxy = A.Fake<DriverProxy>();

MockAeron = A.Fake<Aeron>();

A.CallTo(() => mockClientLock.TryLock()).Returns(true);

Expand All @@ -136,13 +141,13 @@ public void SetUp()
.ErrorHandler(MockClientErrorHandler)
.AvailableImageHandler(MockAvailableImageHandler)
.UnavailableImageHandler(MockUnavailableImageHandler)
.KeepAliveInterval(KEEP_ALIVE_INTERVAL)
.CloseHandler(MockCloseHandler)
.KeepAliveIntervalNs(KEEP_ALIVE_INTERVAL)
.DriverTimeoutMs(AWAIT_TIMEOUT)
.InterServiceTimeout(INTER_SERVICE_TIMEOUT_MS * 1000000)
.InterServiceTimeoutNs(INTER_SERVICE_TIMEOUT_MS * 1000000)
.CountersValuesBuffer(CounterValuesBuffer);


Conductor = new ClientConductor(ctx);
Conductor = new ClientConductor(ctx, MockAeron);

PublicationReady.Wrap(PublicationReadyBuffer, 0);
SubscriptionReady.Wrap(SubscriptionReadyBuffer, 0);
Expand Down Expand Up @@ -422,7 +427,6 @@ public void ClientNotifiedOfNewImageShouldMapLogFile()

Conductor.OnAvailableImage(
CORRELATION_ID,
STREAM_ID_1,
SESSION_ID_1,
subscription.RegistrationId,
SUBSCRIPTION_POSITION_ID,
Expand All @@ -445,7 +449,6 @@ public void ClientNotifiedOfNewAndInactiveImages()

Conductor.OnAvailableImage(
CORRELATION_ID,
STREAM_ID_1,
SESSION_ID_1,
subscription.RegistrationId,
SUBSCRIPTION_POSITION_ID,
Expand All @@ -457,7 +460,7 @@ public void ClientNotifiedOfNewAndInactiveImages()

A.CallTo(() => MockAvailableImageHandler(A<Image>._)).MustHaveHappened();

Conductor.OnUnavailableImage(CORRELATION_ID, subscription.RegistrationId, STREAM_ID_1);
Conductor.OnUnavailableImage(CORRELATION_ID, subscription.RegistrationId);

A.CallTo(() => MockUnavailableImageHandler(A<Image>._)).MustHaveHappened();

Expand All @@ -470,7 +473,6 @@ public void ShouldIgnoreUnknownNewImage()
{
Conductor.OnAvailableImage(
CORRELATION_ID_2,
STREAM_ID_2,
SESSION_ID_2,
SUBSCRIPTION_POSITION_REGISTRATION_ID,
SUBSCRIPTION_POSITION_ID,
Expand All @@ -484,7 +486,7 @@ public void ShouldIgnoreUnknownNewImage()
[Test]
public void ShouldIgnoreUnknownInactiveImage()
{
Conductor.OnUnavailableImage(CORRELATION_ID_2, SUBSCRIPTION_POSITION_REGISTRATION_ID, STREAM_ID_2);
Conductor.OnUnavailableImage(CORRELATION_ID_2, SUBSCRIPTION_POSITION_REGISTRATION_ID);

A.CallTo(() => LogBuffersFactory.Map(A<string>._)).MustNotHaveHappened();
A.CallTo(() => MockAvailableImageHandler(A<Image>._)).MustNotHaveHappened();
Expand Down Expand Up @@ -526,6 +528,9 @@ public void ShouldTerminateAndErrorOnClientTimeoutFromDriver()

Assert.True(threwException);
Assert.True(Conductor.IsTerminating());

Conductor.OnClose();
A.CallTo(() => MockCloseHandler.Invoke()).MustHaveHappened();
}

[Test]
Expand Down
18 changes: 18 additions & 0 deletions src/Adaptive.Aeron.Tests/ContextText.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Adaptive.Aeron.Exceptions;
using NUnit.Framework;

namespace Adaptive.Aeron.Tests
{
[TestFixture]
public class ContextText
{
[ExpectedException(typeof(ConcurrentConcludeException))]
public void ShouldNotAllowConcludeMoreThanOnce()
{
var ctx = new Aeron.Context();

ctx.Conclude();
ctx.Conclude();
}
}
}
31 changes: 31 additions & 0 deletions src/Adaptive.Aeron.Tests/Protocol/HeaderFlyweightTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System.Text;
using Adaptive.Aeron.Protocol;
using NUnit.Framework;

namespace Adaptive.Aeron.Tests.Protocol
{
[TestFixture]
public class HeaderFlyweightTest
{
[Test]
public void ShouldConvertFlags()
{
short flags = 0b01101000;

char[] flagsAsChars = HeaderFlyweight.FlagsToChars(flags);

Assert.That(flagsAsChars, Is.EqualTo("01101000"));
}

[Test]
public void ShouldAppendFlags()
{
short flags = 0b01100000;
StringBuilder builder = new StringBuilder();

HeaderFlyweight.AppendFlagsAsChars(flags, builder);

Assert.That(builder.ToString(), Is.EqualTo("01100000"));
}
}
}
2 changes: 1 addition & 1 deletion src/Adaptive.Aeron/Adaptive.Aeron.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
<PackageId>Aeron.Client</PackageId>
<VersionPrefix>1.15.0</VersionPrefix>
<VersionPrefix>1.21.2</VersionPrefix>
<Authors>Adaptive Financial Consulting Ltd.</Authors>
<Company>Adaptive Financial Consulting Ltd.</Company>
<Product>Aeron Client</Product>
Expand Down
Loading

0 comments on commit 2844488

Please sign in to comment.