Permalink
Browse files

Rename ConnectionFactory to ConnectionFactoryFactory.

  • Loading branch information...
1 parent cf2bb52 commit 0e4a824b58134d4b597399765083fda3949b1d7a @lanwin lanwin committed Jul 6, 2010
@@ -37,7 +37,7 @@ private QueryMessage GenerateQueryMessage()
[Test]
public void TestReconnectOnce()
{
- var conn = ConnectionFactory.GetConnection(string.Empty);
+ var conn = ConnectionFactoryFactory.GetConnection(string.Empty);
conn.Open();
WriteBadMessage(conn);
@@ -60,7 +60,7 @@ public void TestReconnectOnce()
public void TestSendQueryMessage()
{
//Connection conn = new Connection("10.141.153.2");
- var conn = ConnectionFactory.GetConnection(string.Empty);
+ var conn = ConnectionFactoryFactory.GetConnection(string.Empty);
conn.Open();
var qmsg = GenerateQueryMessage();
@@ -9,32 +9,32 @@ public class TestConnectionFactory
{
[TearDown]
public void TearDown (){
- ConnectionFactory.Shutdown ();
+ ConnectionFactoryFactory.Shutdown ();
}
[Test]
public void TestGetConnection (){
- var connection1 = ConnectionFactory.GetConnection (string.Empty);
- var connection2 = ConnectionFactory.GetConnection (string.Empty);
+ var connection1 = ConnectionFactoryFactory.GetConnection (string.Empty);
+ var connection2 = ConnectionFactoryFactory.GetConnection (string.Empty);
Assert.IsNotNull (connection1);
Assert.IsNotNull (connection2);
- Assert.AreEqual (1, ConnectionFactory.PoolCount);
+ Assert.AreEqual (1, ConnectionFactoryFactory.PoolCount);
}
[Test]
public void TestCreatePoolForEachUniqeConnectionString (){
- ConnectionFactory.GetConnection (string.Empty);
- ConnectionFactory.GetConnection (string.Empty);
- ConnectionFactory.GetConnection ("Username=test");
- ConnectionFactory.GetConnection ("Username=test");
- ConnectionFactory.GetConnection ("Server=localhost");
- Assert.AreEqual (3, ConnectionFactory.PoolCount);
+ ConnectionFactoryFactory.GetConnection (string.Empty);
+ ConnectionFactoryFactory.GetConnection (string.Empty);
+ ConnectionFactoryFactory.GetConnection ("Username=test");
+ ConnectionFactoryFactory.GetConnection ("Username=test");
+ ConnectionFactoryFactory.GetConnection ("Server=localhost");
+ Assert.AreEqual (3, ConnectionFactoryFactory.PoolCount);
}
[Test]
public void TestExceptionWhenMinimumPoolSizeIsGreaterThenMaximumPoolSize (){
try{
- ConnectionFactory.GetConnection("MinimumPoolSize=50; MaximumPoolSize=10");
+ ConnectionFactoryFactory.GetConnection("MinimumPoolSize=50; MaximumPoolSize=10");
}catch(ArgumentException){
}catch(Exception){
Assert.Fail("Wrong exception thrown");
@@ -11,7 +11,7 @@ public class TestPooledConnectionFactory
[TestFixtureSetUp]
public void SetUp()
{
- ConnectionFactory.Shutdown();
+ ConnectionFactoryFactory.Shutdown();
}
[Test]
@@ -126,7 +126,7 @@ private static void TryInsertData(Mongo mongo)
}
// clean connections
- ConnectionFactory.Shutdown();
+ ConnectionFactoryFactory.Shutdown();
}
}
}
@@ -10,7 +10,7 @@ public class TestPooledConnectionFactory
[TestFixtureSetUp]
public void SetUp()
{
- ConnectionFactory.Shutdown();
+ ConnectionFactoryFactory.Shutdown();
}
[Test]
@@ -7,17 +7,17 @@ namespace MongoDB.Connections
/// <summary>
///
/// </summary>
- internal static class ConnectionFactory
+ internal static class ConnectionFactoryFactory
{
private static readonly TimeSpan MaintenaceWakeup = TimeSpan.FromSeconds(10);
private static readonly Timer MaintenanceTimer = new Timer(o => OnMaintenaceWakeup());
private static readonly Dictionary<string, IConnectionFactory> Factorys = new Dictionary<string, IConnectionFactory>();
private static readonly object SyncObject = new object();
/// <summary>
- /// Initializes the <see cref="ConnectionFactory"/> class.
+ /// Initializes the <see cref="ConnectionFactoryFactory"/> class.
/// </summary>
- static ConnectionFactory()
+ static ConnectionFactoryFactory()
{
MaintenanceTimer.Change(MaintenaceWakeup, MaintenaceWakeup);
}
@@ -42,7 +42,7 @@ public Mongo(string connectionString)
configuration.ValidateAndSeal();
_configuration = configuration;
- _connection = ConnectionFactory.GetConnection(configuration.ConnectionString);
+ _connection = ConnectionFactoryFactory.GetConnection(configuration.ConnectionString);
}
/// <summary>
@@ -273,7 +273,7 @@
<Compile Include="Connections\RawConnection.cs" />
<Compile Include="CollectionMetadata.cs" />
<Compile Include="Connections\Connection.cs" />
- <Compile Include="Connections\ConnectionFactory.cs" />
+ <Compile Include="Connections\ConnectionFactoryFactory.cs" />
<Compile Include="Connections\ConnectionFactoryBase.cs" />
<Compile Include="Connections\IConnectionFactory.cs" />
<Compile Include="Connections\PooledConnectionFactory.cs" />
@@ -31,7 +31,7 @@ public MongoDatabase(string connectionString)
/// <param name="configuration">The configuration.</param>
public MongoDatabase(MongoConfiguration configuration)
: this(configuration,
- ConnectionFactory.GetConnection(configuration.ConnectionString),
+ ConnectionFactoryFactory.GetConnection(configuration.ConnectionString),
new MongoConnectionStringBuilder(configuration.ConnectionString).Database)
{
//Todo: Add check for null

0 comments on commit 0e4a824

Please sign in to comment.