Question
Can't use addAsync and AsyncResponder together
I have the following code in my test case:
var token:AsyncToken = transfer.save(currentChild);
token.addResponder(new AsyncResponder(
addAsync(
function (result:ResultEvent, token:Object=null):void
{
onSaveChild(result.result as Child);
}, TIMEOUT),
function(error:Object, token:Object=null):void {}
)
);
When this is run, this gives me the following error in my debug:
ArgumentError: Error #1063: Argument count mismatch on flexunit.framework::AsyncTestHelper/handleEvent(). Expected 1, got 2.
at mx.rpc::AsyncResponder/result()
at mx.rpc::AsyncToken/http://www.adobe.com/2006/flex/mx/internal::applyResult()
at mx.rpc.events::ResultEvent/http://www.adobe.com/2006/flex/mx/internal::callTokenResponders()
at mx.rpc::AbstractOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()
at mx.rpc::Responder/result()
at mx.rpc::AsyncRequest/acknowledge()
at NetConnectionMessageResponder/resultHandler()
at mx.messaging::MessageResponder/result()
Looking at the addAsync() code, this is not surprising, as it returns a method with only 1 argument of type Event.
Is there a different way that I can be using a AsyncResponder, or should I just avoid doing this sort of implementation style all together with FlexUnit?
(Or should I submit a bug?)
Thanks in advance.
var token:AsyncToken = transfer.save(currentChild);
token.addResponder(new AsyncResponder(
addAsync(
function (result:ResultEvent, token:Object=null):void
{
onSaveChild(result.result as Child);
}, TIMEOUT),
function(error:Object, token:Object=null):void {}
)
);
When this is run, this gives me the following error in my debug:
ArgumentError: Error #1063: Argument count mismatch on flexunit.framework::AsyncTestHelper/handleEvent(). Expected 1, got 2.
at mx.rpc::AsyncResponder/result()
at mx.rpc::AsyncToken/http://www.adobe.com/2006/flex/mx/internal::applyResult()
at mx.rpc.events::ResultEvent/http://www.adobe.com/2006/flex/mx/internal::callTokenResponders()
at mx.rpc::AbstractOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()
at mx.rpc::Responder/result()
at mx.rpc::AsyncRequest/acknowledge()
at NetConnectionMessageResponder/resultHandler()
at mx.messaging::MessageResponder/result()
Looking at the addAsync() code, this is not surprising, as it returns a method with only 1 argument of type Event.
Is there a different way that I can be using a AsyncResponder, or should I just avoid doing this sort of implementation style all together with FlexUnit?
(Or should I submit a bug?)
Thanks in advance.
