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 Reiko HIROSE <r-...@fjh.fujitsu.com> on 2003/10/01 01:51:32 UTC

the server returns the html source, not the test result.

hi,

i've been unable to get the test result from cactus.
the server does not return the test result. instead it returns the whole
html source which i wrote in the testee class.

i found some similar cases on the web, but they refer to the cases
that the server returns 404 error.

what i get is (in short. the whole message is at the end of this mail.):
org.apache.cactus.util.ChainedRuntimeException: Failed to get the test
results.
This is probably due to an error that happened on the server side when
trying to
 execute the tests. Here is what was returned by the server : [<html>
<head><title>
Hello
</title></head>
Hello
<body>
</body></html>
]
        at
org.apache.cactus.client.AbstractHttpClient.dispatch2_doTest(Abstract
HttpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):120)

but seems like ServletRedirector is workng. when i enter the url :
http://localhost:8080/MySampleWebApp/ServletRedirector?Cactus_Service=RUN_TEST
it gives me back a blank page, which i think is what's expected to happen.

-- start
(quoted from
http://www.google.co.jp/search?q=cache:RtTLyGOy6WEJ:javaboutique.internet.com/tutorials/StrutsTestCase/index-13.html+ServletRedirector%3FCactus_Service%3DRUN_TEST&hl=ja&ie=UTF-8)
To see if the ServletRedirector servlet is working, enter

http://localhost:8080/cactusdvdlib/ServletRedirector?Cactus_Service=RUN_TEST
If you get a blank page back, the servlet works!
-- end

the environment :
WIN2000
Apache Tomcat/4.1.24-LE-jdk14
cactus-1.4.1.jar
cactus-ant-1.4.1.jar

i have a simple test class like this :
package cactest;
-- start
import org.apache.cactus.*;
import junit.framework.*;

public class TestHelloServlet extends ServletTestCase {

    public TestHelloServlet(String name) {
        super(name);
    }

    protected void setUp() {
        System.out.println("debug: setting up...");
    }

    protected void tearDown() {
    }

    public void beginSimpleTest(WebRequest webrequest)  {
    }

    public void testSimpleTest()
        throws java.io.IOException {
        System.out.println("# testSimpleTest start");
        HelloServlet servlet = new HelloServlet();
        System.out.println("servlet hash :" + servlet.hashCode());
        servlet.doGet(request, response);
        System.out.println("# testSimpleTest end");
    }
    public void endSimpleTest(WebResponse response)
        throws java.io.IOException {
        System.out.println("#endSimpleTest start");
        int idx = response.getText().indexOf("Hello");
        assertTrue("if found, success", idx != -1);
        System.out.println("#endSimpleTest end");
    }
}
-- end

and here's my "cactus.properties"
-- start
cactus.contextURL=http://localhost:8080/MySampleWebApp
cactus.servletRedirectName=ServletRedirector
cactus.enableLogging=false
and the whole message from the server is :
-- end

-- start
C:\cygwin\home\lei\myApp\cactus_sample\MySampleWebApp\WEB-INF\classes>j
ava
junit.textui.TestRunner cactest.TestHelloServlet
log4j:WARN No appenders could be found for logger
(org.apache.cactus.util.JUnitV
ersionHelper).
log4j:WARN Please initialize the log4j system properly.
.E
Time: 0.401
There was 1 error:
1) testSimpleTest(cactest.TestHelloServlet)
org.apache.cactus.util.ChainedRuntimeException: Failed to get the test
results.
This is probably due to an error that happened on the server side when
trying to
 execute the tests. Here is what was returned by the server : [<html>
<head><title>
Hello
</title></head>
Hello
<body>
</body></html>
]
        at
org.apache.cactus.client.AbstractHttpClient.dispatch2_doTest(Abstract
HttpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):120)
        at
org.apache.cactus.client.AbstractHttpClient.around2_doTest(AbstractHt
tpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):1218)
        at
