[Groonga-commit] groonga/express-kotoumi [master] test: Update codes which using Connection#emitMessage for the new interface

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Jan 29 15:21:54 JST 2013


YUKI Hiroshi	2013-01-29 15:21:54 +0900 (Tue, 29 Jan 2013)

  New Revision: 467256a75df0a3ba7b586abd748853fecf3e4734
  https://github.com/groonga/express-kotoumi/commit/467256a75df0a3ba7b586abd748853fecf3e4734

  Log:
    test: Update codes which using Connection#emitMessage for the new interface

  Modified files:
    test/backend-connection.test.js

  Modified: test/backend-connection.test.js (+20 -6)
===================================================================
--- test/backend-connection.test.js    2013-01-29 15:21:21 +0900 (46cc1bc)
+++ test/backend-connection.test.js    2013-01-29 15:21:54 +0900 (ae61a0b)
@@ -194,7 +194,9 @@ suite('Connection, basic features', function() {
     Deferred
       .wait(0.01)
       .next(function() {
-        message = connection.emitMessage('testRequest', { command: 'foobar' }, callback);
+        message = connection.emitMessage('testRequest', { command: 'foobar' }, {
+          callback: callback
+        });
         assert.envelopeEqual(message,
                              createExpectedEnvelope('testRequest', { command: 'foobar' }));
       })
@@ -232,7 +234,9 @@ suite('Connection, basic features', function() {
     Deferred
       .wait(0.01)
       .next(function() {
-        message = connection.emitMessage('testRequest', { command: 'foobar' }, callback);
+        message = connection.emitMessage('testRequest', { command: 'foobar' }, {
+          callback: callback
+        });
         assert.envelopeEqual(message,
                              createExpectedEnvelope('testRequest', { command: 'foobar' }));
       })
@@ -264,7 +268,10 @@ suite('Connection, basic features', function() {
     Deferred
       .wait(0.01)
       .next(function() {
-        message = connection.emitMessage('testRequest', { command: 'foobar' }, callback, 1000);
+        message = connection.emitMessage('testRequest', { command: 'foobar' }, {
+          callback: callback,
+          timeout:  1000
+        });
         assert.envelopeEqual(message,
                              createExpectedEnvelope('testRequest', { command: 'foobar' }));
       })
@@ -296,7 +303,12 @@ suite('Connection, basic features', function() {
     Deferred
       .wait(0.01)
       .next(function() {
-        message = connection.emitMessage('testRequest', { command: 'foobar' }, callback, 1);
+        callback.takes(Connection.ERROR_GATEWAY_TIMEOUT, null);
+        message = connection.emitMessage('testRequest', { command: 'foobar' }, {
+          callback: callback,
+          timeout:  1,
+          delay:    1000
+        });
         assert.envelopeEqual(message,
                              createExpectedEnvelope('testRequest', { command: 'foobar' }));
       })
@@ -306,7 +318,6 @@ suite('Connection, basic features', function() {
         assert.deepEqual(backend.received[0][2], message);
         assert.equal(connection.listeners('inReplyTo:' + message.id).length, 1);
 
-        callback.takes(Connection.ERROR_GATEWAY_TIMEOUT, null);
       })
       .wait(0.01)
       .next(function() {
@@ -327,7 +338,10 @@ suite('Connection, basic features', function() {
     Deferred
       .wait(0.01)
       .next(function() {
-        message = connection.emitMessage('testRequest', { command: 'foobar' }, callback, -1);
+        message = connection.emitMessage('testRequest', { command: 'foobar' }, {
+          callback: callback,
+          timeout:  -1
+        });
         assert.envelopeEqual(message,
                              createExpectedEnvelope('testRequest', { command: 'foobar' }));
       })
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index