[Groonga-commit] droonga/express-droonga at d03ff52 [master] Compare order of connections, not their name.

アーカイブの一覧に戻る

YUKI Piro Hiroshi null+****@clear*****
Sat Oct 18 00:05:55 JST 2014


YUKI "Piro" Hiroshi	2014-10-18 00:05:55 +0900 (Sat, 18 Oct 2014)

  New Revision: d03ff52eec3e6d2294315a86bb285c4e77e8b7d9
  https://github.com/droonga/express-droonga/commit/d03ff52eec3e6d2294315a86bb285c4e77e8b7d9

  Message:
    Compare order of connections, not their name.
    
    Now the initial index of the connection returned by ConnectionPool#get() is determined at random.

  Modified files:
    test/droonga-protocol/connection-pool.test.js

  Modified: test/droonga-protocol/connection-pool.test.js (+23 -5)
===================================================================
--- test/droonga-protocol/connection-pool.test.js    2014-10-17 23:51:51 +0900 (024b19e)
+++ test/droonga-protocol/connection-pool.test.js    2014-10-18 00:05:55 +0900 (9f4ac88)
@@ -74,21 +74,39 @@ suite('ConnectionPool', function() {
           '127.0.0.3'
         ]
       });
-      var connection = connectionPool.get();
+      var connections = [];
+      var connection;
+
+      connection = connectionPool.get();
       assert.isNotNull(connection);
-      assert.equal(connection.hostName, '127.0.0.1');
+      connections.push(connection);
 
       connection = connectionPool.get();
       assert.isNotNull(connection);
-      assert.equal(connection.hostName, '127.0.0.2');
+      connections.push(connection);
 
       connection = connectionPool.get();
       assert.isNotNull(connection);
-      assert.equal(connection.hostName, '127.0.0.3');
+      connections.push(connection);
 
       connection = connectionPool.get();
       assert.isNotNull(connection);
-      assert.equal(connection.hostName, '127.0.0.1');
+      connections.push(connection);
+
+      connection = connectionPool.get();
+      assert.isNotNull(connection);
+      connections.push(connection);
+
+      connection = connectionPool.get();
+      assert.isNotNull(connection);
+      connections.push(connection);
+
+      assert.equal([connections[0].hostName,
+                    connections[1].hostName,
+                    connections[2].hostName],
+                   [connections[3].hostName,
+                    connections[4].hostName,
+                    connections[5].hostName]);
     });
   });
 });
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る