Permalink
Browse files

Merge remote-tracking branch 'origin/master'

  • Loading branch information...
2 parents 24ea521 + 7ee342c commit fa138a1615d4b14f5db66f237a3eb03ecba843e8 @nberardi nberardi committed Sep 12, 2012
@@ -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));
}
}
@@ -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);
+ }
+ }
+ }
+}
@@ -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" />

0 comments on commit fa138a1

Please sign in to comment.