jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@octo.com>
Subject RE: Stopping test mode
Date Sat, 22 Feb 2003 10:56:11 GMT
Hi Rick,

Several comments/questions (not sure they are related to your issue or
not):

1/ You're doing a <sleep> before the runservertests. Does this mean that
you are not using runservertests to start Resin and that it is started
before your run the deployandtest target?

2/ Can you confirm that Resin is not stopped when <runservertests>
exists (It shouldn't if Resin was started before runservertests
executes)?

3/ Why don't you use <junit> for the teststruts target (in the same way
as you've used it for the testresin target)?

4/ Could you show us the error you're getting (stacktrace, console)?

Don't worry, we'll crack it!

Thanks
-Vincent

> -----Original Message-----
> From: Morris, Rick [mailto:rick.morris@brightpoint.com]
> Sent: 17 February 2003 12:49
> To: 'Vincent Massol'
> Subject: RE: Stopping test mode
> 
> Here's the section of my web.xml file that starts the tests and I've
> attached the test case. As I said, the test case runs fine if I bypass
the
> struts test.
> I'm sure I've done something foolish, I just don't know what.
> Thanks for the help
> 
> 
>   <target name="deployandtest" depends="move">
>     <echo message="Waiting for resin to unpack the war file"/>
>     <sleep seconds="5"/>
>     <runservertests
>
testURL="http://localhost/junittest/ServletRedirector?Cactus_Service=RUN
_T
> ES
> T"
>         startTarget="startresin"
>         stopTarget="stopresin"
>         testTarget="testresin"/>
> 
>     <antcall target="teststruts"/>
>     <antcall target="testhttpunit"/>
> 
>   </target>
> 
>   <target name="testresin">
>     <junit printsummary="yes" haltonfailure="yes" haltonerror="yes"
> fork="yes">
> 
>       <classpath>
>         <!-- Cactus.properties and log_client.properties need to be in
>              the classpath -->
>         <pathelement location="${target.conf.dir}"/>
>         <fileset dir="${resin.home}/webapps/${app.name}/WEB-INF/lib">
>           <include name="*.jar"/>
>         </fileset>
>         <pathelement location="${servlet.jar}"/>
>         <pathelement location="${testcases.dir}"/>
>       </classpath>
> 
>       <formatter type="plain" usefile="false"/>
>       <test name="test.com.brightpoint.cactus.MapperServletTest"/>
>       <test name="test.com.brightpoint.cactus.TestSampleServlet"/>
> 
>     </junit>
>   </target>
> 
>   <target name="teststruts">
>     <java fork="yes" classname="junit.textui.TestRunner"
taskname="junit"
> failonerror="true">
>       <arg value="test.com.brightpoint.struts.TestCactusLoginAction"/>
>       <classpath>
>         <pathelement location="build/lib/${app.name}.jar"/>
>         <pathelement location="build/lib/${app.name}-cactus.jar"/>
>         <pathelement location="${testcases.dir}"/>
>         <pathelement location="${servlet.jar}"/>
>         <pathelement location="${cactus.struts.jar}"/>
>         <pathelement location="${cactus.jar}"/>
>         <pathelement location="${struts.jar}"/>
>         <pathelement location="conf/"/>
>         <path refid="compile.classpath"/>
>         <pathelement path=""/>
>         <pathelement path="${java.class.path}"/>
>       </classpath>
>     </java>
>   </target>
> 
>   <target name="testhttpunit">
>     <junit printsummary="yes" haltonfailure="yes" haltonerror="yes"
> fork="yes">
> 
>       <classpath>
>         <fileset dir="${resin.home}/webapps/${app.name}/WEB-INF/lib">
>           <include name="*.jar"/>
>         </fileset>
>         <pathelement location="${servlet.jar}"/>
>         <pathelement location="${testcases.dir}"/>
>       </classpath>
> 
>       <formatter type="plain" usefile="false"/>
>       <test name="test.com.brightpoint.httpunit.LoginTest"/>
> 
>     </junit>
>   </target>
> 
> 
> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@octo.com]
> Sent: Sunday, February 16, 2003 4:22 AM
> To: 'Cactus Users List'
> Cc: Morris, Rick
> Subject: RE: Stopping test mode
> 
> 
> Hi Rick,
> 
> The only thing I can think of is that the Servlet Config is not
isolated
> in the tests, that is if you put values in it (either from your test
> case or from the code under test) then these values will be
remembered,
> thus potentially affecting calls to your application afterwards.
> 
> We would need more information to help you. Could you provide the
> simpler possible test case that make your HTTPunit tests fail? Could
you
> also provide us with your web.xml and the URL you're using from you're
> the HTTPunit test?
> 
> Thanks
> -Vincent
> 
> > -----Original Message-----
> > From: Morris, Rick [mailto:rick.morris@brightpoint.com]
> > Sent: 14 February 2003 21:25
> > To: 'Cactus Users List'
> > Subject: RE: Stopping test mode
> >
> > Some background: The application is a simple login/welcome Struts
> > application like we've all (including me) used before. Nothing
> > complicated.
> >
> > The error happens when I run the HttpUnit tests in my build.xml
file.
> The
> > HttpUnit tests run after the Cactus servlet tests. The Cactus tests
> > complete
> > successfully (or at least they say they do). The HttpUnit tests,
which
> run
> > text, fail because they aren't getting the proper responses back
from
> > Resin.
> >
> > I have the same problem if, after the tests fail, I try to access
the
> > application normally through a browser. I do the login page and get
a
> > blank
> > response page back from the container.
> >
> > If I stop and restart the container, things work as expected.
> >
> > It is a little refreshing to hear that it sounds odd to someone else
> as
> > well.
> >
> >
> > -----Original Message-----
> > From: Nicholas Lesiecki [mailto:nick@eblox.com]
> > Sent: Friday, February 14, 2003 3:17 PM
> > To: Cactus Users List
> > Subject: RE: Stopping test mode
> >
> >
> > Rick,
> >
> > This problem seems odd. Unless the tests are still (actively)
running
> the
> > Redirector should passively wait for new requests and not affect
> anything.
> > Can you share any further details about your error?
> >
> > Cheers,
> > Nick
> >
> > > -----Original Message-----
> > > From: Morris, Rick [mailto:rick.morris@brightpoint.com]
> > > Sent: Friday, February 14, 2003 11:38 AM
> > > To: 'cactus-user@jakarta.apache.org'
> > > Subject: Stopping test mode
> > >
> > >
> > > I've looked through the list archives and the FAQ, but still can't
> find
> > an
> > > answer to my question.
> > >
> > > Once I have executed the Cactus tests in Ant using the
> > > ServletRedirector?Cactus_Service=RUN_TEST command, is there any
> > > way to make
> > > the servlet redirector gracefully bow out of the picture after the
> tests
> > > have been run?
> > >
> > > What I have found, which could certainly be my error, is that
after
> the
> > > Cactus tests have run successfully, the application being tested
> doesn't
> > > function properly.
> > >
> > > I am not starting and stopping Resin through Ant since we run
Resin
> in
> > > tandem with Apache.
> > >
> > > Any suggestions appreciated, including RTFM if it includes a
> reference
> > to
> > > the appropriate section of the manual.
> > >
> > > Rick Morris
> > > Brightpoint North America
> > > 501 Airtech Parkway
> > > Plainfield IN 46168
> > > Phone: 317-707-2312
> > >
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > 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
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: cactus-user-help@jakarta.apache.org
> 



Mime
View raw message