diff options
author | Stuart Halloway <stu@thinkrelevance.com> | 2009-10-03 13:56:18 -0400 |
---|---|---|
committer | Stuart Halloway <stu@thinkrelevance.com> | 2009-10-03 13:56:18 -0400 |
commit | c02c85ee056b208a5f7c9371ff4234bed2ad3901 (patch) | |
tree | 0875aeec4add3631fe3691bc2305e704bfac537f | |
parent | 04a22729691863a5b7e7b1b3c6c1157a02aff3b2 (diff) |
jmx.clj: Beans (1) must have reftypes for state, and (2) no longer
assume that reftypes are IFns
-rw-r--r-- | src/clojure/contrib/jmx/Bean.clj | 2 | ||||
-rw-r--r-- | src/clojure/contrib/test_contrib/test_jmx.clj | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/clojure/contrib/jmx/Bean.clj b/src/clojure/contrib/jmx/Bean.clj index 1ee8e950..cae67d21 100644 --- a/src/clojure/contrib/jmx/Bean.clj +++ b/src/clojure/contrib/jmx/Bean.clj @@ -25,7 +25,7 @@ (defn -getAttribute [this attr] - ((.state this) (keyword attr))) + (@(.state this) (keyword attr))) (defn -getAttributes [this attrs] diff --git a/src/clojure/contrib/test_contrib/test_jmx.clj b/src/clojure/contrib/test_contrib/test_jmx.clj index a4013d22..f75c76bf 100644 --- a/src/clojure/contrib/test_contrib/test_jmx.clj +++ b/src/clojure/contrib/test_contrib/test_jmx.clj @@ -136,11 +136,12 @@ ))) (deftest test-getAttribute - (let [state (ref {:a 1 :b 2}) - bean (Bean. state)] - (testing "accessing values" - (are [result expr] (= result expr) - 1 (.getAttribute bean "a"))))) + (doseq [reftype [ref atom agent]] + (let [state (reftype {:a 1 :b 2}) + bean (Bean. state)] + (testing (str "accessing values from a " (class state)) + (are [result expr] (= result expr) + 1 (.getAttribute bean "a")))))) (deftest test-bean-info (let [state (ref {:a 1 :b 2}) |