update travis-ci to run both tests and expectations; started rewriting tests as expectations

This commit is contained in:
Paul Ingles 2013-06-09 08:39:46 +01:00
parent 1d92367158
commit d9ab7ba672
3 changed files with 14 additions and 14 deletions

View file

@ -1,2 +1,3 @@
language: clojure
lein: lein2
script: lein do test, expectations

View file

@ -3,12 +3,13 @@
:dependencies [[org.clojure/clojure "1.5.1"]
[com.uswitch/kafka_2.9.2 "0.8.0-SNAPSHOT"]
[zookeeper-clj "0.9.3"]
[org.clojure/data.json "0.2.2"]]
[org.clojure/data.json "0.2.2"]
[expectations "1.4.45"]]
:exclusions [javax.mail/mail
javax.jms/jms
com.sun.jdmk/jmxtools
com.sun.jmx/jmxri
jline/jline
junit/junit]
jline/jline]
:plugins [[lein-expectations "0.0.8"]]
:profiles {:dev {:dependencies [[commons-io/commons-io "2.4"]]}}
:description "Clojure wrapper for Kafka's Java API")

View file

@ -1,18 +1,16 @@
(ns clj-kafka.test.producer
(:use [clojure.test]
(:use [expectations]
[clj-kafka.core]
[clj-kafka.producer] :reload
[clj-kafka.producer]
[clj-kafka.test.utils :only (with-test-broker)])
(:import [kafka.message Message]
[kafka.producer KeyedMessage]))
(deftest messages
(is (instance? KeyedMessage
(message "topic" "value"))))
(expect KeyedMessage (message "topic" "value"))
(deftest brokers-test
(with-test-broker {:zookeeper-port 2182
:kafka-port 9999
:topic "test"}
(is (= [{:host "localhost", :jmx_port -1, :port 9999, :version 1}]
(brokers {"zookeeper.connect" "localhost:2182"})))))
(given (with-test-broker {:zookeeper-port 2182
:kafka-port 9999
:topic "test"}
(brokers {"zookeeper.connect" "127.0.0.1:2182"}))
(expect count 1
first {:host "localhost", :jmx_port -1, :port 9999, :version 1}))