Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mitchell Thomas
committed
Oct 24, 2015
1 parent
784357a
commit 23d8a95
Showing
3 changed files
with
36 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,22 @@ | ||
(ns message-bus.core-test | ||
(:require [clojure.test :refer :all] | ||
[message-bus.core :refer :all])) | ||
[clojure.core.async :refer [put! close! <!!]] | ||
[message-bus.core :refer :all] | ||
[message-bus.messages :refer :all])) | ||
|
||
(deftest a-test | ||
(testing "FIXME, I fail." | ||
(is (= 0 1)))) | ||
(deftest pubsub-test | ||
(testing "Publishing and Consuming using a local broker" | ||
(let [sess (start-activemq-session! "vm://localhost?broker.persistent=false") | ||
dest "pubsub-test" | ||
consu (start-consumer! sess dest) | ||
publi (start-publisher! sess dest) | ||
person {:id 42 :name "Herbie" :email "hhancock@jazz-foo.com" | ||
:likes ["keys" "funk" "deep dish pizza"]} | ||
person_proto (person-builder person)] | ||
(is (put! publi person_proto)) | ||
(is (= (person-builder person_proto) (person-builder (<!! consu)))) | ||
(is (put! publi person)) | ||
(is (= person (<!! consu))) | ||
(is (stop-activemq-session! sess)) | ||
(is (false? (put! publi person))) | ||
(is (nil? (<!! consu)))))) |