org.flexunit.runners.Parameterized with wrong parameter data format for xml report as parameter

11 views
Skip to first unread message

luchyx

unread,
Aug 20, 2010, 3:26:59 PM8/20/10
to Flexunit Contributors
Hi All. I want to share this issue.
I was running a simple parametrized test (see below ConfigLoaderTest),
the issue appear when for no reason the test success but Junit report
fail when parsing the xml reports.
After some research I found that flexUnit generate n-method for each
parameter you provide through IExternalDependencyData and append that
parameter to the n-test method created dynamically.
I realized that the issue is related to the content of each iteration.
(see ProblematicDataLoader below).
The problem raise if your data contain invalid string not sanitized
for an XML attribute. In my case 'some string with quotes"' also this
happens with <> symbols. Any invalid string content for an XML
attribute will crash the flexunit report parser.

This is my base case.

[RunWith("org.flexunit.runners.Parameterized")]
public class ConfigLoaderTest {
public static var configLoader:IExternalDependencyData = new
ProblematicDataLoader();

[Test(dataProvider="configLoader")]
public function testConfigNotNull(value:Object):void {
//value es el resultado o resultEvent.result.
assertNotNull(value);
}
}

This is my problematic loader.

class ProblematicDataLoader {
protected function httpResultHandler(event:ResultEvent):void {
_data = [['string with quotes"'],['my_data_2']];
myToken.notifyResult(_data);
}
}

I can see in the ouput of flex unit ant task this line. now the
flexunit parser crash

[flexunit] <testcase classname="tests.startup::ConfigLoaderTest"
name="testConfigNotNull (string with quotes")" time="32"
status="success" />


Anyone faced this issue.?
Should I fill a bug on JIRA??

Michael Labriola

unread,
Aug 20, 2010, 4:27:34 PM8/20/10
to Flexunit Contributors

To be honest, I thought I already fixed this. Are you running the
latest beta?

If yes, then absolutely file a bug and I will take a look further

luchyx

unread,
Aug 21, 2010, 6:45:42 PM8/21/10
to Flexunit Contributors
OK. I will check that. I'm using the beta 2.
Thanks!!
Reply all
Reply to author
Forward
0 new messages