Yoji Shidara
null+****@clear*****
Tue Nov 5 15:08:33 JST 2013
Yoji Shidara 2013-11-05 15:08:33 +0900 (Tue, 05 Nov 2013) New Revision: 25ab3d886583d0cca9ee9bc070fe62884e863d16 https://github.com/droonga/fluent-plugin-droonga/commit/25ab3d886583d0cca9ee9bc070fe62884e863d16 Message: Use watch test for WatchSchema Instead of direct ddl restore Removed files: ddl/watchdb.grn ddl/watchdb.jsons Modified files: test/helper/watch_helper.rb Deleted: ddl/watchdb.grn (+0 -10) 100644 =================================================================== --- ddl/watchdb.grn 2013-11-05 15:00:34 +0900 (ff0599e) +++ /dev/null @@ -1,10 +0,0 @@ -table_create Subscriber TABLE_HASH_KEY ShortText -table_create Route TABLE_HASH_KEY ShortText -table_create Query TABLE_HASH_KEY ShortText -table_create Keyword TABLE_PAT_KEY ShortText --normalizer NormalizerAuto -column_create Subscriber subscriptions COLUMN_VECTOR Query -column_create Subscriber route COLUMN_SCALAR Route -column_create Subscriber last_modified COLUMN_SCALAR Time -column_create Query keywords COLUMN_VECTOR Keyword -column_create Query subscribers COLUMN_INDEX Subscriber subscriptions -column_create Keyword queries COLUMN_INDEX Query keywords Deleted: ddl/watchdb.jsons (+0 -11) 100644 =================================================================== --- ddl/watchdb.jsons 2013-11-05 15:00:34 +0900 (33061c4) +++ /dev/null @@ -1,11 +0,0 @@ -{"id":"774f912079748eb03aec797d00dfe4f7415e5443","date":"2013-10-31T11:48:25+09:00","replyTo":"localhost:20033/output","statusCode":200,"dataset":"Watch","type":"table_create","body":{"name":"Subscriber","flags":"TABLE_HASH_KEY","key_type":"ShortText"}} -{"id":"08c64417c61df5e0c6cc95c54e58fe112ee8d47f","date":"2013-10-31T11:48:25+09:00","replyTo":"localhost:20033/output","statusCode":200,"dataset":"Watch","type":"table_create","body":{"name":"Route","flags":"TABLE_HASH_KEY","key_type":"ShortText"}} -{"id":"30a7188b6a0b853d45ec41af68f22405023ee796","date":"2013-10-31T11:48:25+09:00","replyTo":"localhost:20033/output","statusCode":200,"dataset":"Watch","type":"table_create","body":{"name":"Query","flags":"TABLE_HASH_KEY","key_type":"ShortText"}} -{"id":"a93fa0c82d7c00104cc7887ef2d3bcd6b3f650d2","date":"2013-10-31T11:48:25+09:00","replyTo":"localhost:20033/output","statusCode":200,"dataset":"Watch","type":"table_create","body":{"normalizer":"NormalizerAuto","name":"Keyword","flags":"TABLE_PAT_KEY","key_type":"ShortText"}} -{"id":"1dcc9cd2fa5f6990cd503765718874e8cd3a6846","date":"2013-10-31T11:48:25+09:00","replyTo":"localhost:20033/output","statusCode":200,"dataset":"Watch","type":"table_create","body":{"name":"Times","flags":"TABLE_PAT_KEY","key_type":"Time"}} -{"id":"b0f248a3555bc744fcc2e1504b54b6245e79dfe8","date":"2013-10-31T11:48:25+09:00","replyTo":"localhost:20033/output","statusCode":200,"dataset":"Watch","type":"column_create","body":{"table":"Subscriber","name":"subscriptions","flags":"COLUMN_VECTOR","type":"Query"}} -{"id":"fd88060579dafdd64ec38baf57881d2893e24146","date":"2013-10-31T11:48:25+09:00","replyTo":"localhost:20033/output","statusCode":200,"dataset":"Watch","type":"column_create","body":{"table":"Subscriber","name":"route","flags":"COLUMN_SCALAR","type":"Route"}} -{"id":"40f9d14e881e09dd965cac09b4f6b452993c011b","date":"2013-10-31T11:48:25+09:00","replyTo":"localhost:20033/output","statusCode":200,"dataset":"Watch","type":"column_create","body":{"table":"Subscriber","name":"last_modified","flags":"COLUMN_SCALAR","type":"Time"}} -{"id":"99604cf73c49fbc1b5ceb0de8bae5fa66f5276bc","date":"2013-10-31T11:48:25+09:00","replyTo":"localhost:20033/output","statusCode":200,"dataset":"Watch","type":"column_create","body":{"table":"Query","name":"keywords","flags":"COLUMN_VECTOR","type":"Keyword"}} -{"id":"e4ebc547d4b8ec85c1009af4ad4ffd0c2405b755","date":"2013-10-31T11:48:25+09:00","replyTo":"localhost:20033/output","statusCode":200,"dataset":"Watch","type":"column_create","body":{"table":"Query","name":"subscribers","flags":"COLUMN_INDEX","type":"Subscriber","source":"subscriptions"}} -{"id":"a1dcea88e1213a1cf67eac78e5b636ceb1ffd241","date":"2013-10-31T11:48:25+09:00","replyTo":"localhost:20033/output","statusCode":200,"dataset":"Watch","type":"column_create","body":{"table":"Keyword","name":"queries","flags":"COLUMN_INDEX","type":"Query","source":"keywords"}} Modified: test/helper/watch_helper.rb (+4 -5) =================================================================== --- test/helper/watch_helper.rb 2013-11-05 15:00:34 +0900 (51f4f3d) +++ test/helper/watch_helper.rb 2013-11-05 15:08:33 +0900 (e4f05ab) @@ -13,6 +13,8 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +require "droonga/watch_schema" + module WatchHelper def setup_database FileUtils.rm_rf(@database_path.dirname.to_s) @@ -21,11 +23,8 @@ module WatchHelper end def setup_schema - top_directory_path = File.join(File.dirname(__FILE__), "..", "..") - ddl_path = File.join(top_directory_path, "ddl", "watchdb.grn") - File.open(ddl_path) do |ddl| - Groonga::Context.default.restore(ddl) - end + schema = Droonga::WatchSchema.new(Groonga::Context.default) + schema.ensure_created end def teardown_database -------------- next part -------------- HTML����������������������������...Download