mirror of
https://github.com/apache/jclouds.git
synced 2025-02-16 15:08:28 +00:00
made options for selecting nodes explicit in clj test
This commit is contained in:
parent
adafc4f5bf
commit
9e4cb6a758
@ -61,7 +61,11 @@ list, Alan Dipert and MeikelBrandmeyer."
|
|||||||
(is (create-node *compute* "fred" (build-template *compute* {} )))
|
(is (create-node *compute* "fred" (build-template *compute* {} )))
|
||||||
(is (= 1 (count (nodes *compute*))))
|
(is (= 1 (count (nodes *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
|
||||||
(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
|
||||||
|
(is (= 1 (count (nodes-with-details-matching *compute* #(= (.getGroup %) "fred")))))
|
||||||
|
;; 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")))))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user