org.apache.cactus.client.AbstractHttpClient.doTest(AbstractHttpClient
.java;org/apache/cactus/util/log/LogAspect.aj(1k):104)
        at
org.apache.cactus.AbstractWebTestCase.runGenericTest(AbstractWebTestC
ase.java:260)
        at
org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:133)
        at
org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:195)

org.apache.cactus.client.ParsingException: Not a valid response
        at
org.apache.cactus.client.WebTestResultParser.readRootElement(WebTestR
esultParser.java;org/apache/cactus/util/log/LogAspect.aj(1k):140)
        at
org.apache.cactus.client.WebTestResultParser.dispatch29_parse(WebTest
ResultParser.java;org/apache/cactus/util/log/LogAspect.aj(1k):101)
        at
org.apache.cactus.client.WebTestResultParser.around29_parse(WebTestRe
sultParser.java;org/apache/cactus/util/log/LogAspect.aj(1k):1218)
        at
org.apache.cactus.client.WebTestResultParser.parse(WebTestResultParse
r.java;org/apache/cactus/util/log/LogAspect.aj(1k):96)
        at
org.apache.cactus.client.AbstractHttpClient.callGetResult(AbstractHtt
pClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):230)
        at
org.apache.cactus.client.AbstractHttpClient.dispatch2_doTest(Abstract
HttpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):114)
        at
org.apache.cactus.client.AbstractHttpClient.around2_doTest(AbstractHt
tpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):1218)
        at
org.apache.cactus.client.AbstractHttpClient.doTest(AbstractHttpClient
.java;org/apache/cactus/util/log/LogAspect.aj(1k):104)
        at
org.apache.cactus.AbstractWebTestCase.runGenericTest(AbstractWebTestC
ase.java:260)
        at
org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:133)
        at
org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:195)


FAILURES!!!
Tests run: 1,  Failures: 0,  Errors: 1

-- end

if you have a clue, could you help me?

cheers,

leiko


Re: the server returns the html source, not the test result.

Posted by hirose <r-...@fjh.fujitsu.com>.
Hi Vincent,

Thank you for your response.
i still have the same problem, but there's at least one thing i have found
out.

> The servlet redirector is queried twice from the client side.
like you said, if i run TestRunner twice, i get the proper response from the
server,
whereas i get an error at the first attempt.

here's what happens at the client machine when i run TestRunner twice.
-- start
C:\cygwin\home\r-hirose\myApp\cactus_sample\MySampleWebApp\WEB-INF\classes>j
ava
junit.textui.TestRunner cactest.TestHelloServlet
log4j:WARN No appenders could be found for logger
(org.apache.cactus.util.JUnitV
ersionHelper).
log4j:WARN Please initialize the log4j system properly.
.E
Time: 0.621
There was 1 error:
1) testSimpleTest(cactest.TestHelloServlet)
org.apache.cactus.util.ChainedRuntimeException: Failed to get the test
results.
This is probably due to an error that happened on the server side when
trying to
 execute the tests. Here is what was returned by the server : [<html>
<head><title>
Hello
</title></head>
(.)
        at
org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:195)


FAILURES!!!
Tests run: 1,  Failures: 0,  Errors: 1


C:\cygwin\home\r-hirose\myApp\cactus_sample\MySampleWebApp\WEB-INF\classes>j
ava
junit.textui.TestRunner cactest.TestHelloServlet
log4j:WARN No appenders could be found for logger
(org.apache.cactus.util.JUnitV
ersionHelper).
log4j:WARN Please initialize the log4j system properly.
.#endSimpleTest start
#endSimpleTest end

Time: 0.23

OK (1 tests)
-- end


i can get the proper response at the second attempt to run TestRunner,
but i guess the server is supposed to return the test result at the first
time
that TestRunner is called. is that right?


