Browse files

Remove checking for missing method calls inside a session.

The exception that we were capturing within a session block
can be caused by more than just a missing method call on a VBox object.
This handling of the exception was hiding more important exception
causes making development difficult.
  • Loading branch information...
1 parent 38ddaa6 commit e74cf6197828e5065d7f69d33e82de70f9df3566 @tbatchelli tbatchelli committed Feb 23, 2011
Showing with 1 addition and 19 deletions.
  1. +0 −9 src/vmfest/virtualbox/session.clj
  2. +1 −10 test/vmfest/virtualbox/session_test.clj
@@ -144,15 +144,6 @@ with a virtualbox.
(let [~vb-m (.getMachine ~session)]
- (catch java.lang.IllegalArgumentException e#
- (conditions/log-and-raise
- e#
- {:log-level :error
- :message
- (format
- "Called a method that is not available with a direct session in '%s'"
- '~body)
- :type :invalid-method}))
(finally (.unlockMachine ~session))))))
(catch VBoxException e#
@@ -74,16 +74,7 @@
(with-session valid-machine :write [s2 m2]))))))
(testing "a session with a bogus machine will throw a condition"
(is (thrown-with-msg? Condition #"Cannot open session with machine"
- (with-session bogus-machine :write [s m]))))
- (testing "write session method call -- wrong method,"
- (is (thrown?
- Condition
- (with-session valid-machine :write [session machine]
- (.setBogusVariable machine nil))))
- (is (handler-case :type
- (with-session valid-machine :write [session machine]
- (.setBogusVariable machine nil))
- (handle :invalid-method true)))))
+ (with-session bogus-machine :write [s m])))))
(deftest ^{:integration true}

0 comments on commit e74cf61

Please sign in to comment.