Skip to content

Commit

Permalink
added test for dynamic composite columns and column range queries
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Stump committed Dec 20, 2011
1 parent 6073997 commit 45573ed
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/clj_hector/test/core.clj
Expand Up @@ -108,6 +108,32 @@
"c" "v"}
(apply get-column-range keyspace column-family "row-key" "a" "c" opts))))))

(deftest dynamic-composite-column-ranges
(with-test-keyspace keyspace [{:name "A"}]
(let [column-family "A"
opts [:v-serializer :string
:n-serializer :dynamic-composite]]

(let [cols (into {}
(interleave
(doseq [i (range 0 3)]
(create-dynamic-composite {:value "col"
:n-serializer :string
:comparator :utf-8}
{:value i
:n-serializer :integer
:comparator :integer}))
(cycle "v")))]
(put keyspace column-family "row-key" cols)
(is (= cols
(apply get-column-range
keyspace
column-family
"row-key"
(first (keys cols))
(last (keys cols))
opts)))))))

;; count-columns is different to counter columns, it's not
;; an O(1) operation.
(deftest counting-with-count-columns
Expand Down

0 comments on commit 45573ed

Please sign in to comment.