From 254ef01b6f81ce102807426ec3cf5bbbdd34dd5f Mon Sep 17 00:00:00 2001 From: Russ Bradberry Date: Tue, 8 Oct 2013 11:34:29 -0400 Subject: [PATCH] add fixes for tests, add timestamp type --- .travis.yml | 10 +++++----- History.md | 5 +++++ lib/marshal/index.js | 3 ++- test/helpers/cql3.json | 8 ++++---- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9a662c4..0c6a001 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,13 @@ language: node_js node_js: - #- "0.6" - #- "0.8" + - "0.6" + - "0.8" - "0.10" env: - #- CASSANDRA_VERSION=1.0.12 - #- CASSANDRA_VERSION=1.1.12 - #- CASSANDRA_VERSION=1.2.10 + - CASSANDRA_VERSION=1.0.12 + - CASSANDRA_VERSION=1.1.12 + - CASSANDRA_VERSION=1.2.10 - CASSANDRA_VERSION=2.0.1 before_install: diff --git a/History.md b/History.md index 00d28ac..4d52313 100644 --- a/History.md +++ b/History.md @@ -212,3 +212,8 @@ * Fix for CQL3 UUID escaping [ @industral #98 ] * Deserialize the key [ @wwwy3y3 #111 ] * Support latest Node [ @JohnMcLear #116 ] + * Add callback to close method and emit connect [ @devdazed #114 ] + * remove requirement to set CQL version explicitly [ @tristanls #109 ] + * Fix for UUID Serializers [ @beatlevic #97 ] + * Add support for TimestampType to marshall [ @devdazed ] + * Fixed Travis tests [ @devdazed ] diff --git a/lib/marshal/index.js b/lib/marshal/index.js index fedbb8e..7ff8324 100644 --- a/lib/marshal/index.js +++ b/lib/marshal/index.js @@ -41,7 +41,8 @@ var TYPES = { 'ReversedType': { ser:IDENTITY, de:IDENTITY }, 'MapType': { ser:Serializers.encodeBinary, de:Deserializers.decodeCollection }, 'SetType': { ser:Serializers.encodeBinary, de:Deserializers.decodeCollection }, - 'ListType': { ser:Serializers.encodeBinary, de:Deserializers.decodeCollection } + 'ListType': { ser:Serializers.encodeBinary, de:Deserializers.decodeCollection }, + 'TimestampType': { ser:Serializers.encodeDate, de:Deserializers.decodeDate } }; /** diff --git a/test/helpers/cql3.json b/test/helpers/cql3.json index 9ce2b0f..133400f 100644 --- a/test/helpers/cql3.json +++ b/test/helpers/cql3.json @@ -8,10 +8,10 @@ "static_create_cnt_cf#cql" : "CREATE TABLE cql_cnt_test (key varchar PRIMARY KEY, cnt counter)", "static_drop_cf#cql" : "DROP COLUMNFAMILY cql_test", "static_update#cql" : "UPDATE cql_test SET foo='bar' WHERE id='foobar'", - "static_update_cnt#cql" : "UPDATE cql_cnt_test SET cnt=cnt+10 WHERE key=1", + "static_update_cnt#cql" : "UPDATE cql_cnt_test SET cnt=cnt+10 WHERE key='1'", "static_select#cql" : "SELECT foo FROM cql_test WHERE id='foobar'", "static_select*#cql" : "SELECT * FROM cql_test WHERE id='foobar'", - "static_select_cnt#cql" : "SELECT cnt FROM cql_cnt_test WHERE key=1", + "static_select_cnt#cql" : "SELECT cnt FROM cql_cnt_test WHERE key='1'", "static_count#cql" : "SELECT COUNT(1) FROM cql_test WHERE id='foobar'", "static_countstar#cql" : "SELECT COUNT(*) FROM cql_test WHERE id='foobar'", "static_delete#cql" : "DELETE FROM cql_test WHERE id='foobar'", @@ -23,7 +23,7 @@ "dynamic_update#vals1" : ["2012-03-01+0000", 10, "www.example.com"], "dynamic_update#vals2" : ["2012-03-01+0000", 10, "www.foo.com"], "dynamic_update#vals3" : ["2012-03-02+0000", 10, "www.foo.com"], - "dynamic_select1#cql" : "SELECT ts FROM clicks WHERE userid = '10'", + "dynamic_select1#cql" : "SELECT ts FROM clicks WHERE userid = 10", "dynamic_select2#cql" : "SELECT userid, url, ts FROM clicks WHERE userid = 10 AND url = 'www.foo.com'", "dense_create_cf#cql" : "CREATE TABLE connections (userid int, ip text, port int, ts timestamp, PRIMARY KEY (userid, ip, port)) WITH COMPACT STORAGE", @@ -31,7 +31,7 @@ "dense_update#vals1" : ["2012-03-01+0000", 10, "192.168.1.1", 8080], "dense_update#vals2" : ["2012-03-01+0000", 10, "192.168.1.1", 1337], "dense_update#vals3" : ["2012-03-02+0000", 10, "192.168.1.1", 1337], - "dense_select1#cql" : "SELECT ts, port FROM connections WHERE userid = '10'", + "dense_select1#cql" : "SELECT ts, port FROM connections WHERE userid = 10", "dense_select2#cql" : "SELECT userid, ip, port, ts FROM connections WHERE userid = 10 AND ip = '192.168.1.1' AND port = 1337", "sparse_create_cf#cql" : "CREATE TABLE timeline (userid int, posted_at timestamp, body text, posted_by text, PRIMARY KEY (userid, posted_at))",