Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EBC6B200C1F for ; Sat, 4 Feb 2017 00:29:36 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id EA55E160B55; Fri, 3 Feb 2017 23:29:36 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4053A160B3F for ; Sat, 4 Feb 2017 00:29:36 +0100 (CET) Received: (qmail 50619 invoked by uid 500); 3 Feb 2017 23:29:35 -0000 Mailing-List: contact dev-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list dev@sling.apache.org Received: (qmail 50605 invoked by uid 99); 3 Feb 2017 23:29:35 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Feb 2017 23:29:35 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 88476C0B96 for ; Fri, 3 Feb 2017 23:29:34 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.98 X-Spam-Level: * X-Spam-Status: No, score=1.98 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=mvryan-org.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id hlWXF5S5R-hJ for ; Fri, 3 Feb 2017 23:29:33 +0000 (UTC) Received: from mail-yb0-f180.google.com (mail-yb0-f180.google.com [209.85.213.180]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id DBD9E5F5F8 for ; Fri, 3 Feb 2017 23:29:32 +0000 (UTC) Received: by mail-yb0-f180.google.com with SMTP id w194so10719268ybe.0 for ; Fri, 03 Feb 2017 15:29:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvryan-org.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=wRb3VxkC7dicb/ZBHQaZ2eYBnbR2YKubuptab80AkIE=; b=XcxwYWaxcB9AulmszlOGyfVqKpsnyB5eCElOboyBeLxIxJmByy3O9RIwAIVMRvBMgv jbYV8jLOIEOYEXNqlu4jg+rXxIVLWtRvmRJXapjXWKQoSUdSRI+Vgs3SZZGTtaMlE8sI xFxV1nv4ZeoJyrhLm0+J7m+j3h4ce4GtL99QpizpKrA0m9+BtvRP82Jz85aHoxZYxIGu VS/do8923agEIPHXSADIBjCLaeFbbsqRHoP054MrX5Eumqt7TXrvsXZekNkBWKmf9hnS sx3LHwL25/PZhIdNXdXGu+JmFOOvgeuXOZEPLGAo/Cj+B5utOQXUBEZWLHaQrB29a93g 5hNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=wRb3VxkC7dicb/ZBHQaZ2eYBnbR2YKubuptab80AkIE=; b=sZhzsBqJJ9iePHm48OOdRIpAZMKGG+V19kjDWH8vcX8uAGvtIte9N4ZP5luqaq//Pq OL77E8ftBl9PPuKiYGVL5/qVRZ94PfICSi68pP8e3wlMMoRnIJT4D+fSTDoDWhIQJ8vl 4LPs1BEfTX3SMN83jUyP+u6FGgBC3lT5Glt7lLNCajmELSaWLB5SYoF2HXa9tJbQsW9M EJs99azxu9I2c3XE3rRvdUa6S3/Jzao69bO+UhytmgPRxUkGbGPgaQdFmW8jFrFzLZUw E7uZEAor/xifZxyJ5+uG206XPhuoURnicqbAwv4sBfQAedxObEc/m+tYTj9xx18Vqfwz racg== X-Gm-Message-State: AIkVDXLFl4gNFtDJfROy3Sga/JRKCCOWGr5Nlums7RgXrltLaI/xgvf18NWuKXXdp9FgfuH7FdyE4aRR593+vQ== X-Received: by 10.37.171.37 with SMTP id u34mr7474289ybi.127.1486164571826; Fri, 03 Feb 2017 15:29:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.129.51.66 with HTTP; Fri, 3 Feb 2017 15:29:31 -0800 (PST) X-Originating-IP: [192.150.9.201] From: Matt Ryan Date: Fri, 3 Feb 2017 16:29:31 -0700 Message-ID: Subject: [unit testing] HtmlRenderer error cases To: dev@sling.apache.org Content-Type: multipart/alternative; boundary=94eb2c184c3261e2370547a8a7f0 archived-at: Fri, 03 Feb 2017 23:29:37 -0000 --94eb2c184c3261e2370547a8a7f0 Content-Type: text/plain; charset=UTF-8 Hi, As I'm in the process of adding unit tests for HtmlRenderer, I'm wondering about some cases that could arguably be error conditions. For example, if I have an HtmlRenderer instance and I call the "link()" method with an empty string passed in as the info parameter, the method will faithfully generate an anchor tag that is not wrapped around any text. Likewise, if I call the "link()" method with an empty string passed in as the url parameter, it will also generate an anchor tag with an empty string value for the href. 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? I just want to know the general feeling, so I can consistently enforce it via the unit tests I'm writing. -MR --94eb2c184c3261e2370547a8a7f0--