You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Simon Kitching <sk...@obsidium.com> on 2005/10/19 00:26:37 UTC
HtmlDateRendererTest failed - how to see unit test output?
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)?
Thanks,
Simon
Re: HtmlDateRendererTest failed - how to see unit test output?
Posted by Simon Kitching <sk...@obsidium.com>.
Hi Bill,
Thanks for your reply. I've now found the output.
Incidentally, the API subproject's build.properties has:
temp.dir = ${basedir}/temp
test.reports.dir = ${temp.dir}/tests/reports
but the tomahawk subproject's build.properties has:
tests.dir = ${build.dir}/tests
test.reports.dir = ${tests.dir}/reports
This causes API reports in
build/temp/tests/reports
but tomahawk reports in
build/tests/reports
That's no big deal though, now I know where to look.
Regards,
Simon
Re: HtmlDateRendererTest failed - how to see unit test output?
Posted by Bill Dudney <bd...@mac.com>.
Hi Simon,
The html reports are output in
build/temp/tests/reports/html
in each of the subprojects. For this one you'd find the report in
impl/build/temp/tests/reports/html
HTH,
-bd-
On Oct 18, 2005, at 4:47 PM, Simon Kitching wrote:
> 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
>
>
Re: HtmlDateRendererTest failed - how to see unit test output?
Posted by Simon Kitching <sk...@obsidium.com>.
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