See SolrExampleTests#testErrorHandling()
The test sends in stuff that fails badly and makes sure it gets the
right error back.
try {
server.deleteByQuery( "??::??" ); // query syntax error
Assert.fail("should have a number format exception");
}
catch(SolrException ex) {
assertEquals(400, ex.code());
...
}
For output readability, it would be great to be able to hide the
output when we *know* it is expected.
Is that possible? Is there a better way to test for exceptions you
want to get thrown?
ryan
On Sun, Mar 18, 2012 at 11:16 AM, Dawid Weiss <[email protected]> wrote:
> This is a build log that failed recently. It isn't any of the usual
> offenders -- could I ask for somebody who knows Solr better and can
> interpret this?
>
> Namely these are weird:
>
>> Caused by: org.apache.lucene.queryparser.classic.ParseException: Cannot
>> parse '??::??': Encountered " ":" ": "" at line 1, column 2.
>
> and this one:
>
>> 5558 T30 C0 oasc.SolrException.log SEVERE
>> org.apache.solr.common.SolrException: Invalid Number: hello
>
> I was also thinking that it's really hard to tell if some of the
> SEVERE logs are a result of expected tested behavior or if they're
> something that should is a red warning light. We could implement a
> mechanism which would suppress certain logs (by pattern?) from
> appearing if they're expected in a test's output?
>
> Dawid
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]