From 37b701fc0c7002e2d84f2d61bd9c57085c8b9542 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Tue, 13 Nov 2012 13:08:24 +0000 Subject: Updated to ensure that both the methods we expect from the protocol-tests are present. --- worker/worker | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'worker') diff --git a/worker/worker b/worker/worker index 655c7ab..bc0d65e 100755 --- a/worker/worker +++ b/worker/worker @@ -229,6 +229,18 @@ class Custodian obj = eval(clazz).new( hash ) + + # + # Ensure that the object we load implements the methods + # we expect + # + if ( ( ! obj.respond_to?( "error") ) || + ( ! obj.respond_to?( "run_test" ) ) ) + puts "Class #{clazz} doesn't implement the full protocol-test API" + end + + + # # We'll run no more than MAX times. # @@ -248,7 +260,7 @@ class Custodian if ( ! success ) # Raise the alert, passing the error message. - alert.raise( obj.error ) + alert.raise( obj.error() ) end rescue => ex puts "Exception raised processing job: #{ex}" -- cgit v1.2.1