here's the whole client log.
-- start
C:\cygwin\home\r-hirose\myApp\cactus_sample\MySampleWebApp\WEB-INF\classes>j
ava
junit.textui.TestRunner cactest.TestHelloServlet
log4j:WARN No appenders could be found for logger
(org.apache.cactus.util.JUnitV
ersionHelper).
log4j:WARN Please initialize the log4j system properly.
.E
Time: 0.641
There was 1 error:
1) testSimpleTest(cactest.TestHelloServlet)
org.apache.cactus.util.ChainedRuntimeException: Failed to get the test
results.
This is probably due to an error that happened on the server side when
trying to
 execute the tests. Here is what was returned by the server : [<html>
<head><title>
Hello
</title></head>
Hello
<body>
</body></html>
]
        at
org.apache.cactus.client.AbstractHttpClient.dispatch2_doTest(Abstract
HttpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):120)
        at
org.apache.cactus.client.AbstractHttpClient.around2_doTest(AbstractHt
tpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):1218)
        at
org.apache.cactus.client.AbstractHttpClient.doTest(AbstractHttpClient
.java;org/apache/cactus/util/log/LogAspect.aj(1k):104)
        at
org.apache.cactus.AbstractWebTestCase.runGenericTest(AbstractWebTestC
ase.java:260)
        at
org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:133)
        at
org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:195)

org.apache.cactus.client.ParsingException: Not a valid response
        at
org.apache.cactus.client.WebTestResultParser.readRootElement(WebTestR
esultParser.java;org/apache/cactus/util/log/LogAspect.aj(1k):140)
        at
org.apache.cactus.client.WebTestResultParser.dispatch29_parse(WebTest
ResultParser.java;org/apache/cactus/util/log/LogAspect.aj(1k):101)
        at
org.apache.cactus.client.WebTestResultParser.around29_parse(WebTestRe
sultParser.java;org/apache/cactus/util/log/LogAspect.aj(1k):1218)
        at
org.apache.cactus.client.WebTestResultParser.parse(WebTestResultParse
r.java;org/apache/cactus/util/log/LogAspect.aj(1k):96)
        at
org.apache.cactus.client.AbstractHttpClient.callGetResult(AbstractHtt
pClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):230)
        at
org.apache.cactus.client.AbstractHttpClient.dispatch2_doTest(Abstract
HttpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):114)
        at
org.apache.cactus.client.AbstractHttpClient.around2_doTest(AbstractHt
tpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):1218)
        at
org.apache.cactus.client.AbstractHttpClient.doTest(AbstractHttpClient
.java;org/apache/cactus/util/log/LogAspect.aj(1k):104)
        at
org.apache.cactus.AbstractWebTestCase.runGenericTest(AbstractWebTestC
ase.java:260)
        at
org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:133)
        at
org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:195)


FAILURES!!!
Tests run: 1,  Failures: 0,  Errors: 1


C:\cygwin\home\r-hirose\myApp\cactus_sample\MySampleWebApp\WEB-INF\classes>
-- end

and the server log is like this.

-- start
log4j:WARN No appenders could be found for logger
(org.apache.cactus.server.Serv
letTestRedirector).
log4j:WARN Please initialize the log4j system properly.
debug: setting up...
# testSimpleTest start
servlet hash :7960257
# testSimpleTest end
-- end

the debugging messages are written in the test class like below.
-- start
package cactest;

import org.apache.cactus.*;
import junit.framework.*;

public class TestHelloServlet extends ServletTestCase {

    public TestHelloServlet(String name) {
        super(name);
    }

    protected void setUp() {
        System.out.println("debug: setting up...");
    }

    protected void tearDown() {
    }

    public void beginSimpleTest(WebRequest webrequest)  {
    }

    public void testSimpleTest()
        throws java.io.IOException {
        System.out.println("# testSimpleTest start");
        HelloServlet servlet = new HelloServlet();
        System.out.println("servlet hash :" + servlet.hashCode());
        servlet.doGet(request, response);
        System.out.println("# testSimpleTest end");

    }
    public void endSimpleTest(WebResponse response)
        throws java.io.IOException {
        System.out.println("#endSimpleTest start");
        int idx = response.getText().indexOf("Hello");
        assertTrue("if found, success", idx != -1);
        System.out.println("#endSimpleTest end");
    }

}
-- end

