[Groonga-commit] groonga/gcs [master] Delete obsolete tests

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Nov 26 19:46:27 JST 2012


YUKI Hiroshi	2012-11-26 19:46:27 +0900 (Mon, 26 Nov 2012)

  New Revision: ef6778e5aa149476122678061d88983ae7f53c5f
  https://github.com/groonga/gcs/commit/ef6778e5aa149476122678061d88983ae7f53c5f

  Log:
    Delete obsolete tests

  Modified files:
    test/api-configuration.test.js

  Modified: test/api-configuration.test.js (+2 -371)
===================================================================
--- test/api-configuration.test.js    2012-11-26 19:41:41 +0900 (9f74192)
+++ test/api-configuration.test.js    2012-11-26 19:46:27 +0900 (d06af5c)
@@ -332,7 +332,7 @@ suite('Configuration API', function() {
     setup(commonSetup);
     teardown(commonTeardown);
 
-    test('(text, without options)', function(done) {
+    test('define a valid index field', function(done) {
       utils
         .get('/?DomainName=companies&Action=CreateDomain&Version=2011-02-01')
         .get('/?DomainName=companies&IndexField.IndexFieldName=name&' +
@@ -342,202 +342,6 @@ suite('Configuration API', function() {
           var domain = new Domain('companies', context);
           var field = domain.getIndexField('name');
           assert.isTrue(field.exists(), response.body);
-
-          response = xmlResponses.toParsedResponse(response);
-          assert.equal(response.statusCode, 200);
-          var expectedOptions = {
-                IndexFieldName: 'name',
-                IndexFieldType: 'text'
-              };
-          var options = response.body.DefineIndexFieldResponse.DefineIndexFieldResult.IndexField.Options;
-          assert.deepEqual(options, expectedOptions);
-
-          done();
-        })
-        .error(function(error) {
-          done(error);
-        });
-    });
-
-    test('(text, with options)', function(done) {
-      utils
-        .get('/?DomainName=companies&Action=CreateDomain&Version=2011-02-01')
-        .get('/?DomainName=companies&IndexField.IndexFieldName=name&' +
-             'IndexField.IndexFieldType=text&' +
-             'IndexField.TextOptions.ResultEnabled=true&' +
-             'Action=DefineIndexField&Version=2011-02-01')
-        .next(function(response) {
-          var domain = new Domain('companies', context);
-          var field = domain.getIndexField('name');
-          assert.isTrue(field.exists(), response.body);
-
-          response = xmlResponses.toParsedResponse(response);
-          assert.equal(response.statusCode, 200);
-          var expectedOptions = {
-                IndexFieldName: 'name',
-                IndexFieldType: 'text',
-                TextOptions: {
-                  ResultEnabled: 'true'
-                }
-              };
-          var options = response.body.DefineIndexFieldResponse.DefineIndexFieldResult.IndexField.Options;
-          assert.deepEqual(options, expectedOptions);
-
-          done();
-        })
-        .error(function(error) {
-          done(error);
-        });
-    });
-
-    test('(uint)', function(done) {
-      utils
-        .get('/?DomainName=companies&Action=CreateDomain&Version=2011-02-01')
-        .get('/?DomainName=companies&IndexField.IndexFieldName=age&' +
-             'IndexField.IndexFieldType=uint&' +
-             'Action=DefineIndexField&Version=2011-02-01')
-        .next(function(response) {
-          var domain = new Domain('companies', context);
-          var field = domain.getIndexField('age');
-          assert.isTrue(field.exists(), response.body);
-
-          response = xmlResponses.toParsedResponse(response);
-          assert.equal(response.statusCode, 200);
-          var expectedOptions = {
-                IndexFieldName: 'age',
-                IndexFieldType: 'uint'
-              };
-          var options = response.body.DefineIndexFieldResponse.DefineIndexFieldResult.IndexField.Options;
-          assert.deepEqual(options, expectedOptions);
-
-          done();
-        })
-        .error(function(error) {
-          done(error);
-        });
-    });
-
-    test('(literal, without options)', function(done) {
-      utils
-        .get('/?DomainName=companies&Action=CreateDomain&Version=2011-02-01')
-        .get('/?DomainName=companies&IndexField.IndexFieldName=product&' +
-             'IndexField.IndexFieldType=literal&' +
-             'Action=DefineIndexField&Version=2011-02-01')
-        .next(function(response) {
-          var domain = new Domain('companies', context);
-          var field = domain.getIndexField('product');
-          assert.isTrue(field.exists(), response.body);
-
-          response = xmlResponses.toParsedResponse(response);
-          assert.equal(response.statusCode, 200);
-          var expectedOptions = {
-                IndexFieldName: 'product',
-                IndexFieldType: 'literal'
-              };
-          var options = response.body.DefineIndexFieldResponse.DefineIndexFieldResult.IndexField.Options;
-          assert.deepEqual(options, expectedOptions);
-
-          done();
-        })
-        .error(function(error) {
-          done(error);
-        });
-    });
-
-    test('(literal, with options)', function(done) {
-      utils
-        .get('/?DomainName=companies&Action=CreateDomain&Version=2011-02-01')
-        .get('/?DomainName=companies&IndexField.IndexFieldName=product&' +
-             'IndexField.IndexFieldType=literal&' +
-             'IndexField.LiteralOptions.SearchEnabled=true&' +
-             'IndexField.LiteralOptions.ResultEnabled=true&' +
-             'Action=DefineIndexField&Version=2011-02-01')
-        .next(function(response) {
-          var domain = new Domain('companies', context);
-          var field = domain.getIndexField('product');
-          assert.isTrue(field.exists(), response.body);
-
-          response = xmlResponses.toParsedResponse(response);
-          assert.equal(response.statusCode, 200);
-          var expectedOptions = {
-                IndexFieldName: 'product',
-                IndexFieldType: 'literal',
-                LiteralOptions: {
-                  ResultEnabled: 'true',
-                  SearchEnabled: 'true'
-                }
-              };
-          var options = response.body.DefineIndexFieldResponse.DefineIndexFieldResult.IndexField.Options;
-          assert.deepEqual(options, expectedOptions);
-
-          done();
-        })
-        .error(function(error) {
-          done(error);
-        });
-    });
-
-    test('(with too short (one character) domain name)', function(done) {
-      utils
-        .get('/?DomainName=' + TOO_SHORT_1_LETTER_DOMAIN_NAME + '&IndexField.IndexFieldName=product&' +
-             'IndexField.IndexFieldType=literal&' +
-             'Action=DefineIndexField&Version=2011-02-01')
-        .next(function(response) {
-          assertValidationErrorResponse(
-            TOO_SHORT_1_LETTER_DOMAIN_NAME_ERROR_MESSAGE,
-            response
-          );
-          done();
-        })
-        .error(function(error) {
-          done(error);
-        });
-    });
-
-    test('Action=DeleteDomain for too short (two characters) domain name', function(done) {
-      utils
-        .get('/?DomainName=' + TOO_SHORT_2_LETTERS_DOMAIN_NAME + '&IndexField.IndexFieldName=product&' +
-             'IndexField.IndexFieldType=literal&' +
-             'Action=DefineIndexField&Version=2011-02-01')
-        .next(function(response) {
-          assertValidationErrorResponse(
-            TOO_SHORT_2_LETTERS_DOMAIN_NAME_ERROR_MESSAGE,
-            response
-          );
-          done();
-        })
-        .error(function(error) {
-          done(error);
-        });
-    });
-
-    test('Action=DeleteDomain for too long domain name', function(done) {
-      utils
-        .get('/?DomainName=' + TOO_LONG_DOMAIN_NAME + '&IndexField.IndexFieldName=product&' +
-             'IndexField.IndexFieldType=literal&' +
-             'Action=DefineIndexField&Version=2011-02-01')
-        .next(function(response) {
-          assertValidationErrorResponse(
-            TOO_LONG_DOMAIN_NAME_ERROR_MESSAGE,
-            response
-          );
-          done();
-        })
-        .error(function(error) {
-          done(error);
-        });
-    });
-
-    test('Action=DeleteDomain for without name', function(done) {
-      utils
-        .get('/?DomainName=&IndexField.IndexFieldName=product&' +
-             'IndexField.IndexFieldType=literal&' +
-             'Action=DefineIndexField&Version=2011-02-01')
-        .next(function(response) {
-          assertValidationErrorResponse(
-            NO_DOMAIN_NAME_ERROR_MESSAGE,
-            response
-          );
           done();
         })
         .error(function(error) {
@@ -550,7 +354,7 @@ suite('Configuration API', function() {
     setup(commonSetup);
     teardown(commonTeardown);
 
-    test('(text)', function(done) {
+    test('delete an index field', function(done) {
       var domain, field;
       utils
         .get('/?DomainName=companies&Action=CreateDomain&Version=2011-02-01')
@@ -568,179 +372,6 @@ suite('Configuration API', function() {
                              field:  field.exists() },
                            { domain: true,
                              field:  false });
-
-          response = xmlResponses.toParsedResponse(response);
-          assert.equal(response.statusCode, 200);
-
-          done();
-        })
-        .error(function(error) {
-          done(error);
-        });
-    });
-
-    test('(uint)', function(done) {
-      var domain, field;
-      utils
-        .get('/?DomainName=companies&Action=CreateDomain&Version=2011-02-01')
-        .get('/?DomainName=companies&IndexField.IndexFieldName=age&' +
-             'IndexField.IndexFieldType=uint&' +
-             'Action=DefineIndexField&Version=2011-02-01')
-        .next(function() {
-          domain = new Domain('companies', context);
-          field = domain.getIndexField('age');
-        })
-        .get('/?DomainName=companies&IndexFieldName=age&' +
-             'Action=DeleteIndexField&Version=2011-02-01')
-        .next(function(response) {
-          assert.deepEqual({ domain: domain.exists(),
-                             field:  field.exists() },
-                           { domain: true,
-                             field:  false });
-
-          response = xmlResponses.toParsedResponse(response);
-          assert.equal(response.statusCode, 200);
-
-          done();
-        })
-        .error(function(error) {
-          done(error);
-        });
-    });
-
-    test('(literal)', function(done) {
-      var domain, field;
-      utils
-        .get('/?DomainName=companies&Action=CreateDomain&Version=2011-02-01')
-        .get('/?DomainName=companies&IndexField.IndexFieldName=product&' +
-             'IndexField.IndexFieldType=literal&' +
-             'Action=DefineIndexField&Version=2011-02-01')
-        .next(function() {
-          domain = new Domain('companies', context);
-          field = domain.getIndexField('product');
-        })
-        .get('/?DomainName=companies&IndexFieldName=product&' +
-             'Action=DeleteIndexField&Version=2011-02-01')
-        .next(function(response) {
-          assert.deepEqual({ domain: domain.exists(),
-                             field:  field.exists() },
-                           { domain: true,
-                             field:  false });
-
-          response = xmlResponses.toParsedResponse(response);
-          assert.equal(response.statusCode, 200);
-
-          done();
-        })
-        .error(function(error) {
-          done(error);
-        });
-    });
-
-    test('not existing', function(done) {
-      var domain, field;
-      utils
-        .get('/?DomainName=companies&Action=CreateDomain&Version=2011-02-01')
-        .get('/?DomainName=companies&IndexFieldName=product&' +
-             'Action=DeleteIndexField&Version=2011-02-01')
-        .next(function(response) {
-          response = xmlResponses.toParsedResponse(response);
-          assert.equal(response.statusCode, 200);
-          done();
-        })
-        .error(function(error) {
-          done(error);
-        });
-    });
-  });
-
-  suite('Action=DescribeIndexFields', function() {
-    setup(function() {
-      commonSetup();
-      var domain = new Domain('companies', context);
-      domain.createSync();
-      domain.getIndexField('name').setType('text').createSync();
-      domain.getIndexField('age').setType('uint').createSync();
-      domain.getIndexField('product').setType('literal').createSync();
-    });
-    teardown(commonTeardown);
-
-    function getActualDescribedFields(response) {
-      var members = response.body.DescribeIndexFieldsResponse
-                                 .DescribeIndexFieldsResult
-                                 .IndexFields
-                                 .member;
-      var fields = [];
-      for (var i in members) {
-        if (members.hasOwnProperty(i))
-          fields.push(members[i].Options.IndexFieldName);
-      }
-      return fields;
-    }
-
-    test('all', function(done) {
-      utils
-        .get('/?DomainName=companies&' +
-             'Action=DescribeIndexFields&Version=2011-02-01')
-        .next(function(response) {
-          var expectedFields = ['age', 'name', 'product'];
-          response = xmlResponses.toParsedResponse(response);
-          assert.deepEqual(response.pattern,
-                           { statusCode: 200,
-                             body: xmlResponses.DescribeIndexFieldsResponse([
-                               xmlResponses.IndexFieldStatus_NoOption,
-                               xmlResponses.IndexFieldStatus_NoOption,
-                               xmlResponses.IndexFieldStatus_NoOption
-                             ]) });
-
-          var actualFields = getActualDescribedFields(response);
-          assert.deepEqual(actualFields, expectedFields);
-
-          done();
-        })
-        .error(function(error) {
-          done(error);
-        });
-    });
-
-    test('specified', function(done) {
-      utils
-        .get('/?DomainName=companies&FieldNames.member.1=name&FieldNames.member.2=age&' +
-             'Action=DescribeIndexFields&Version=2011-02-01')
-        .next(function(response) {
-          var expectedFields = ['age', 'name'];
-          response = xmlResponses.toParsedResponse(response);
-          assert.deepEqual(response.pattern,
-                           { statusCode: 200,
-                             body: xmlResponses.DescribeIndexFieldsResponse([
-                               xmlResponses.IndexFieldStatus_NoOption,
-                               xmlResponses.IndexFieldStatus_NoOption
-                             ]) });
-
-          var actualFields = getActualDescribedFields(response);
-          assert.deepEqual(actualFields, expectedFields);
-
-          done();
-        })
-        .error(function(error) {
-          done(error);
-        });
-    });
-
-    test('specified (not exists)', function(done) {
-      utils
-        .get('/?DomainName=companies&FieldNames.member.1=unknown&' +
-             'Action=DescribeIndexFields&Version=2011-02-01')
-        .next(function(response) {
-          var expectedFields = [];
-          response = xmlResponses.toParsedResponse(response);
-          assert.deepEqual(response.pattern,
-                           { statusCode: 200,
-                             body: xmlResponses.DescribeIndexFieldsResponse([]) });
-
-          var actualFields = getActualDescribedFields(response);
-          assert.deepEqual(actualFields, expectedFields);
-
           done();
         })
         .error(function(error) {
-------------- next part --------------
HTML����������������������������...
Download 



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