Permalink
Browse files

setup project

  • Loading branch information...
0 parents commit dfb0f7e88db0c94bb85a2e7daee6ea57693ae656 @adamwynne committed Aug 2, 2011
Showing with 63 additions and 0 deletions.
  1. +6 −0 .gitignore
  2. +13 −0 README
  3. +7 −0 project.clj
  4. +11 −0 src/kestrel/client.clj
  5. +26 −0 test/kestrel/test/client.clj
@@ -0,0 +1,6 @@
+pom.xml
+*jar
+/lib/
+/classes/
+.lein-failures
+.lein-deps-sum
13 README
@@ -0,0 +1,13 @@
+# kestrel-tester
+
+FIXME: write description
+
+## Usage
+
+FIXME: write
+
+## License
+
+Copyright (C) 2011 FIXME
+
+Distributed under the Eclipse Public License, the same as Clojure.
@@ -0,0 +1,7 @@
+(defproject kestrel-tester "1.0.0-SNAPSHOT"
+ :description "tester for kestrel"
+ :repositories {"spy" "http://files.couchbase.com/maven2/"}
+ :dev-dependencies [[swank-clojure "1.3.2"]]
+ :dependencies [[org.clojure/clojure "1.2.1"]
+ [org.clojure/clojure-contrib "1.2.0"]
+ [spy/spymemcached "2.7"]])
@@ -0,0 +1,11 @@
+(ns kestrel.client
+ (:use
+ [clojure.test])
+ (:import
+ (net.spy.memcached MemcachedClient)
+ (java.net InetSocketAddress)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defn- connect
+ [])
@@ -0,0 +1,26 @@
+(ns kestrel.test.client
+ (:use
+ [clojure.test])
+ (:import
+ (net.spy.memcached MemcachedClient)
+ (java.net InetSocketAddress)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(deftest test-create-client
+ (is (= (type (MemcachedClient. (list (InetSocketAddress. "localhost" 22133))))
+ net.spy.memcached.MemcachedClient)))
+
+(deftest test-set-get
+ (let [mcd (MemcachedClient. (list (InetSocketAddress. "localhost" 22133)))
+ q-name "testq"]
+ (.set mcd q-name 0 "testing")
+ (is (= (.get mcd q-name) "testing"))))
+
+(deftest test-range
+ (let [mcd (MemcachedClient. (list (InetSocketAddress. "localhost" 22133)))
+ q-name "testq"]
+ (doseq [i (range 10)] (.set mcd q-name 0 (str i)))
+ ))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

0 comments on commit dfb0f7e

Please sign in to comment.