Skip to content

added spec to try to reproduce duplicate config section #262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions src/Hocon.Configuration.Test/ConfigurationSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,65 @@ public void CanEnumerateQuotedKeys()
Assert.Equal("some quoted, key", enumerable.Select(kvp => kvp.Key).First());
}

[Fact]
public void CanParseDuplicateKeys()
{
var hocon = @"
akka{
loglevel=INFO
loggers=[""Akka.Logger.Serilog.SerilogLogger, Akka.Logger.Serilog""]

remote {
log-remote-lifecycle-events = DEBUG
dot-netty.tcp {
port = 0
hostname = localhost
send-buffer-size = 60000000b
receive-buffer-size = 60000000b
maximum-frame-size = 30000000b
}
}

actor.provider = cluster

# duplicate
remote {
log-remote-lifecycle-events = DEBUG
dot-netty.tcp {
port = 0
hostname = localhost
send-buffer-size = 60000000b
receive-buffer-size = 60000000b
maximum-frame-size = 30000000b
}
}

cluster {
allow-weakly-up-members = on
seed-nodes = [""akka.tcp://ClusterSys@localhost:3881""]
roles = [pubsub,webapi]

failure-detector {
acceptable-heartbeat-pause=8s
}

pub-sub {
role = pubsub
}
downing-provider-class = ""Akka.Cluster.SplitBrainResolver, Akka.Cluster""
split-brain-resolver {
active-strategy = keep-majority
stable-after = 30s
}
down-removal-margin = 30s
}
}
";
var config = HoconConfigurationFactory.ParseString(hocon);
var config2 = config.GetConfig("akka.remote");
config2.GetString("dot-netty.tcp.hostname").Should().Be("localhost");
}

/// <summary>
/// Should follow the load order rules specified in https://github.com/akkadotnet/HOCON/issues/151
/// </summary>
Expand Down