Return-Path: Delivered-To: apmail-excalibur-dev-archive@www.apache.org Received: (qmail 47179 invoked from network); 19 Apr 2005 18:13:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Apr 2005 18:13:42 -0000 Received: (qmail 28270 invoked by uid 500); 19 Apr 2005 18:13:41 -0000 Delivered-To: apmail-excalibur-dev-archive@excalibur.apache.org Received: (qmail 28223 invoked by uid 500); 19 Apr 2005 18:13:41 -0000 Mailing-List: contact dev-help@excalibur.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: "Excalibur Developers List" Reply-To: "Excalibur Developers List" Delivered-To: mailing list dev@excalibur.apache.org Received: (qmail 28208 invoked by uid 99); 19 Apr 2005 18:13:41 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from netlx014.civ.utwente.nl (HELO netlx014.civ.utwente.nl) (130.89.1.88) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 19 Apr 2005 11:13:38 -0700 Received: from [130.89.136.248] (wlan136248.mobiel.utwente.nl [130.89.136.248]) by netlx014.civ.utwente.nl (8.11.7/HKD) with ESMTP id j3JIDRp13321 for ; Tue, 19 Apr 2005 20:13:27 +0200 User-Agent: Microsoft-Entourage/11.1.0.040913 Date: Tue, 19 Apr 2005 20:19:11 +0200 Subject: Re: svn commit: r161574 - excalibur/trunk/components/sourceresolve/src/test/org/apache/excalibur/sour ce/test/URLSourceTestCase.java From: Leo Simons To: Excalibur Developers List Message-ID: In-Reply-To: <20050416145045.72410.qmail@minotaur.apache.org> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-UTwente-MailScanner-Information: Scanned by MailScanner. Contact helpdesk@ITBE.utwente.nl for more information. X-UTwente-MailScanner: Found to be clean X-MailScanner-From: mail@leosimons.com X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This one is breaking in gump! On 16-04-2005 16:50, "shash@apache.org" wrote: > Author: shash > Date: Sat Apr 16 07:50:44 2005 > New Revision: 161574 > > URL: http://svn.apache.org/viewcvs?view=rev&rev=161574 > Log: > New test case from http://issues.apache.org/jira/browse/EXLBR-19 > > Added: > > excalibur/trunk/components/sourceresolve/src/test/org/apache/excalibur/source/ > test/URLSourceTestCase.java > > Added: > excalibur/trunk/components/sourceresolve/src/test/org/apache/excalibur/source/ > test/URLSourceTestCase.java > URL: > http://svn.apache.org/viewcvs/excalibur/trunk/components/sourceresolve/src/tes > t/org/apache/excalibur/source/test/URLSourceTestCase.java?view=auto&rev=161574 > ============================================================================== > --- > excalibur/trunk/components/sourceresolve/src/test/org/apache/excalibur/source/ > test/URLSourceTestCase.java (added) > +++ > excalibur/trunk/components/sourceresolve/src/test/org/apache/excalibur/source/ > test/URLSourceTestCase.java Sat Apr 16 07:50:44 2005 > @@ -0,0 +1,78 @@ > +/* > + * Copyright 2002-2004 The Apache Software Foundation > + * Licensed under the Apache License, Version 2.0 (the "License"); > + * you may not use this file except in compliance with the License. > + * You may obtain a copy of the License at > + * > + * http://www.apache.org/licenses/LICENSE-2.0 > + * > + * Unless required by applicable law or agreed to in writing, software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > + * implied. > + * > + * See the License for the specific language governing permissions and > + * limitations under the License. > + */ > +package org.apache.excalibur.source.test; > + > +import junit.framework.TestCase; > + > +import java.io.File; > +import java.net.URL; > +import java.util.Collections; > +import org.apache.excalibur.source.impl.URLSource; > + > +/** > + * Test case for URLSource. > + * > + * @author Avalon Development Team > + * @version $Id: URLSourceTestCase.java,v 1.0 2005/04/16 11:47:22 shash Exp $ > + */ > +public class URLSourceTestCase extends TestCase > +{ > + > + URLSource m_urlSource; > + > + protected void setUp() throws Exception > + { > + m_urlSource = new URLSource(); > + } > + > + public void testFileExists() throws Exception > + { > + File tempFile = File.createTempFile( "filesource", "test" ); > + try > + { > + m_urlSource.init( tempFile.toURL(), Collections.EMPTY_MAP ); > + assertTrue( m_urlSource.exists() ); > + } > + finally > + { > + tempFile.delete(); > + } > + } > + > + public void testFileDoesNotExist() throws Exception > + { > + File tempFile = File.createTempFile( "filesource", "test" ); > + tempFile.delete(); > + > + m_urlSource.init( tempFile.toURL(), Collections.EMPTY_MAP ); > + assertFalse( m_urlSource.exists() ); > + } > + > + public void testHttpDoesNotExist() throws Exception > + { > + m_urlSource.init( new URL( "http://localhost/no_such_file" ), > + Collections.EMPTY_MAP ); > + assertFalse( m_urlSource.exists() ); > + } > + > + public void testHttpDoesExist() throws Exception > + { > + m_urlSource.init( new URL( "http://www.example.com/" ), > + Collections.EMPTY_MAP ); > + assertTrue( m_urlSource.exists() ); > + } > +} > \ No newline at end of file > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: scm-unsubscribe@excalibur.apache.org > For additional commands, e-mail: scm-help@excalibur.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@excalibur.apache.org For additional commands, e-mail: dev-help@excalibur.apache.org