Executing an object of Method class?

For questions and postings not covered by the other forums
timmeh
Posts: 18
Joined: Fri Apr 13, 2012 3:12 pm

Executing an object of Method class?

Postby timmeh » Fri Mar 01, 2013 12:17 pm

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.

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: Executing an object of Method class?

Postby BeeJay » Fri Mar 01, 2013 12:33 pm

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.

timmeh
Posts: 18
Joined: Fri Apr 13, 2012 3:12 pm

Re: Executing an object of Method class?

Postby timmeh » Fri Mar 01, 2013 5:05 pm

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


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 4 guests

cron