also, when starting tomcat, it shows messages like this.
-- start
WebappClassLoader:
validateJarFile(C:\Tomcat41\webapps\wiki\WEB-INF\lib\servlet.
jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class:
jav
ax/servlet/Servlet.class
WebappClassLoader:
validateJarFile(C:\Tomcat41\webapps\MySampleWebApp\WEB-INF\l
b\servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2.
Offending
class: javax/servlet/Servlet.class
WebappClassLoader:
validateJarFile(C:\Tomcat41\webapps\MySampleWebApp\WEB-INF\li
b\servletapi-2.3.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2.
Off
ending class: javax/servlet/Servlet.class
-- end

does this have anything to do with the problem?


i really appreciate your help.
merci,
reiko




----- Original Message ----- 
From: "Vincent Massol" <vm...@pivolis.com>
To: "'Cactus Users List'" <ca...@jakarta.apache.org>
Sent: Thursday, October 02, 2003 2:42 PM
Subject: RE: the server returns the html source, not the test result.


> Hi Reiko,
>
> The servlet redirector is queried twice from the client side. Once to
> execute your test and another time to get the test result. It uses an
> XML format for test result. Instead you're getting the output from the
> first call.
>
> However, I don't have enough information to diagnosis the problem.
>
> Can you provide us with the client and server side logs please?
>
> Thanks
> -Vincent
>
> > -----Original Message-----
> > From: Reiko HIROSE [mailto:r-hirose@fjh.fujitsu.com]
> > Sent: 01 October 2003 01:52
> > To: cactus-user@jakarta.apache.org
> > Subject: the server returns the html source, not the test result.
> >
> > hi,
> >
> > i've been unable to get the test result from cactus.
> > the server does not return the test result. instead it returns the
> whole
> > html source which i wrote in the testee class.
> >
> > i found some similar cases on the web, but they refer to the cases
> > that the server returns 404 error.
> >
> > what i get is (in short. the whole message is at the end of this
> mail.):
> > org.apache.cactus.util.ChainedRuntimeException: Failed to get the test
> > results.
> > This is probably due to an error that happened on the server side when
> > trying to
> >  execute the tests. Here is what was returned by the server : [<html>
> > <head><title>
> > Hello
> > </title></head>
> > Hello
> > <body>
> > </body></html>
> > ]
> >         at
> > org.apache.cactus.client.AbstractHttpClient.dispatch2_doTest(Abstract
> > HttpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):120)
> >
> > but seems like ServletRedirector is workng. when i enter the url :
> >
> http://localhost:8080/MySampleWebApp/ServletRedirector?Cactus_Service=RU
> N_
> > TEST
> > it gives me back a blank page, which i think is what's expected to
> happen.
> >
> > -- start
> > (quoted from
> >
> http://www.google.co.jp/search?q=cache:RtTLyGOy6WEJ:javaboutique.interne
> t.
> > com/tutorials/StrutsTestCase/index-
> > 13.html+ServletRedirector%3FCactus_Service%3DRUN_TEST&hl=ja&ie=UTF-8)
> > To see if the ServletRedirector servlet is working, enter
> >
> >
> http://localhost:8080/cactusdvdlib/ServletRedirector?Cactus_Service=RUN_
> TE
> > ST
> > If you get a blank page back, the servlet works!
> > -- end
> >
> > the environment :
> > WIN2000
> > Apache Tomcat/4.1.24-LE-jdk14
> > cactus-1.4.1.jar
> > cactus-ant-1.4.1.jar
> >
> > i have a simple test class like this :
> > package cactest;
> > -- start
> > import org.apache.cactus.*;
> > import junit.framework.*;
> >
> > public class TestHelloServlet extends ServletTestCase {
> >
> >     public TestHelloServlet(String name) {
> >         super(name);
> >     }
> >
> >     protected void setUp() {
> >         System.out.println("debug: setting up...");
> >     }
> >
> >     protected void tearDown() {
> >     }
> >
> >     public void beginSimpleTest(WebRequest webrequest)  {
> >     }
> >
> >     public void testSimpleTest()
> >         throws java.io.IOException {
> >         System.out.println("# testSimpleTest start");
> >         HelloServlet servlet = new HelloServlet();
> >         System.out.println("servlet hash :" + servlet.hashCode());
> >         servlet.doGet(request, response);
> >         System.out.println("# testSimpleTest end");
> >     }
> >     public void endSimpleTest(WebResponse response)
> >         throws java.io.IOException {
> >         System.out.println("#endSimpleTest start");
> >         int idx = response.getText().indexOf("Hello");
> >         assertTrue("if found, success", idx != -1);
> >         System.out.println("#endSimpleTest end");
> >     }
> > }
> > -- end
> >
> > and here's my "cactus.properties"
> > -- start
> > cactus.contextURL=http://localhost:8080/MySampleWebApp
> > cactus.servletRedirectName=ServletRedirector
> > cactus.enableLogging=false
> > and the whole message from the server is :
> > -- end
> >
> > -- start
> >
> C:\cygwin\home\lei\myApp\cactus_sample\MySampleWebApp\WEB-INF\classes>j
> > ava
> > junit.textui.TestRunner cactest.TestHelloServlet
> > log4j:WARN No appenders could be found for logger
> > (org.apache.cactus.util.JUnitV
> > ersionHelper).
> > log4j:WARN Please initialize the log4j system properly.
> > .E
> > Time: 0.401
> > There was 1 error:
> > 1) testSimpleTest(cactest.TestHelloServlet)
> > org.apache.cactus.util.ChainedRuntimeException: Failed to get the test
> > results.
> > This is probably due to an error that happened on the server side when
> > trying to
> >  execute the tests. Here is what was returned by the server : [<html>
> > <head><title>
> > Hello
> > </title></head>
> > Hello
> > <body>
> > </body></html>
> > ]
> >         at
> > org.apache.cactus.client.AbstractHttpClient.dispatch2_doTest(Abstract
> > HttpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):120)
> >         at
> > org.apache.cactus.client.AbstractHttpClient.around2_doTest(AbstractHt
> > tpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):1218)
> >         at
> > org.apache.cactus.client.AbstractHttpClient.doTest(AbstractHttpClient
> > .java;org/apache/cactus/util/log/LogAspect.aj(1k):104)
> >         at
> > org.apache.cactus.AbstractWebTestCase.runGenericTest(AbstractWebTestC
> > ase.java:260)
> >         at
> > org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:133)
> >         at
> > org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:195)
> >
> > org.apache.cactus.client.ParsingException: Not a valid response
> >         at
> > org.apache.cactus.client.WebTestResultParser.readRootElement(WebTestR
> > esultParser.java;org/apache/cactus/util/log/LogAspect.aj(1k):140)
> >         at
> > org.apache.cactus.client.WebTestResultParser.dispatch29_parse(WebTest
> > ResultParser.java;org/apache/cactus/util/log/LogAspect.aj(1k):101)
> >         at
> > org.apache.cactus.client.WebTestResultParser.around29_parse(WebTestRe
> > sultParser.java;org/apache/cactus/util/log/LogAspect.aj(1k):1218)
> >         at
> > org.apache.cactus.client.WebTestResultParser.parse(WebTestResultParse
> > r.java;org/apache/cactus/util/log/LogAspect.aj(1k):96)
> >         at
> > org.apache.cactus.client.AbstractHttpClient.callGetResult(AbstractHtt
> > pClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):230)
> >         at
> > org.apache.cactus.client.AbstractHttpClient.dispatch2_doTest(Abstract
> > HttpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):114)
> >         at
> > org.apache.cactus.client.AbstractHttpClient.around2_doTest(AbstractHt
> > tpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):1218)
> >         at
> > org.apache.cactus.client.AbstractHttpClient.doTest(AbstractHttpClient
> > .java;org/apache/cactus/util/log/LogAspect.aj(1k):104)
> >         at
> > org.apache.cactus.AbstractWebTestCase.runGenericTest(AbstractWebTestC
> > ase.java:260)
> >         at
> > org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:133)
> >         at
> > org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:195)
> >
> >
> > FAILURES!!!
> > Tests run: 1,  Failures: 0,  Errors: 1
> >
> > -- end
> >
> > if you have a clue, could you help me?
> >
> > cheers,
> >
> > leiko
> >
> >
> > ---------------------------------------------------------------------
> > 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: the server returns the html source, not the test result.

