Skip to content

Commit bc03e1a

Browse files
jacobluseniorquico
authored andcommitted
Upgrade OrleansTestKit to Orleans 10.0.0 and version 10.0.0
1 parent 762fbbb commit bc03e1a

File tree

4 files changed

+27
-22
lines changed

4 files changed

+27
-22
lines changed

src/OrleansTestKit/OrleansTestKit.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<PackageTags>Orleans Cloud-Computing Actor-Model Actors Distributed-Systems C# .NET Test Testing</PackageTags>
1616
<PublishRepositoryUrl>true</PublishRepositoryUrl>
1717
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
18-
<Version>9.0.0</Version>
18+
<Version>10.0.0</Version>
1919
</PropertyGroup>
2020

2121
<PropertyGroup>
@@ -27,9 +27,9 @@
2727
<PrivateAssets>all</PrivateAssets>
2828
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2929
</PackageReference>
30-
<PackageReference Include="Microsoft.Orleans.Reminders" Version="9.2.1" />
31-
<PackageReference Include="Microsoft.Orleans.Streaming" Version="9.2.1" />
32-
<PackageReference Include="Microsoft.Orleans.Runtime" Version="9.2.1" />
30+
<PackageReference Include="Microsoft.Orleans.Reminders" Version="10.0.0" />
31+
<PackageReference Include="Microsoft.Orleans.Streaming" Version="10.0.0" />
32+
<PackageReference Include="Microsoft.Orleans.Runtime" Version="10.0.0" />
3333
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
3434
<PrivateAssets>all</PrivateAssets>
3535
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>

src/OrleansTestKit/TestGrainActivationContext.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
using Orleans.Runtime;
1+
namespace Orleans.TestKit;
22

3-
namespace Orleans.TestKit;
4-
5-
/// <summary>
6-
/// Grain context used for tests.
7-
/// </summary>
3+
/// <summary>Grain context used for tests.</summary>
84
public sealed class TestGrainActivationContext : IGrainContext
95
{
106
/// <inheritdoc/>
@@ -27,14 +23,10 @@ public sealed class TestGrainActivationContext : IGrainContext
2723
/// <inheritdoc/>
2824
public object GrainInstance { get; set; } = default!;
2925

30-
public void Migrate(Dictionary<string, object>? requestContext, CancellationToken cancellationToken = new CancellationToken()) => throw new NotImplementedException();
31-
3226
/// <inheritdoc/>
3327
public GrainReference GrainReference { get; set; } = default!;
3428

35-
/// <summary>
36-
/// Gets or sets the grain type used for this test context.
37-
/// </summary>
29+
/// <summary>Gets or sets the grain type used for this test context.</summary>
3830
public Type GrainType { get; set; } = default!;
3931

4032
/// <inheritdoc/>
@@ -46,28 +38,36 @@ public sealed class TestGrainActivationContext : IGrainContext
4638
/// <inheritdoc/>
4739
public void Activate(Dictionary<string, object> requestContext, CancellationToken? cancellationToken = null) => throw new NotImplementedException();
4840

41+
public void Activate(Dictionary<string, object>? requestContext, CancellationToken cancellationToken = new CancellationToken()) => throw new NotImplementedException();
42+
4943
/// <inheritdoc/>
5044
public void Deactivate(DeactivationReason deactivationReason, CancellationToken? cancellationToken = null) => throw new NotImplementedException();
5145

46+
public void Deactivate(DeactivationReason deactivationReason, CancellationToken cancellationToken = new CancellationToken()) => throw new NotImplementedException();
47+
5248
/// <inheritdoc/>
5349
public bool Equals(IGrainContext? other) => ReferenceEquals(this, other);
5450

5551
/// <inheritdoc/>
5652
public TComponent GetComponent<TComponent>() where TComponent : class => throw new NotImplementedException();
5753

54+
/// <inheritdoc/>
55+
public object? GetComponent(Type componentType) => throw new NotImplementedException();
56+
5857
/// <inheritdoc/>
5958
public TTarget GetTarget<TTarget>() where TTarget : class => throw new NotImplementedException();
6059

60+
/// <inheritdoc/>
61+
public object? GetTarget() => throw new NotImplementedException();
62+
63+
public void Migrate(Dictionary<string, object>? requestContext, CancellationToken cancellationToken = new CancellationToken()) => throw new NotImplementedException();
64+
6165
/// <inheritdoc/>
6266
public void Migrate(Dictionary<string, object> requestContext, CancellationToken? cancellationToken = null) => throw new NotImplementedException();
6367

6468
/// <inheritdoc/>
6569
public void ReceiveMessage(object message) => throw new NotImplementedException();
6670

67-
public void Activate(Dictionary<string, object>? requestContext, CancellationToken cancellationToken = new CancellationToken()) => throw new NotImplementedException();
68-
69-
public void Deactivate(DeactivationReason deactivationReason, CancellationToken cancellationToken = new CancellationToken()) => throw new NotImplementedException();
70-
7171
/// <inheritdoc/>
7272
public void Rehydrate(IRehydrationContext context) => throw new NotImplementedException();
7373

src/OrleansTestKit/TestGrainFactory.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Moq;
2-
using Orleans.Runtime;
32

43
namespace Orleans.TestKit;
54

@@ -70,8 +69,14 @@ public IGrain GetGrain(Type grainInterfaceType, Guid grainPrimaryKey, string key
7069
public IGrain GetGrain(Type grainInterfaceType, long grainPrimaryKey, string keyExtension) =>
7170
GetProbe(grainInterfaceType, GrainIdKeyExtensions.CreateIntegerKey(grainPrimaryKey, keyExtension), null);
7271

72+
public IAddressable GetGrain(Type interfaceType, IdSpan grainKey, string grainClassNamePrefix) =>
73+
GetProbe(interfaceType, grainKey, grainClassNamePrefix);
74+
75+
public IAddressable GetGrain(Type interfaceType, IdSpan grainKey) =>
76+
GetProbe(interfaceType, grainKey, null);
77+
7378
internal Mock<T> AddProbe<T>(IdSpan identity, string? grainClassNamePrefix = null)
74-
where T : class, IGrain
79+
where T : class, IGrain
7580
{
7681
var key = GetKey(identity, typeof(T), grainClassNamePrefix);
7782
var mock = new Mock<T>();

test/OrleansTestKit.Tests/OrleansTestKit.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<PackageReference Include="FluentAssertions" Version="7.2.0" />
1515
<PackageReference Include="Microsoft.CodeCoverage" Version="17.14.1" />
1616
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
17-
<PackageReference Include="Microsoft.Orleans.Sdk" Version="9.2.1" />
17+
<PackageReference Include="Microsoft.Orleans.Sdk" Version="10.0.0" />
1818
<PackageReference Include="Moq" Version="4.20.72" />
1919
<PackageReference Include="NSubstitute" Version="5.3.0" />
2020
<PackageReference Include="System.Configuration.ConfigurationManager" Version="9.0.10" />

0 commit comments

Comments
 (0)