Page 1 of 1

Executing an object of Method class?

Posted: Fri Mar 01, 2013 12:17 pm
by timmeh
Is it possible to execute an Object of Method class?
I am trying to write a JadeScript that gets all the void methods from a test class and executes them one by one but cant find any documentation on Method class,
I can loop around a method dictionary, although cant find any way to execute that method.

any help would be highly appreciated.

Re: Executing an object of Method class?

Posted: Fri Mar 01, 2013 12:33 pm
by BeeJay
If the "test class" you're referring to is the class you'll be using to perform unit testing, then you may want to have a read up on the JadeTestCase and JadeTestRunner classes as these are specifically designed with unit testing in mind including frameworks to help you automate the regular running of your unit tests.

If you're not talking about unit tests, then you can call a method on an object using a string representation of the method name via Object::sendMsg( methodName );

Hope that helps,
BeeJay.

Re: Executing an object of Method class?

Posted: Fri Mar 01, 2013 5:05 pm
by timmeh
Thanks Beejay!

Yes I was using JadeTestCase, thanks for clarifying about the runner, I was having a play with some JadeScripts with the tests and wanted to find out if executing methods directly was possible.

Cheers
Tim