YUKI Hiroshi
null+****@clear*****
Thu Nov 15 12:27:15 JST 2012
YUKI Hiroshi 2012-11-15 12:27:15 +0900 (Thu, 15 Nov 2012) New Revision: 5a6929d8c43abd4688cecbadfe590d80847255ca https://github.com/groonga/gcs/commit/5a6929d8c43abd4688cecbadfe590d80847255ca Log: Change format of scenarios * Define setup/teardown * Define requests as separated scenarios (independent from other requests) Modified files: test/scenarios/configuration/CreateDomain.json test/scenarios/configuration/DefineIndexField.json test/scenarios/configuration/DeleteDomain.json test/scenarios/configuration/DeleteIndexField.json Modified: test/scenarios/configuration/CreateDomain.json (+9 -9) =================================================================== --- test/scenarios/configuration/CreateDomain.json 2012-11-15 10:57:01 +0900 (ad1573a) +++ test/scenarios/configuration/CreateDomain.json 2012-11-15 12:27:15 +0900 (6be8914) @@ -1,7 +1,12 @@ [ - { "name" : "with valid name", - "params": { "Action": "CreateDomain", - "DomainName": "companies" } }, + [ + { "name" : "with valid name", + "params": { "Action": "CreateDomain", + "DomainName": "companies" } }, + { "name" : "delete the test domain", + "params": { "Action": "DeleteDomain", + "DomainName": "companies" } } + ], { "name" : "for existing domain", "params": { "Action": "CreateDomain", @@ -29,10 +34,5 @@ { "name" : "without domain name", "params": { "Action": "CreateDomain", - "DomainName": "" } }, - - - { "name" : "teardown: delete the test domain", - "params": { "Action": "DeleteDomain", - "DomainName": "companies" } } + "DomainName": "" } } ] Modified: test/scenarios/configuration/DefineIndexField.json (+125 -108) =================================================================== --- test/scenarios/configuration/DefineIndexField.json 2012-11-15 10:57:01 +0900 (376be85) +++ test/scenarios/configuration/DefineIndexField.json 2012-11-15 12:27:15 +0900 (6fb07a7) @@ -1,14 +1,29 @@ -[ - { "name" : "setup: prepare the test domain", - "params": { "Action": "CreateDomain", - "DomainName": "companies" } }, - - - { "name" : "text, without options", - "params": { "Action": "DefineIndexField", - "DomainName": "companies", - "IndexField.IndexFieldName": "name", - "IndexField.IndexFieldType": "text" } }, +{ "setup": [ + { "name" : "prepare the test domain", + "params": { "Action": "CreateDomain", + "DomainName": "companies" } } + ], + "teardown": [ + { "name" : "delete the test domain", + "params": { "Action": "DeleteDomain", + "DomainName": "companies" } } + ], + "requests": [ + + [ + { "name" : "text, without options", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "name", + "IndexField.IndexFieldType": "text" } }, + { "name" : "text, redefine (update options)", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "name", + "IndexField.IndexFieldType": "text", + "IndexField.TextOptions.FacetEnabled": "true", + "IndexField.TextOptions.ResultEnabled": "true" } } + ], { "name" : "text, with options", "params": { "Action": "DefineIndexField", @@ -18,31 +33,34 @@ "IndexField.TextOptions.FacetEnabled": "true", "IndexField.TextOptions.ResultEnabled": "true" } }, - { "name" : "text, redefine (update options)", - "params": { "Action": "DefineIndexField", - "DomainName": "companies", - "IndexField.IndexFieldName": "name", - "IndexField.IndexFieldType": "text", - "IndexField.TextOptions.FacetEnabled": "true", - "IndexField.TextOptions.ResultEnabled": "true" } }, - - { "name" : "uint, without options", - "params": { "Action": "DefineIndexField", - "DomainName": "companies", - "IndexField.IndexFieldName": "age", - "IndexField.IndexFieldType": "uint" } }, - - { "name" : "uint, redefine", - "params": { "Action": "DefineIndexField", - "DomainName": "companies", - "IndexField.IndexFieldName": "age", - "IndexField.IndexFieldType": "uint" } }, - - { "name" : "literal, without options", - "params": { "Action": "DefineIndexField", - "DomainName": "companies", - "IndexField.IndexFieldName": "product", - "IndexField.IndexFieldType": "literal" } }, + [ + { "name" : "uint, without options", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "age", + "IndexField.IndexFieldType": "uint" } }, + { "name" : "uint, redefine", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "age", + "IndexField.IndexFieldType": "uint" } } + ], + + [ + { "name" : "literal, without options", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "product", + "IndexField.IndexFieldType": "literal" } }, + { "name" : "literal, redefine (update options)", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "product", + "IndexField.IndexFieldType": "literal", + "IndexField.LiteralOptions.SearchEnabled": "true", + "IndexField.LiteralOptions.FacetEnabled": "true", + "IndexField.LiteralOptions.ResultEnabled": "true" } } + ], { "name" : "literal, with options", "params": { "Action": "DefineIndexField", @@ -53,71 +71,70 @@ "IndexField.LiteralOptions.FacetEnabled": "true", "IndexField.LiteralOptions.ResultEnabled": "true" } }, - { "name" : "literal, redefine (update options)", - "params": { "Action": "DefineIndexField", - "DomainName": "companies", - "IndexField.IndexFieldName": "product", - "IndexField.IndexFieldType": "literal", - "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" : "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", "params": { "Action": "DefineIndexField", @@ -166,6 +183,7 @@ "params": { "Action": "DefineIndexField", "DomainName": "companies", "IndexField.IndexFieldName": "name_without_type" } }, + { "name" : "define with invalid type", "params": { "Action": "DefineIndexField", "DomainName": "companies", @@ -177,6 +195,7 @@ "DomainName": "companies", "IndexField.IndexFieldName": "name", "IndexField.TextOptions.FacetEnabled": "false" } }, + { "name" : "update with invalid type", "params": { "Action": "DefineIndexField", "DomainName": "companies", @@ -190,6 +209,7 @@ "IndexField.IndexFieldName": "name", "IndexField.IndexFieldType": "text", "IndexField.TextOptions.SearchEnabled": "true" } }, + { "name" : "with unknown text option (differnt to behavior)", "params": { "Action": "DefineIndexField", "DomainName": "companies", @@ -203,6 +223,7 @@ "IndexField.IndexFieldName": "age", "IndexField.IndexFieldType": "uint", "IndexField.UIntOptions.SearchEnabled": "true" } }, + { "name" : "with unknown uint option (differnt to behavior)", "params": { "Action": "DefineIndexField", "DomainName": "companies", @@ -216,6 +237,7 @@ "IndexField.IndexFieldName": "name", "IndexField.IndexFieldType": "text", "IndexField.LiteralOptions.SearchEnabled": "true" } }, + { "name" : "with mismatched type option (differnt to behavior)", "params": { "Action": "DefineIndexField", "DomainName": "companies", @@ -278,10 +300,5 @@ "params": { "Action": "DefineIndexField", "DomainName": "unknown", "IndexField.IndexFieldName": "a", - "IndexField.IndexFieldType": "text" } }, - - - { "name" : "teardown: delete the test domain", - "params": { "Action": "DeleteDomain", - "DomainName": "companies" } } -] + "IndexField.IndexFieldType": "text" } } +] } Modified: test/scenarios/configuration/DeleteDomain.json (+8 -6) =================================================================== --- test/scenarios/configuration/DeleteDomain.json 2012-11-15 10:57:01 +0900 (838096a) +++ test/scenarios/configuration/DeleteDomain.json 2012-11-15 12:27:15 +0900 (f71acd7) @@ -1,10 +1,12 @@ [ - { "name" : "setup: to-be-deleted domain", - "params": { "Action": "CreateDomain", - "DomainName": "companies" } }, - { "name" : "with valid name", - "params": { "Action": "DeleteDomain", - "DomainName": "companies" } }, + [ + { "name" : "setup: to-be-deleted domain", + "params": { "Action": "CreateDomain", + "DomainName": "companies" } }, + { "name" : "with valid name", + "params": { "Action": "DeleteDomain", + "DomainName": "companies" } } + ], { "name" : "for not-existing domain", "params": { "Action": "DeleteDomain", Modified: test/scenarios/configuration/DeleteIndexField.json (+37 -35) =================================================================== --- test/scenarios/configuration/DeleteIndexField.json 2012-11-15 10:57:01 +0900 (87454bf) +++ test/scenarios/configuration/DeleteIndexField.json 2012-11-15 12:27:15 +0900 (1681d97) @@ -1,37 +1,44 @@ -[ - { "name" : "setup: prepare the test domain", - "params": { "Action": "CreateDomain", - "DomainName": "companies" } }, - { "name" : "setup: surely setup not-existing domain", - "params": { "Action": "DeleteDomain", - "DomainName": "unknown" } }, - - - { "name" : "setup: define to-be-deleted field", - "params": { "Action": "DefineIndexField", - "DomainName": "companies", - "IndexField.IndexFieldName": "name", - "IndexField.IndexFieldType": "text" } }, - { "name" : "existing field", - "params": { "Action": "DeleteIndexField", - "DomainName": "companies", - "IndexFieldName": "name" } }, +{ "setup": [ + { "name" : "prepare the test domain", + "params": { "Action": "CreateDomain", + "DomainName": "companies" } } + ], + "teardown": [ + { "name" : "delete the test domain", + "params": { "Action": "DeleteDomain", + "DomainName": "companies" } } + ], + "requests": [ + + [ + { "name" : "setup: define to-be-deleted field", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "name", + "IndexField.IndexFieldType": "text" } }, + { "name" : "existing field", + "params": { "Action": "DeleteIndexField", + "DomainName": "companies", + "IndexFieldName": "name" } } + ], { "name" : "not-existing field", "params": { "Action": "DeleteIndexField", "DomainName": "companies", "IndexFieldName": "not_existing" } }, - { "name" : "setup: define to-be-deleted field", - "params": { "Action": "DefineIndexField", - "DomainName": "companies", - "IndexField.IndexFieldName": "name", - "IndexField.IndexFieldType": "text" } }, - { "name" : "with unknown option", - "params": { "Action": "DeleteIndexField", - "DomainName": "companies", - "IndexFieldName": "name", - "UnknownOption": "true" } }, + [ + { "name" : "setup: define to-be-deleted field", + "params": { "Action": "DefineIndexField", + "DomainName": "companies", + "IndexField.IndexFieldName": "name", + "IndexField.IndexFieldType": "text" } }, + { "name" : "with unknown option", + "params": { "Action": "DeleteIndexField", + "DomainName": "companies", + "IndexFieldName": "name", + "UnknownOption": "true" } } + ], { "name" : "with too short (one letter) domain name", @@ -109,10 +116,5 @@ { "name" : "with too short field name for not-existing domain", "params": { "Action": "DeleteIndexField", "DomainName": "unknown", - "IndexFieldName": "a" } }, - - - { "name" : "teardown: delete the test domain", - "params": { "Action": "DeleteDomain", - "DomainName": "companies" } } -] + "IndexFieldName": "a" } } +] } -------------- next part -------------- HTML����������������������������...Download