You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Ryan Levering <rr...@yahoo.com> on 2004/09/06 18:42:10 UTC
endXXX problems
Ok, I saw this was a thread back in April, but I am still stumped as it
seems like no one discovered the underlying issue. Obviously I'm setting
something up wrong. The issue is that response.getText is returning empty
strings. But the weird thing is that it doesn't always do it. For example:
public void testJSP() {
pageContext.include("/test.jsp");
}
public void endJSP(WebResponse response) throws Exception {
throw new Exception(response.getText());
}
will throw an exception with the contents correct.
However:
public void testJSP() {
pageContext.include("/test.jsp");
}
public void endJSP(WebResponse response) throws Exception {
assertTrue(response.getText().length() != 0);
}
will fail. So I'm missing something with server vs. client side calling of
assertions.
Any help?
Ryan Levering
RE: endXXX problems
Posted by Vincent Massol <vm...@pivolis.com>.
Hi Ryan,
This thread is a bit old, sorry... Have you been to solve your problem in
the end?
Thanks
-Vincent
> -----Original Message-----
> From: Ryan Levering [mailto:rrlevering@yahoo.com]
> Sent: lundi 6 septembre 2004 22:02
> To: Cactus Users List
> Subject: RE: endXXX problems
>
> Yeah, it doesn't make sense to me either, that's exactly what I thought.
> They are both being executed within browser using ServletTestRunner
> running
> on Tomcat 5, Cactus 1.6. Here's a funnier example:
>
> public class MyTestCase extends JspTestCase {
>
> public void testJSP() throws Exception {
> pageContext.include("/CurrentPageTagTests.jsp");
> }
> public void endJSP(WebResponse response) throws Exception {
> String output = response.getText();
> try {
> throw new Exception(response.getText());
> } catch (Exception e) {
> assertTrue("Message should not be empty",
> e.getMessage().length()
> != 0);
> }
>
> }
>
> public void testJSP2() throws Exception {
> pageContext.include("/CurrentPageTagTests.jsp");
> }
> public void endJSP2(WebResponse response) throws Exception {
> throw new Exception(response.getText());
> }
> }
>
> This is the exact test case I run and I get a Failure and an Exception
> with
> a bunch of text in it. :)
>
> Ryan
>
>
> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@pivolis.com]
> Sent: Monday, September 06, 2004 1:16 PM
> To: 'Cactus Users List'
> Subject: RE: endXXX problems
>
>
> Hi Ryan,
>
> In both your examples, the assertion is performed on the client side (in
> endJSP()) so I don't think there is a server side vs client side stuff.
>
> I don't see how the 2 tests are different they both call the same
> response.getText() method so there cannot be any difference. Maybe you're
> not executing both tests with the same environment?
>
> Thanks
> -Vincent
>
> > -----Original Message-----
> > From: Ryan Levering [mailto:rrlevering@yahoo.com]
> > Sent: lundi 6 septembre 2004 18:42
> > To: cactus-user@jakarta.apache.org
> > Subject: endXXX problems
> >
> > Ok, I saw this was a thread back in April, but I am still stumped as it
> > seems like no one discovered the underlying issue. Obviously I'm
> setting
> > something up wrong. The issue is that response.getText is returning
> empty
> > strings. But the weird thing is that it doesn't always do it. For
> > example:
> >
> > public void testJSP() {
> > pageContext.include("/test.jsp");
> > }
> > public void endJSP(WebResponse response) throws Exception {
> > throw new Exception(response.getText());
> > }
> >
> > will throw an exception with the contents correct.
> >
> > However:
> >
> > public void testJSP() {
> > pageContext.include("/test.jsp");
> > }
> > public void endJSP(WebResponse response) throws Exception {
> > assertTrue(response.getText().length() != 0);
> > }
> >
> > will fail. So I'm missing something with server vs. client side calling
> > of
> > assertions.
> >
> > Any help?
> >
> > Ryan Levering
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org
RE: endXXX problems
Posted by Ryan Levering <rr...@yahoo.com>.
Yeah, it doesn't make sense to me either, that's exactly what I thought.
They are both being executed within browser using ServletTestRunner running
on Tomcat 5, Cactus 1.6. Here's a funnier example:
public class MyTestCase extends JspTestCase {
public void testJSP() throws Exception {
pageContext.include("/CurrentPageTagTests.jsp");
}
public void endJSP(WebResponse response) throws Exception {
String output = response.getText();
try {
throw new Exception(response.getText());
} catch (Exception e) {
assertTrue("Message should not be empty", e.getMessage().length()
!= 0);
}
}
public void testJSP2() throws Exception {
pageContext.include("/CurrentPageTagTests.jsp");
}
public void endJSP2(WebResponse response) throws Exception {
throw new Exception(response.getText());
}
}
This is the exact test case I run and I get a Failure and an Exception with
a bunch of text in it. :)
Ryan
-----Original Message-----
From: Vincent Massol [mailto:vmassol@pivolis.com]
Sent: Monday, September 06, 2004 1:16 PM
To: 'Cactus Users List'
Subject: RE: endXXX problems
Hi Ryan,
In both your examples, the assertion is performed on the client side (in
endJSP()) so I don't think there is a server side vs client side stuff.
I don't see how the 2 tests are different they both call the same
response.getText() method so there cannot be any difference. Maybe you're
not executing both tests with the same environment?
Thanks
-Vincent
> -----Original Message-----
> From: Ryan Levering [mailto:rrlevering@yahoo.com]
> Sent: lundi 6 septembre 2004 18:42
> To: cactus-user@jakarta.apache.org
> Subject: endXXX problems
>
> Ok, I saw this was a thread back in April, but I am still stumped as it
> seems like no one discovered the underlying issue. Obviously I'm setting
> something up wrong. The issue is that response.getText is returning empty
> strings. But the weird thing is that it doesn't always do it. For
> example:
>
> public void testJSP() {
> pageContext.include("/test.jsp");
> }
> public void endJSP(WebResponse response) throws Exception {
> throw new Exception(response.getText());
> }
>
> will throw an exception with the contents correct.
>
> However:
>
> public void testJSP() {
> pageContext.include("/test.jsp");
> }
> public void endJSP(WebResponse response) throws Exception {
> assertTrue(response.getText().length() != 0);
> }
>
> will fail. So I'm missing something with server vs. client side calling
> of
> assertions.
>
> Any help?
>
> Ryan Levering
---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-user-help@jakarta.apache.org
RE: endXXX problems
Posted by Vincent Massol <vm...@pivolis.com>.
Hi Ryan,
In both your examples, the assertion is performed on the client side (in
endJSP()) so I don't think there is a server side vs client side stuff.
I don't see how the 2 tests are different they both call the same
response.getText() method so there cannot be any difference. Maybe you're
not executing both tests with the same environment?
Thanks
-Vincent
> -----Original Message-----
> From: Ryan Levering [mailto:rrlevering@yahoo.com]
> Sent: lundi 6 septembre 2004 18:42
> To: cactus-user@jakarta.apache.org
> Subject: endXXX problems
>
> Ok, I saw this was a thread back in April, but I am still stumped as it
> seems like no one discovered the underlying issue. Obviously I'm setting
> something up wrong. The issue is that response.getText is returning empty
> strings. But the weird thing is that it doesn't always do it. For
> example:
>
> public void testJSP() {
> pageContext.include("/test.jsp");
> }
> public void endJSP(WebResponse response) throws Exception {
> throw new Exception(response.getText());
> }
>
> will throw an exception with the contents correct.
>
> However:
>
> public void testJSP() {
> pageContext.include("/test.jsp");
> }
> public void endJSP(WebResponse response) throws Exception {
> assertTrue(response.getText().length() != 0);
> }
>
> will fail. So I'm missing something with server vs. client side calling
> of
> assertions.
>
> Any help?
>
> Ryan Levering