ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vikas Malla <malla...@yahoo.co.in>
Subject Re: HTTP 404
Date Fri, 18 Oct 2002 18:18:14 GMT

So do you mean that I should just catch the exceptions in my java classes as I would have
done normally. 

Please find the task snippet i am trying to run below. How do I catch an exception here?

<target name="test">
     <junit printsummary="yes" haltonfailure="no" haltonerror="no"
        fork="yes">

        <classpath>
       <!-- Including the testing classes and the .properties files --> 
          <pathelement location="${my.classes}"/>
         <!-- Including all the .jar files -->
            <path refid="my.classpath"/>
        </classpath>

        <formatter type="plain" usefile="false"/>
  <test name=TestLinks'/>
  
  
  </junit>

</target>


 
 Ken Gentle <j.kenneth.gentle@acm.org> wrote:You probably need to describe your ANT
specific problem a little better -- 
what task are you using, what is the environment and what is the output of 
the build for example.

Not having that, and not know what task you're using, I will offer this:

UrlConnection/HttpConnection from the stock Java JDK will, depending on 
what version you have, throw a FileNotFound exception for the 404 code, and 
a different exception on other error HTTP status codes. If the task you're 
using isn't catching the exceptions, it will most likely "fail".

J2SE 1.4.1 is supposed to rationalize this behavior, but I've not had a 
chance to verify it.




At 06:37 PM 10/18/2002 +0100, you wrote:

>During testing response from links, I found that on a 404, the test simply 
>fails, whereas on a 200, everything works fine and I am able to use the 
>response object to get the responsecode. how can I do the same if the link 
>generates a 404 response without the test failing?
>
>thanks.
>
>
>
> Yahoo! Properties Special Buy, sell, rent...your flat, or even post an ad


--
To unsubscribe, e-mail: 
For additional commands, e-mail: 

 Yahoo! Properties Special  Buy, sell, rent...your flat, or even post an ad
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message