[Groonga-commit] groonga/gcs [master] Add tests for getSearchEndpoint() and getDocumentsEndPoint()

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Aug 22 19:52:09 JST 2012


YUKI Hiroshi	2012-08-22 19:52:09 +0900 (Wed, 22 Aug 2012)

  New Revision: 6c722c50bcecc4a7df3a83d13de8b87650ec2bae
  https://github.com/groonga/gcs/commit/6c722c50bcecc4a7df3a83d13de8b87650ec2bae

  Log:
    Add tests for getSearchEndpoint() and getDocumentsEndPoint()

  Modified files:
    test/database-domain.test.js

  Modified: test/database-domain.test.js (+44 -0)
===================================================================
--- test/database-domain.test.js    2012-08-22 19:46:34 +0900 (e8d83e6)
+++ test/database-domain.test.js    2012-08-22 19:52:09 +0900 (abd7bc7)
@@ -194,6 +194,50 @@ suite('database', function() {
       });
     });
 
+    suite('getDocumentsEndpoint', function() {
+      var domain;
+      setup(function() {
+        domain = new Domain('valid').setId(Domain.DEFAULT_ID);
+      });
+
+      test('regular domain', function() {
+        assert.equal(domain.getDocumentsEndpoint('my.domain:0123'),
+                     'doc-valid-' + Domain.DEFAULT_ID + '.my.domain:0123');
+      });
+
+      test('IP address', function() {
+        assert.equal(domain.getDocumentsEndpoint('192.168.0.1:4567'),
+                     'doc-valid-' + Domain.DEFAULT_ID + '.192.168.0.1.xip.io:4567');
+      });
+
+      test('localhost', function() {
+        assert.equal(domain.getDocumentsEndpoint('localhost:4567'),
+                     'doc-valid-' + Domain.DEFAULT_ID + '.127.0.0.1.xip.io:4567');
+      });
+    });
+
+    suite('getSearchEndpoint', function() {
+      var domain;
+      setup(function() {
+        domain = new Domain('valid').setId(Domain.DEFAULT_ID);
+      });
+
+      test('regular domain', function() {
+        assert.equal(domain.getSearchEndpoint('my.domain:0123'),
+                     'search-valid-' + Domain.DEFAULT_ID + '.my.domain:0123');
+      });
+
+      test('IP address', function() {
+        assert.equal(domain.getSearchEndpoint('192.168.0.1:4567'),
+                     'search-valid-' + Domain.DEFAULT_ID + '.192.168.0.1.xip.io:4567');
+      });
+
+      test('localhost', function() {
+        assert.equal(domain.getSearchEndpoint('localhost:4567'),
+                     'search-valid-' + Domain.DEFAULT_ID + '.127.0.0.1.xip.io:4567');
+      });
+    });
+
     suite('getting data from database', function() {
       var temporaryDatabase;
       var context;
-------------- next part --------------
HTML����������������������������...
Download 



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