YUKI Hiroshi
null+****@clear*****
Fri Nov 9 18:51:22 JST 2012
YUKI Hiroshi 2012-11-09 18:51:22 +0900 (Fri, 09 Nov 2012) New Revision: ee616450aaab0528b04b74f75c919436435ef3ba https://github.com/groonga/gcs/commit/ee616450aaab0528b04b74f75c919436435ef3ba Log: Add more invalid requests Modified files: test/scenarios/configuration/CreateDomain.json test/scenarios/configuration/DefineIndexField.json test/scenarios/configuration/DeleteDomain.json Modified: test/scenarios/configuration/CreateDomain.json (+7 -1) =================================================================== --- test/scenarios/configuration/CreateDomain.json 2012-11-09 17:56:26 +0900 (b9b1436) +++ test/scenarios/configuration/CreateDomain.json 2012-11-09 18:51:22 +0900 (9ebf1f5) @@ -3,6 +3,7 @@ "onlyGCS" : true, "params": { "Action": "GCSDeleteAllDomains" } }, + { "name" : "with valid name", "params": { "Action": "CreateDomain", "DomainName": "companies" } }, @@ -33,5 +34,10 @@ { "name" : "without domain name", "params": { "Action": "CreateDomain", - "DomainName": "" } } + "DomainName": "" } }, + + + { "name" : "teardown: delete the test domain", + "params": { "Action": "DeleteDomain", + "DomainName": "companies" } } ] Modified: test/scenarios/configuration/DefineIndexField.json (+188 -2) =================================================================== --- test/scenarios/configuration/DefineIndexField.json 2012-11-09 17:56:26 +0900 (971f8a9) +++ test/scenarios/configuration/DefineIndexField.json 2012-11-09 18:51:22 +0900 (2815f21) @@ -63,6 +63,62 @@ "IndexField.LiteralOptions.SearchEnabled": "true", "IndexField.LiteralOptions.FacetEnabled": "true", "IndexField.LiteralOptions.ResultEnabled": "true" } }, + + + { "name" : "setup: define temporary text field", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "name2", + "IndexField.IndexFieldType": "text" } }, + { "name" : "update field type from text to literal", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "name2", + "IndexField.IndexFieldType": "literal" } }, + + { "name" : "setup: define temporary literal field", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "product2", + "IndexField.IndexFieldType": "literal" } }, + { "name" : "update field type from literal to text", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "product2", + "IndexField.IndexFieldType": "text" } }, + + { "name" : "setup: define temporary text field", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "name3", + "IndexField.IndexFieldType": "text" } }, + { "name" : "update field type from text to uint", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "name3", + "IndexField.IndexFieldType": "uint" } }, + + { "name" : "setup: define temporary uint field", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "age2", + "IndexField.IndexFieldType": "uint" } }, + { "name" : "update field type from uint to text", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "age2", + "IndexField.IndexFieldType": "text" } }, + + { "name" : "setup: define temporary uint field", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "age3", + "IndexField.IndexFieldType": "uint" } }, + { "name" : "update field type from uint to literal", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "age3", + "IndexField.IndexFieldType": "literal" } }, { "name" : "with too short (one letter) domain name", @@ -95,9 +151,139 @@ "IndexField.IndexFieldName": "never_exist", "IndexField.IndexFieldType": "text" } }, - { "name" : "without domain domain name", + { "name" : "without domain name", "params": { "Action": "DefineIndexField", "DomainName": "", "IndexField.IndexFieldName": "never_exist", - "IndexField.IndexFieldType": "text" } } + "IndexField.IndexFieldType": "text" } }, + + { "name" : "for not-existing domain", + "params": { "Action": "DefineIndexField", + "DomainName": "unknown", + "IndexField.IndexFieldName": "never_exist", + "IndexField.IndexFieldType": "text" } }, + + + { "name" : "define without type", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "name_without_type" } }, + { "name" : "define with invalid type", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "name_with_invalid_type", + "IndexField.IndexFieldType": "invalid" } }, + + { "name" : "update without type", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "name", + "IndexField.TextOptions.FacetEnabled": "false" } }, + { "name" : "update with invalid type", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "name", + "IndexField.IndexFieldType": "invalid" } }, + + + { "name" : "with unknown text option (same to behavior)", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "name", + "IndexField.IndexFieldType": "text", + "IndexField.TextOptions.SearchEnabled": "true" } }, + { "name" : "with unknown text option (differnt to behavior)", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "name", + "IndexField.IndexFieldType": "text", + "IndexField.TextOptions.SearchEnabled": "false" } }, + + { "name" : "with unknown uint option (same to behavior)", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "age", + "IndexField.IndexFieldType": "uint", + "IndexField.UIntOptions.SearchEnabled": "true" } }, + { "name" : "with unknown uint option (differnt to behavior)", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "age", + "IndexField.IndexFieldType": "uint", + "IndexField.UIntOptions.SearchEnabled": "false" } }, + + { "name" : "with mismatched type option (same to behavior)", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "name", + "IndexField.IndexFieldType": "text", + "IndexField.LiteralOptions.SearchEnabled": "true" } }, + { "name" : "with mismatched type option (differnt to behavior)", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "name", + "IndexField.IndexFieldType": "text", + "IndexField.LiteralOptions.SearchEnabled": "false" } }, + + { "name" : "with completely unknown option", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "name", + "IndexField.IndexFieldType": "text", + "IndexField.LiteralOptions.UnknownOption": "true" } }, + + + { "name" : "with too short (one letter) field name", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "a", + "IndexField.IndexFieldType": "text" } }, + + { "name" : "with too short (two letters) field name", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "ab", + "IndexField.IndexFieldType": "text" } }, + + { "name" : "with too long field name", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789", + "IndexField.IndexFieldType": "text" } }, + + { "name" : "with field name including invalid character", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "@_@", + "IndexField.IndexFieldType": "text" } }, + + { "name" : "with too long field name including invalid character", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "@abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789", + "IndexField.IndexFieldType": "text" } }, + + { "name" : "without field name", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "", + "IndexField.IndexFieldType": "text" } }, + + + { "name" : "with too short domain name and too short field name", + "params": { "Action": "DefineIndexField", + "DomainName": "a", + "IndexField.IndexFieldName": "a", + "IndexField.IndexFieldType": "text" } }, + + { "name" : "with too short field name for not-existing domain", + "params": { "Action": "DefineIndexField", + "DomainName": "unknown", + "IndexField.IndexFieldName": "a", + "IndexField.IndexFieldType": "text" } }, + + + { "name" : "teardown: delete the test domain", + "params": { "Action": "DeleteDomain", + "DomainName": "companies" } } ] Modified: test/scenarios/configuration/DeleteDomain.json (+2 -1) =================================================================== --- test/scenarios/configuration/DeleteDomain.json 2012-11-09 17:56:26 +0900 (0fe2fe8) +++ test/scenarios/configuration/DeleteDomain.json 2012-11-09 18:51:22 +0900 (fa6e1f9) @@ -2,10 +2,11 @@ { "name" : "setup: delete all domains", "onlyGCS" : true, "params": { "Action": "GCSDeleteAllDomains" } }, + + { "name" : "setup: to-be-deleted domain", "params": { "Action": "CreateDomain", "DomainName": "companies" } }, - { "name" : "with valid name", "params": { "Action": "DeleteDomain", "DomainName": "companies" } }, -------------- next part -------------- HTML����������������������������... 下载