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 81758200CF0 for ; Mon, 7 Aug 2017 07:55:38 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 800DB16427F; Mon, 7 Aug 2017 05:55: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 CEBEC16427E for ; Mon, 7 Aug 2017 07:55:37 +0200 (CEST) Received: (qmail 21538 invoked by uid 500); 7 Aug 2017 05:55:36 -0000 Mailing-List: contact commits-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list commits@struts.apache.org Received: (qmail 21344 invoked by uid 99); 7 Aug 2017 05:55:36 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Aug 2017 05:55:36 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4AA47F3246; Mon, 7 Aug 2017 05:55:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: lukaszlenart@apache.org To: commits@struts.apache.org Date: Mon, 07 Aug 2017 05:55:36 -0000 Message-Id: <036ceb6d80674b4d827f634e31107e7b@git.apache.org> In-Reply-To: <0deb5f2d72d24dc28a79f534d641c658@git.apache.org> References: <0deb5f2d72d24dc28a79f534d641c658@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/4] struts git commit: added tests for valid urls with default regex consisting of ip-address archived-at: Mon, 07 Aug 2017 05:55:38 -0000 added tests for valid urls with default regex consisting of ip-address Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/13828056 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/13828056 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/13828056 Branch: refs/heads/master Commit: 13828056b47a25e7ddee80a042a6a8d3b670ff32 Parents: 418a20c Author: Stefaan Dutry Authored: Thu Aug 3 19:01:14 2017 +0200 Committer: Stefaan Dutry Committed: Thu Aug 3 19:01:14 2017 +0200 ---------------------------------------------------------------------- .../xwork2/validator/URLValidatorTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts/blob/13828056/core/src/test/java/com/opensymphony/xwork2/validator/URLValidatorTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/URLValidatorTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/URLValidatorTest.java index baa2bb1..3a39573 100644 --- a/core/src/test/java/com/opensymphony/xwork2/validator/URLValidatorTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/validator/URLValidatorTest.java @@ -168,6 +168,19 @@ public class URLValidatorTest extends XWorkTestCase { //this will cause test to hang indefinitely using JDK 1.8.0_121, Struts 2.5.10.1 and JUnit 4.5 assertTrue(pattern.matcher("http://wargame.ch/wc/acw/sub/aotm/guestbook/index.php?page3D183EClearwater20Roofing20Contractors3C/a3E3Ekaldu20non20msg3C/a3E").matches()); assertTrue(UrlValidator.getInstance().isValid("http://wargame.ch/wc/acw/sub/aotm/guestbook/index.php?page3D183EClearwater20Roofing20Contractors3C/a3E3Ekaldu20non20msg3C/a3E")); + + assertTrue(pattern.matcher("http://253.254.255.1").matches()); + assertTrue(UrlValidator.getInstance().isValid("http://253.254.255.1")); + + assertTrue(pattern.matcher("http://253.254.255.12").matches()); + assertTrue(UrlValidator.getInstance().isValid("http://253.254.255.12")); + + assertTrue(pattern.matcher("http://1.2.3.100").matches()); + assertTrue(UrlValidator.getInstance().isValid("http://1.2.3.100")); + + assertTrue(pattern.matcher("http://1.2.3.255").matches()); + assertTrue(UrlValidator.getInstance().isValid("http://1.2.3.255")); + } public void testLongRunningValidations() throws Exception {