diff --git a/compute/src/test/clojure/org/jclouds/compute2_test.clj b/compute/src/test/clojure/org/jclouds/compute2_test.clj index 952ac097e3..c419caffa3 100644 --- a/compute/src/test/clojure/org/jclouds/compute2_test.clj +++ b/compute/src/test/clojure/org/jclouds/compute2_test.clj @@ -54,28 +54,26 @@ list, Alan Dipert and MeikelBrandmeyer." (is (compute-service? *compute*)) (is (compute-service? (compute-service (compute-context *compute*))))) -(defn in-group [group] #(= (.getGroup %) group)) - (deftest nodes-test (is (empty? (nodes *compute*))) (is (create-node *compute* "fred" (build-template *compute* {} ))) (is (= 1 (count (nodes *compute*)))) (is (= 1 (count (nodes-in-group *compute* "fred")))) - (is (= 1 (count (nodes-with-details-matching *compute* (in-group "fred"))))) + (is (= 1 (count (nodes-with-details-matching *compute* #(= (.getGroup %) "fred"))))) (is (= 1 (count (nodes-with-details-matching *compute* (reify com.google.common.base.Predicate (apply [this input] (= (.getGroup input) "fred"))))))) - (is (= 0 (count (nodes-with-details-matching *compute* (in-group "othergroup"))))) - (suspend-nodes-matching *compute* (in-group "fred")) - (is (suspended? (first (nodes-with-details-matching *compute* (in-group "fred"))))) - (resume-nodes-matching *compute* (in-group "fred")) + (is (= 0 (count (nodes-with-details-matching *compute* #(= (.getGroup %) "othergroup"))))) + (suspend-nodes-matching *compute* #(= (.getGroup %) "fred")) + (is (suspended? (first (nodes-with-details-matching *compute* #(= (.getGroup %) "fred"))))) + (resume-nodes-matching *compute* #(= (.getGroup %) "fred")) (is (running? (first (nodes-in-group *compute* "fred")))) - (reboot-nodes-matching *compute* (in-group "fred")) + (reboot-nodes-matching *compute* #(= (.getGroup %) "fred")) (is (running? (first (nodes-in-group *compute* "fred")))) (is (create-nodes *compute* "fred" 2 (build-template *compute* {} ))) (is (= 3 (count (nodes-in-group *compute* "fred")))) (is (= "fred" (group (first (nodes *compute*))))) - (destroy-nodes-matching *compute* (in-group "fred")) + (destroy-nodes-matching *compute* #(= (.getGroup %) "fred")) (is (terminated? (first (nodes-in-group *compute* "fred"))))) (deftest build-template-test