From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8326 invoked by alias); 20 Jun 2006 21:19:17 -0000 Received: (qmail 8318 invoked by uid 22791); 20 Jun 2006 21:19:16 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 20 Jun 2006 21:19:14 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k5KLJCmQ016823 for ; Tue, 20 Jun 2006 17:19:12 -0400 Received: from opsy.redhat.com (vpn50-195.rdu.redhat.com [172.16.50.195]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k5KLJBJk025500; Tue, 20 Jun 2006 17:19:12 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id AA68C2DC241; Tue, 20 Jun 2006 15:15:55 -0600 (MDT) To: Mauve Patch List Subject: Patch: FYI: new test for URLStreamHandler From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom Date: Tue, 20 Jun 2006 21:19:00 -0000 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact mauve-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: mauve-patches-owner@sourceware.org X-SW-Source: 2006/txt/msg00442.txt.bz2 This adds a new test case for URLStreamHandler, from PR 28095. Tom 2006-06-20 Tom Tromey * gnu/testlet/java/net/URLStreamHandler/Except.java: New file. Index: gnu/testlet/java/net/URLStreamHandler/Except.java =================================================================== RCS file: gnu/testlet/java/net/URLStreamHandler/Except.java diff -N gnu/testlet/java/net/URLStreamHandler/Except.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gnu/testlet/java/net/URLStreamHandler/Except.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,62 @@ +/* Except.java -- Regression test for URLStreamHandler + Copyright (C) 2006 Red Hat, Inc. +This file is part of Mauve. + +Mauve is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +Mauve is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Mauve; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +*/ + +// Tags: JDK1.4 + +package gnu.testlet.java.net.URLStreamHandler; + +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; +import java.net.URLStreamHandler; + +import gnu.testlet.TestHarness; +import gnu.testlet.Testlet; + +/** + * PR 28095 regression test. + */ +public class Except implements Testlet { + public static class Handler extends URLStreamHandler + { + protected URLConnection openConnection(URL u) + { + return null; + } + + protected void parseURL(URL url, String spec, int start, int end) + { + throw new RuntimeException(); + } + } + + public void test(TestHarness harness) { + boolean ok = false; + try { + URL u = new URL(null, "blah://", new Handler()); + } catch (MalformedURLException ignore) { + ok = true; + } catch (Exception ex) { + harness.debug(ex); + } + harness.check(ok); + } +}