You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@excalibur.apache.org by Leo Simons <ma...@leosimons.com> on 2005/04/19 20:19:11 UTC

Re: svn commit: r161574 - excalibur/trunk/components/sourceresolve/src/test/org/apache/excalibur/sour ce/test/URLSourceTestCase.java

This one is breaking in gump!

On 16-04-2005 16:50, "shash@apache.org" <sh...@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 <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
> + * @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


Re: svn commit: r161574 - excalibur/trunk/components/sourceresolve/src/test/org/apache/excalibur/sour ce/test/URLSourceTestCase.java

Posted by "Sasvata (Shash) Chatterjee" <sh...@badfw.org>.
Leo,

>>Wonder why? I tested with adding the testcase, seeing it break as
>>expected, putting in this change:
>>http://svn.apache.org/viewcvs?view=rev&rev=161578, and verified the test
>>passed.  Maybe something platform dependent?
>>    
>>
>
>Could be. I don't really have time to look at it in depth. You can get
>detailed info on the gump environment from
>
>http://brutus.apache.org/gump/public/
>
>If you find something specific that you can't figure out don't hesitate to
>pop on general@gump.apache.org; someone else might be able to help.
>  
>
This time I have checked in all the project.xml(s), so at least the 
versions oif JARs are the same.  I'll try tomorrow seeing if I can run 
thetest on one of the Apache boxes, and go from there.  Thanks for the 
gump pointers.

Shash


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@excalibur.apache.org
For additional commands, e-mail: dev-help@excalibur.apache.org


Re: svn commit: r161574 - excalibur/trunk/components/sourceresolve/src/test/org/apache/excalibur/sour ce/test/URLSourceTestCase.java

Posted by Leo Simons <ma...@leosimons.com>.
On 19-04-2005 20:28, "Sasvata (Shash) Chatterjee" <sh...@badfw.org> wrote:
> Leo,
> 
>>> Added:
>>>    
>>> excalibur/trunk/components/sourceresolve/src/test/org/apache/excalibur/sourc
>>> e/
>>> test/URLSourceTestCase.java
>>>    
> Wonder why? I tested with adding the testcase, seeing it break as
> expected, putting in this change:
> http://svn.apache.org/viewcvs?view=rev&rev=161578, and verified the test
> passed.  Maybe something platform dependent?

Could be. I don't really have time to look at it in depth. You can get
detailed info on the gump environment from

http://brutus.apache.org/gump/public/

If you find something specific that you can't figure out don't hesitate to
pop on general@gump.apache.org; someone else might be able to help.

Cheers,

Leo



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@excalibur.apache.org
For additional commands, e-mail: dev-help@excalibur.apache.org


Re: svn commit: r161574 - excalibur/trunk/components/sourceresolve/src/test/org/apache/excalibur/sour ce/test/URLSourceTestCase.java

Posted by "Sasvata (Shash) Chatterjee" <sh...@badfw.org>.
Leo,

>This one is breaking in gump!
>
>On 16-04-2005 16:50, "shash@apache.org" <sh...@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
>>    
>>

Wonder why? I tested with adding the testcase, seeing it break as 
expected, putting in this change: 
http://svn.apache.org/viewcvs?view=rev&rev=161578, and verified the test 
passed.  Maybe something platform dependent?

I'll try again tonight to make sure that the test passes......maybe my 
new dependencies for all the project.xml(s) make it work in my setup.  
I'll checkin after changing all the deps to -RC1, haven't had time to do 
it yet..

Shash


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@excalibur.apache.org
For additional commands, e-mail: dev-help@excalibur.apache.org