Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote-tracking branch 'origin/master'

  • Loading branch information...
commit fa138a1615d4b14f5db66f237a3eb03ecba843e8 2 parents 24ea521 + 7ee342c
Nick Berardi nberardi authored
2  src/Connections/ConnectionBuilder.cs
View
@@ -341,7 +341,7 @@ private void InitializeConnectionString(string connectionString)
Servers.Add(new Server(host: host, timeout: ConnectionTimeout.Seconds));
}
else
- Servers.Add(new Server(host));
+ Servers.Add(new Server(host: host, timeout: ConnectionTimeout.Seconds));
}
}
57 test/FluentCassandra.Tests/Bugs/Issue65ServerTimeoutLost.cs
View
@@ -0,0 +1,57 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Xunit;
+using FluentCassandra.Connections;
+
+namespace FluentCassandra.Bugs
+{
+ public class Issue65ServerTimeoutLost
+ {
+ [Fact]
+ public void TestSingleServerWithHostAndPort()
+ {
+ Assert.Equal(5, new ConnectionBuilder("Server=host:123;Connection Timeout=5").Servers[0].Timeout);
+ }
+
+ [Fact]
+ public void TestSingleServerWithHostAndDefaultPort()
+ {
+ Assert.Equal(5, new ConnectionBuilder("Server=host;Connection Timeout=5").Servers[0].Timeout);
+ }
+
+ [Fact]
+ public void TestMultipleServersWithHostAndPort()
+ {
+ var servers = new ConnectionBuilder("Server=host:123,host2:456,host3:789;Connection Timeout=5").Servers;
+ Assert.Equal(3, servers.Count);
+ foreach (var server in servers)
+ {
+ Assert.Equal(5, server.Timeout);
+ }
+ }
+
+ [Fact]
+ public void TestMultipleServersWithHostAndDefaultPort()
+ {
+ var servers = new ConnectionBuilder("Server=host,host2,host3;Connection Timeout=5").Servers;
+ Assert.Equal(3, servers.Count);
+ foreach (var server in servers)
+ {
+ Assert.Equal(5, server.Timeout);
+ }
+ }
+
+ [Fact]
+ public void TestMultipleServersWithHostAndMixedPorts()
+ {
+ var servers = new ConnectionBuilder("Server=host:123,host2,host3:789;Connection Timeout=5").Servers;
+ Assert.Equal(3, servers.Count);
+ foreach (var server in servers)
+ {
+ Assert.Equal(5, server.Timeout);
+ }
+ }
+ }
+}
1  test/FluentCassandra.Tests/FluentCassandra.Tests.csproj
View
@@ -56,6 +56,7 @@
<Compile Include="Bugs\Issue25JavaBigDecimalBinaryConversion.cs" />
<Compile Include="Bugs\Issue36KeyAliasSupport.cs" />
<Compile Include="Bugs\Issue39CompositeTypeAsKey.cs" />
+ <Compile Include="Bugs\Issue65ServerTimeoutLost.cs" />
<Compile Include="CassandraDatabaseSetupFixture.cs" />
<Compile Include="CassandraQueryTest.cs" />
<Compile Include="Connections\ConnectionProviderTests.cs" />
Please sign in to comment.
Something went wrong with that request. Please try again.