mirror of
https://github.com/apache/jclouds.git
synced 2025-02-16 15:08:28 +00:00
Renamed predicate in-group to in-group?
This commit is contained in:
parent
484f2dd7e2
commit
91cb237c8a
@ -61,30 +61,30 @@ list, Alan Dipert and MeikelBrandmeyer."
|
|||||||
(is (compute-service? *compute*))
|
(is (compute-service? *compute*))
|
||||||
(is (compute-service? (compute-service (compute-context *compute*)))))
|
(is (compute-service? (compute-service (compute-context *compute*)))))
|
||||||
|
|
||||||
(defn in-group [group] #(= (.getGroup %) group))
|
(defn in-group? [group] #(= (.getGroup %) group))
|
||||||
|
|
||||||
(deftest nodes-test
|
(deftest nodes-test
|
||||||
(is (create-node *compute* "fred" (build-template *compute* {} )))
|
(is (create-node *compute* "fred" (build-template *compute* {} )))
|
||||||
(is (= 1 (count (nodes-in-group *compute* "fred"))))
|
(is (= 1 (count (nodes-in-group *compute* "fred"))))
|
||||||
;; pass in a function that selects node metadata based on NodeMetadata field
|
;; pass in a function that selects node metadata based on NodeMetadata field
|
||||||
(is (= 1 (count (nodes-with-details-matching *compute* (in-group "fred")))))
|
(is (= 1 (count (nodes-with-details-matching *compute* (in-group? "fred")))))
|
||||||
;; or make your query inline
|
;; or make your query inline
|
||||||
(is (= 1 (count (nodes-with-details-matching *compute* #(= (.getGroup %) "fred")))))
|
(is (= 1 (count (nodes-with-details-matching *compute* #(= (.getGroup %) "fred")))))
|
||||||
;; or get real fancy, and use the underlying Predicate object jclouds uses
|
;; or get real fancy, and use the underlying Predicate object jclouds uses
|
||||||
(is (= 1 (count (nodes-with-details-matching *compute*
|
(is (= 1 (count (nodes-with-details-matching *compute*
|
||||||
(reify com.google.common.base.Predicate
|
(reify com.google.common.base.Predicate
|
||||||
(apply [this input] (= (.getGroup input) "fred")))))))
|
(apply [this input] (= (.getGroup input) "fred")))))))
|
||||||
(is (= 0 (count (nodes-with-details-matching *compute* (in-group "othergroup")))))
|
(is (= 0 (count (nodes-with-details-matching *compute* (in-group? "othergroup")))))
|
||||||
(suspend-nodes-matching *compute* (in-group "fred"))
|
(suspend-nodes-matching *compute* (in-group? "fred"))
|
||||||
(is (suspended? (first (nodes-with-details-matching *compute* (in-group "fred")))))
|
(is (suspended? (first (nodes-with-details-matching *compute* (in-group? "fred")))))
|
||||||
(resume-nodes-matching *compute* (in-group "fred"))
|
(resume-nodes-matching *compute* (in-group? "fred"))
|
||||||
(is (running? (first (nodes-in-group *compute* "fred"))))
|
(is (running? (first (nodes-in-group *compute* "fred"))))
|
||||||
(reboot-nodes-matching *compute* (in-group "fred"))
|
(reboot-nodes-matching *compute* (in-group? "fred"))
|
||||||
(is (running? (first (nodes-in-group *compute* "fred"))))
|
(is (running? (first (nodes-in-group *compute* "fred"))))
|
||||||
(is (create-nodes *compute* "fred" 2 (build-template *compute* {} )))
|
(is (create-nodes *compute* "fred" 2 (build-template *compute* {} )))
|
||||||
(is (= 3 (count (nodes-in-group *compute* "fred"))))
|
(is (= 3 (count (nodes-in-group *compute* "fred"))))
|
||||||
(is (= "fred" (group (first (nodes *compute*)))))
|
(is (= "fred" (group (first (nodes *compute*)))))
|
||||||
(destroy-nodes-matching *compute* (in-group "fred"))
|
(destroy-nodes-matching *compute* (in-group? "fred"))
|
||||||
(is (terminated? (first (nodes-in-group *compute* "fred")))))
|
(is (terminated? (first (nodes-in-group *compute* "fred")))))
|
||||||
|
|
||||||
(defn localhost? [node]
|
(defn localhost? [node]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user