Simon Kitching wrote:
Hi,

I've run the myfaces unit tests using "ant unit-test-all" from the main build dir (current/build). I'm seeing one test case in tomahawk fail:

unit-test:
 [junit] Running org.apache.myfaces.custom.date.HtmlDateRendererTest
 [junit] Tests run: 8, Failures: 5, Errors: 0, Time elapsed: 0.585 sec
 [junit] Test org.apache.myfaces.custom.date.HtmlDateRendererTest FAILED
[junitreport] Transform time: 183ms

How do I see more details about why the test failed?

I've tried setting property "test.reports.dir" [and verified it is getting set by putting an <echo> in the build.xml file] but the specified directory gets no output in it.

I've tried setting <junit printSummary="withOutAndErr"> but that doesn't help either.

BTW: any other tips on running the unit tests (things to watch out for)?



I'm still interested in how to get unit test output via ant.

Regarding the unit test failure itself, I've run it in eclipse and traced the problem through. The problem code is at lines 61/62:
   subject.decode(facesContext, inputDate);
   UserData data = inputDate.getUserData(Locale.ENGLISH);

It appears that _submittedValue is being calculated correctly by the "decode" step. However the getUserData method only calls getValue() internally, and getValue is returning null thus the returned object contains the current date not the one submitted by the form.

I'm not (yet) a JSF expert, but perhaps there needs to be a "validation" step in there also, to copy the "_submittedValue" into the actual value for the uicomponent?

On a general topic, did people notice this test failing when the RCs were created? If not you might want to look at the release procedures to ensure failing unit tests are noticed...

Regards,

Simon

Reply via email to