Posted by Vincent Massol <vm...@pivolis.com>.
Hi Reiko,

The servlet redirector is queried twice from the client side. Once to
execute your test and another time to get the test result. It uses an
XML format for test result. Instead you're getting the output from the
first call.

However, I don't have enough information to diagnosis the problem.

Can you provide us with the client and server side logs please?

Thanks
-Vincent

> -----Original Message-----
> From: Reiko HIROSE [mailto:r-hirose@fjh.fujitsu.com]
> Sent: 01 October 2003 01:52
> To: cactus-user@jakarta.apache.org
> Subject: the server returns the html source, not the test result.
> 
> hi,
> 
> i've been unable to get the test result from cactus.
> the server does not return the test result. instead it returns the
whole
> html source which i wrote in the testee class.
> 
> i found some similar cases on the web, but they refer to the cases
> that the server returns 404 error.
> 
> what i get is (in short. the whole message is at the end of this
mail.):
> org.apache.cactus.util.ChainedRuntimeException: Failed to get the test
> results.
> This is probably due to an error that happened on the server side when
> trying to
>  execute the tests. Here is what was returned by the server : [<html>
> <head><title>
> Hello
> </title></head>
> Hello
> <body>
> </body></html>
> ]
>         at
> org.apache.cactus.client.AbstractHttpClient.dispatch2_doTest(Abstract
> HttpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):120)
> 
> but seems like ServletRedirector is workng. when i enter the url :
>
http://localhost:8080/MySampleWebApp/ServletRedirector?Cactus_Service=RU
N_
> TEST
> it gives me back a blank page, which i think is what's expected to
happen.
> 
> -- start
> (quoted from
>
http://www.google.co.jp/search?q=cache:RtTLyGOy6WEJ:javaboutique.interne
t.
> com/tutorials/StrutsTestCase/index-
> 13.html+ServletRedirector%3FCactus_Service%3DRUN_TEST&hl=ja&ie=UTF-8)
> To see if the ServletRedirector servlet is working, enter
> 
>
http://localhost:8080/cactusdvdlib/ServletRedirector?Cactus_Service=RUN_
TE
> ST
> If you get a blank page back, the servlet works!
> -- end
> 
> the environment :
> WIN2000
> Apache Tomcat/4.1.24-LE-jdk14
> cactus-1.4.1.jar
> cactus-ant-1.4.1.jar
> 
> i have a simple test class like this :
> package cactest;
> -- start
> import org.apache.cactus.*;
> import junit.framework.*;
> 
> public class TestHelloServlet extends ServletTestCase {
> 
>     public TestHelloServlet(String name) {
>         super(name);
>     }
> 
>     protected void setUp() {
>         System.out.println("debug: setting up...");
>     }
> 
>     protected void tearDown() {
>     }
> 
>     public void beginSimpleTest(WebRequest webrequest)  {
>     }
> 
>     public void testSimpleTest()
>         throws java.io.IOException {
>         System.out.println("# testSimpleTest start");
>         HelloServlet servlet = new HelloServlet();
>         System.out.println("servlet hash :" + servlet.hashCode());
>         servlet.doGet(request, response);
>         System.out.println("# testSimpleTest end");
>     }
>     public void endSimpleTest(WebResponse response)
>         throws java.io.IOException {
>         System.out.println("#endSimpleTest start");
>         int idx = response.getText().indexOf("Hello");
>         assertTrue("if found, success", idx != -1);
>         System.out.println("#endSimpleTest end");
>     }
> }
> -- end
> 
> and here's my "cactus.properties"
> -- start
> cactus.contextURL=http://localhost:8080/MySampleWebApp
> cactus.servletRedirectName=ServletRedirector
> cactus.enableLogging=false
> and the whole message from the server is :
> -- end
> 
> -- start
>
C:\cygwin\home\lei\myApp\cactus_sample\MySampleWebApp\WEB-INF\classes>j
> ava
> junit.textui.TestRunner cactest.TestHelloServlet
> log4j:WARN No appenders could be found for logger
> (org.apache.cactus.util.JUnitV
> ersionHelper).
> log4j:WARN Please initialize the log4j system properly.
> .E
> Time: 0.401
> There was 1 error:
> 1) testSimpleTest(cactest.TestHelloServlet)
> org.apache.cactus.util.ChainedRuntimeException: Failed to get the test
> results.
> This is probably due to an error that happened on the server side when
> trying to
>  execute the tests. Here is what was returned by the server : [<html>
> <head><title>
> Hello
> </title></head>
> Hello
> <body>
> </body></html>
> ]
>         at
> org.apache.cactus.client.AbstractHttpClient.dispatch2_doTest(Abstract
> HttpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):120)
>         at
> org.apache.cactus.client.AbstractHttpClient.around2_doTest(AbstractHt
> tpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):1218)
>         at
> org.apache.cactus.client.AbstractHttpClient.doTest(AbstractHttpClient
> .java;org/apache/cactus/util/log/LogAspect.aj(1k):104)
>         at
> org.apache.cactus.AbstractWebTestCase.runGenericTest(AbstractWebTestC
> ase.java:260)
>         at
> org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:133)
>         at
> org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:195)
> 
> org.apache.cactus.client.ParsingException: Not a valid response
>         at
> org.apache.cactus.client.WebTestResultParser.readRootElement(WebTestR
> esultParser.java;org/apache/cactus/util/log/LogAspect.aj(1k):140)
>         at
> org.apache.cactus.client.WebTestResultParser.dispatch29_parse(WebTest
> ResultParser.java;org/apache/cactus/util/log/LogAspect.aj(1k):101)
>         at
> org.apache.cactus.client.WebTestResultParser.around29_parse(WebTestRe
> sultParser.java;org/apache/cactus/util/log/LogAspect.aj(1k):1218)
>         at
> org.apache.cactus.client.WebTestResultParser.parse(WebTestResultParse
> r.java;org/apache/cactus/util/log/LogAspect.aj(1k):96)
>         at
> org.apache.cactus.client.AbstractHttpClient.callGetResult(AbstractHtt
> pClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):230)
>         at
> org.apache.cactus.client.AbstractHttpClient.dispatch2_doTest(Abstract
> HttpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):114)
>         at
> org.apache.cactus.client.AbstractHttpClient.around2_doTest(AbstractHt
> tpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):1218)
>         at
> org.apache.cactus.client.AbstractHttpClient.doTest(AbstractHttpClient
> .java;org/apache/cactus/util/log/LogAspect.aj(1k):104)
>         at
> org.apache.cactus.AbstractWebTestCase.runGenericTest(AbstractWebTestC
> ase.java:260)
>         at
> org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:133)
>         at
> org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:195)
> 
> 
> FAILURES!!!
> Tests run: 1,  Failures: 0,  Errors: 1
> 
> -- end
> 
> if you have a clue, could you help me?
> 
> cheers,
> 
> leiko
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org