[Groonga-commit] groonga/gcs [master] Add tests for DeleteDomain with invalid domain names

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Nov 5 16:36:11 JST 2012


YUKI Hiroshi	2012-11-05 16:36:11 +0900 (Mon, 05 Nov 2012)

  New Revision: 37d6e94bc06e1dfcd5fe42d7a61cbe6c9f8b9a68
  https://github.com/groonga/gcs/commit/37d6e94bc06e1dfcd5fe42d7a61cbe6c9f8b9a68

  Log:
    Add tests for DeleteDomain with invalid domain names

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

  Modified: test/api-configuration.test.js (+60 -0)
===================================================================
--- test/api-configuration.test.js    2012-11-05 16:30:30 +0900 (fdffd8e)
+++ test/api-configuration.test.js    2012-11-05 16:36:11 +0900 (c78b7e3)
@@ -231,6 +231,66 @@ suite('Configuration API', function() {
         });
     });
 
+    test('Action=DeleteDomain for too short (one character) domain name', function(done) {
+      utils
+        .get('/?DomainName=a&Action=DeleteDomain&Version=2011-02-01')
+        .next(function(response) {
+          assertValidationErrorResponse(
+            '2 validation errors detected: ' +
+              'Value \'a\' at \'domainName\' failed to satisfy constraint: ' +
+                'Member must satisfy regular expression pattern: ' +
+                  Domain.VALID_NAME_PATTERN + '; ' +
+              'Value \'a\' at \'domainName\' failed to satisfy constraint: ' +
+                'Member must have length greater than or equal to ' +
+                  Domain.MINIMUM_NAME_LENGTH,
+            response
+          );
+          done();
+        })
+        .error(function(error) {
+          done(error);
+        });
+    });
+
+    test('Action=DeleteDomain for too short (two characters) domain name', function(done) {
+      utils
+        .get('/?DomainName=va&Action=DeleteDomain&Version=2011-02-01')
+        .next(function(response) {
+          assertValidationErrorResponse(
+            '1 validation error detected: ' +
+              'Value \'va\' at \'domainName\' failed to satisfy constraint: ' +
+                'Member must have length greater than or equal to ' +
+                  Domain.MINIMUM_NAME_LENGTH,
+            response
+          );
+          done();
+        })
+        .error(function(error) {
+          done(error);
+        });
+    });
+
+    test('Action=DeleteDomain for without name', function(done) {
+      utils
+        .get('/?DomainName=&Action=DeleteDomain&Version=2011-02-01')
+        .next(function(response) {
+          assertValidationErrorResponse(
+            '2 validation errors detected: ' +
+              'Value \'\' at \'domainName\' failed to satisfy constraint: ' +
+                'Member must satisfy regular expression pattern: ' +
+                  Domain.VALID_NAME_PATTERN + '; ' +
+              'Value \'\' at \'domainName\' failed to satisfy constraint: ' +
+                'Member must have length greater than or equal to ' +
+                  Domain.MINIMUM_NAME_LENGTH,
+            response
+          );
+          done();
+        })
+        .error(function(error) {
+          done(error);
+        });
+    });
+
     function getActualDescribedDomains(response) {
       var members = response.body.DescribeDomainsResponse
                                  .DescribeDomainsResult
-------------- next part --------------
HTML����������������������������...
Download 



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