fr1n63
unread,Jul 20, 2010, 5:54:51 AM7/20/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Flexunit Contributors
Hey, I've been playing with async tests, more specifically handling
IO_Errors and stuff like that, but I've found an issue surrounding the
report generation...
Basically - the ant error is...
java.util.concurrent.ExecutionException: Error parsing report.
And the part of the report causing it is...
<testcase classname="TwitterTest" name="testData" time="30"
status="failure"><failure message="Failing due to Async Event [Event
type="IO_ERROR" bubbles=false cancelable=false eventPhase=2]"
type="TwitterTest.testData" ><![CDATA[]]></failure></testcase>
Note the Event type is wrapped in double quotes.
So I've had a dig around and found it's in the ExpectAsync class, I've
resolved it for my self by wrapping the event to message with a regex.
public function failOnComplete( event:Event,
passThroughData:Object ):void {
var message:String = "Unexpected event received ";
if ( event ) {
message += escapeEvent( event );
}
sendComplete( new AssertionError( message ) );
}
private function handleAsyncErrorFired( event:AsyncEvent ):void {
var message:String = "Failing due to Async Event ";
if ( event && event.originalEvent ) {
message += escapeEvent( event.originalEvent );
}
sendComplete( new AssertionError( message ) );
}
private function escapeEvent(event:Event):String
{
var regExp:RegExp = new RegExp('"', 'g');
return event.toString().replace(regExp, "'");
}
It's now working, not sure if it was something I was doing wrong in
the first place or if I'm missing something obvious, but this kinda
does the trick for me.
Martin