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 1FCFA200C11 for ; Sat, 4 Feb 2017 14:15:38 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 1E5FF160B63; Sat, 4 Feb 2017 13:15:38 +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 65FC4160B56 for ; Sat, 4 Feb 2017 14:15:37 +0100 (CET) Received: (qmail 37940 invoked by uid 500); 4 Feb 2017 13:15:36 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 37931 invoked by uid 99); 4 Feb 2017 13:15:36 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Feb 2017 13:15:36 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id DCA2E3A0F9E for ; Sat, 4 Feb 2017 13:15:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1781666 - /commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java Date: Sat, 04 Feb 2017 13:15:35 -0000 To: commits@commons.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170204131535.DCA2E3A0F9E@svn01-us-west.apache.org> archived-at: Sat, 04 Feb 2017 13:15:38 -0000 Author: sebb Date: Sat Feb 4 13:15:35 2017 New Revision: 1781666 URL: http://svn.apache.org/viewvc?rev=1781666&view=rev Log: Add test to show how to fix VALIDATOR-412 Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java?rev=1781666&r1=1781665&r2=1781666&view=diff ============================================================================== --- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java (original) +++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java Sat Feb 4 13:15:35 2017 @@ -368,6 +368,18 @@ public class DomainValidatorTest extends assertTrue(validator.isValidGenericTld("com")); } + public void testVALIDATOR_412() { + assertFalse(validator.isValidGenericTld("local")); + assertFalse(validator.isValid("abc.local")); + assertFalse(validator.isValidGenericTld("pvt")); + assertFalse(validator.isValid("abc.pvt")); + DomainValidator.updateTLDOverride(ArrayType.GENERIC_PLUS, new String[]{"local", "pvt"}); + assertTrue(validator.isValidGenericTld("local")); + assertTrue(validator.isValid("abc.local")); + assertTrue(validator.isValidGenericTld("pvt")); + assertTrue(validator.isValid("abc.pvt")); + } + public void testCannotUpdate() { DomainValidator.updateTLDOverride(ArrayType.GENERIC_PLUS, new String[]{"ch"}); // OK DomainValidator dv = DomainValidator.getInstance();