Skip to main content
Participant
January 12, 2010
Question

Flex Unit -Async Test for Remote Class

  • January 12, 2010
  • 1 reply
  • 1899 views

Hi all,

   I am new to flex unit , i need to write testcase for class which contains multiple of remote object request.Can yo help me guys with any sample.

Thanks

karthy

This topic has been closed for replies.

1 reply

Inspiring
January 20, 2010

@karthy21 - Ideally you should just be testing the class which has the dependency on the RemoteObjects.  To do this with objects that make async calls like RemoteObject, you'll need to use service stub to return dummy data you can test for.  FWIW - I've created a RemoteObjectStub which should help you solve this problem.  You can find the code @ http://www.brianlegros.com/blog/2009/02/21/using-stubs-for-httpservice-and-remoteobject-in-flex/.  For objects which don't require async operation support, consider looking into using mock object libraries such as mock-as3, asmock, mockito-flex, or mockolate for testing.  To learn more about the use of mock objects and stubs, check out this classic article from Martin Fowler:  http://martinfowler.com/articles/mocksArentStubs.html.

Best of luck.

-Brian