Skip to content

Instantly share code, notes, and snippets.

Created December 5, 2010 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/729428 to your computer and use it in GitHub Desktop.
Save anonymous/729428 to your computer and use it in GitHub Desktop.
Works ok in clojure REPL, but not in Java unit test
Given a function on a class that is compiled as BoardUpdateFunctions:
(defn -editCardWithAction [this user board-id card-id actions]
(let [action-blocks (.split actions ";")]
(do
(.info logger (str "edit card with: " (alength action-blocks)))
(map #(.info logger (str "perform card action: " %)) action-blocks))))
com.pegby.service.clj.boardUpdate=> (-editCardWithAction nil "test" "test" 123 "first: something; second: else; third: stuff")
0 [main] INFO com.pegby.service.clj.boardUpdate - edit card with: 3
7 [main] INFO com.pegby.service.clj.boardUpdate - perform card action: first: something
7 [main] INFO com.pegby.service.clj.boardUpdate - perform card action: second: else
7 [main] INFO com.pegby.service.clj.boardUpdate - perform card action: third: stuff
(nil nil nil)
But if I have a unit test:
BoardUpdateFunctions f = new BoardUpdateFunctions();
f.editCardWithAction("test", "test", 123L, "first: something; second: else; third: stuff");
I only get:
0 [main] INFO com.pegby.service.clj.boardUpdate - edit card with: 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment