Skip to content

Commit 7093895

Browse files
committed
fixed compilation issues with latest experimental HOCON
uses the latest source from akkadotnet/HOCON#165
1 parent 5169b57 commit 7093895

File tree

11 files changed

+37
-1138
lines changed

11 files changed

+37
-1138
lines changed

src/core/Akka.Cluster/ClusterSettings.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public ClusterSettings(Config config, string systemName)
6666
SchedulerTickDuration = cc.GetTimeSpan("scheduler.tick-duration");
6767
SchedulerTicksPerWheel = cc.GetInt("scheduler.ticks-per-wheel");
6868

69-
MinNrOfMembersOfRole = cc.GetConfig("role").Root.GetObject().Items
70-
.ToImmutableDictionary(kv => kv.Key, kv => kv.Value.GetObject().GetKey("min-nr-of-members").GetInt());
69+
MinNrOfMembersOfRole = cc.GetObject("role")
70+
.ToImmutableDictionary(kv => kv.Key, kv => kv.Value.GetObject().GetField("min-nr-of-members").Value.GetInt());
7171

7272
VerboseHeartbeatLogging = cc.GetBoolean("debug.verbose-heartbeat-logging");
7373
VerboseGossipReceivedLogging = cc.GetBoolean("debug.verbose-receive-gossip-logging");

src/core/Akka.FSharp.Tests/ApiTests.fs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ open Xunit
1515

1616
[<Fact>]
1717
let ``configuration loader should load data from app.config`` () =
18-
let config = Configuration.load()
18+
let config = Configuration.load("akka")
1919
config.HasPath "akka.test.value"
2020
|> equals true
2121
config.GetInt "akka.test.value"
@@ -132,7 +132,7 @@ type TestActor() =
132132
[<Fact>]
133133
let ``can spawn actor from expression`` () =
134134

135-
let system = Configuration.load() |> System.create "test"
135+
let system = Configuration.load("akka") |> System.create "test"
136136
let actor = spawnObj system "test-actor" <@ fun () -> TestActor() @>
137137

138138
()

src/core/Akka.FSharp/FsApi.fs

+4-4
Original file line numberDiff line numberDiff line change
@@ -388,13 +388,13 @@ module Linq =
388388
module Configuration =
389389

390390
/// Parses provided HOCON string into a valid Akka configuration object.
391-
let parse = Akka.Configuration.ConfigurationFactory.ParseString
391+
let parse = Hocon.ConfigurationFactory.ParseString
392392

393393
/// Returns default Akka configuration.
394-
let defaultConfig = Akka.Configuration.ConfigurationFactory.Default
394+
let defaultConfig = Hocon.ConfigurationFactory.Default
395395

396396
/// Loads Akka configuration from the project's .config file.
397-
let load = Akka.Configuration.ConfigurationFactory.Load
397+
let load = Hocon.ConfigurationFactory.Load
398398

399399
module internal OptionHelper =
400400

@@ -475,7 +475,7 @@ type Strategy =
475475

476476
module System =
477477
/// Creates an actor system with remote deployment serialization enabled.
478-
let create (name : string) (config : Akka.Configuration.Config) : ActorSystem =
478+
let create (name : string) (config : Hocon.Config) : ActorSystem =
479479
let system = ActorSystem.Create(name, config)
480480
Serialization.exprSerializationSupport system
481481
system

src/core/Akka.Persistence.TestKit.Xunit2/PersistenceTestKit.cs

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// </copyright>
66
//-----------------------------------------------------------------------
77

8+
using Hocon;
9+
810
namespace Akka.Persistence.TestKit
911
{
1012
using System;

src/core/Akka.Remote.TestKit/MultiNodeSpec.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -617,10 +617,10 @@ protected void InjectDeployments(ActorSystem system, RoleName role)
617617
});
618618
foreach (var pair in ConfigurationFactory.ParseString(deployString).AsEnumerable())
619619
{
620-
if (pair.Value.IsObject())
620+
if (pair.Value.Type == HoconType.Object)
621621
{
622622
var deploy =
623-
deployer.ParseConfig(pair.Key, new Config(new HoconRoot(pair.Value)));
623+
deployer.ParseConfig(pair.Key, new Config(new HoconRoot(pair.Value.Value)));
624624
deployer.SetDeploy(deploy);
625625
}
626626
else

src/core/Akka.Tests/Configuration/ConfigurationSpec.cs

+16-15
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using Akka.TestKit;
1717
using Xunit;
1818
using Xunit.Abstractions;
19+
using FluentAssertions;
1920

2021
namespace Akka.Tests.Configuration
2122
{
@@ -75,23 +76,23 @@ public void Deserializes_hocon_configuration_from_net_config_file()
7576
}
7677
#endif
7778

78-
[Fact]
79-
public void Can_create_config_from_source_object()
80-
{
81-
var source = new MyObjectConfig
82-
{
83-
StringProperty = "aaa",
84-
BoolProperty = true,
85-
IntegerArray = new[] {1, 2, 3, 4}
86-
};
79+
//[Fact]
80+
//public void Can_create_config_from_source_object()
81+
//{
82+
// var source = new MyObjectConfig
83+
// {
84+
// StringProperty = "aaa",
85+
// BoolProperty = true,
86+
// IntegerArray = new[] {1, 2, 3, 4}
87+
// };
8788

88-
var config = ConfigurationFactory.FromObject(source);
89+
// var config = ConfigurationFactory.FromObject(source);
8990

90-
Assert.Equal("aaa", config.GetString("StringProperty"));
91-
Assert.True(config.GetBoolean("BoolProperty"));
91+
// Assert.Equal("aaa", config.GetString("StringProperty"));
92+
// Assert.True(config.GetBoolean("BoolProperty"));
9293

93-
Assert.Equal(new[] {1, 2, 3, 4}, config.GetIntList("IntegerArray").ToArray());
94-
}
94+
// Assert.Equal(new[] {1, 2, 3, 4}, config.GetIntList("IntegerArray").ToArray());
95+
//}
9596

9697
[Fact]
9798
public void Can_merge_objects()
@@ -176,7 +177,7 @@ public class MyObjectConfig
176177
public void Parsing_empty_string_should_produce_empty_hocon_root()
177178
{
178179
var value = Parser.Parse(string.Empty, null).Value;
179-
value.IsEmpty.ShouldBeTrue();
180+
value.Type.Should().Be(HoconType.Empty);
180181
}
181182

182183
[Fact]

0 commit comments

Comments
 (0)