ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Gentle <j.kenneth.gen...@acm.org>
Subject Re: HTTP 404
Date Fri, 18 Oct 2002 19:45:32 GMT
OK, so what does JUnit have to do with it?  What you're describing sounds 
like a link-crawler for a web site, and I agree that it should continue 
after logging the 400/500 response.  But that sounds like an application, 
not a unit test.

The unit test for a 'link-crawler' application seems to be working just 
fine:  when the application encounters a broken link, the application is 
throwing an exception and exiting;  JUnit dutifully reports this.

Without seeing your application and the unit test, I don't think I can help 
you much more.  Again, this doesn't appear to be an Ant issue:

* Did you run the test with the regular test runners (Swing or Text)?
* Does it fail after a 400/500 response code?

You may send me the test/app offline, and I'll take a look at 
it.  Alternately, you could post to the JUnit list.

         Ken

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

>I am trying to test a list of links, by getting their response codes from 
>their response objects. But whenever a 404/500 is encountered, i am not 
>able to complete my list. The test stops at the 404/500 error generating 
>link. Is there a way I can avoid that so that I continue with my list even 
>if one of the links in the list generates a 404/500?
>
>I know i can continue running other tests using ant even if one test fails.
>
>But how can I continue with my list of links in one particular test.
>
>Thanks.
>
>  Ken Gentle <j.kenneth.gentle@acm.org> wrote:There still isn't enough 
> information here to thoroughly diagnose the
>problem -- the snippet has at least one error:
>
>
>^
>missing a quote (and should be double quotes, right?)
>
>What is in TestLinks? What is it you're testing? Does it behave properly
>(ie, how you expect it to) using one of junit's test runners?
>
>This, at this point, appears to be a junit test coding issue, or an
>application issue. Doesn't appear to be ANT.
>
>Ken
>
>At 07:18 PM 10/18/2002 +0100, you wrote:
>
> >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?
> >
> >
> > > fork="yes">
> >
> >
> >
> >
>
> >
> >
>
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Ken Gentle 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
>
>
>--
>To unsubscribe, e-mail:
>For additional commands, e-mail:
>
>  Yahoo! Properties Special  Buy, sell, rent...your flat, or even post an ad


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message