Hi Matt,

On Sat, Feb 4, 2017 at 12:29 AM, Matt Ryan <[email protected]> wrote:
> As I'm in the process of adding unit tests for HtmlRenderer, I'm wondering
> about some cases that could arguably be error conditions.

That's org.apache.sling.junit.impl.servlet.HtmlRenderer, right?

> ...Do we prefer to make these methods accept as many inputs as possible, or
> would we like to make use of e.g. IllegalArgumentException to indicate when
> the method is being invoked in a way that doesn't make sense?...

Considering that the renderer is used during the execution of tests,
I'd say the priority is to avoid blocking tests and avoid creating
HTML that's not accepted by typical client browsers. Ugly or
suboptimal HTML doesn't really matter.

So my preference is to make those methods very lenient in what they
accept, and have them do their best to produce output that allows the
main purpose of the whole thing, which is running tests, to be
fulfilled.

-Bertrand

Reply via email to