tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fraser, James" <James.Fra...@dsto.defence.gov.au>
Subject RE: Embedded tomcat and unit testing.. Tomcat either stops or my unit tests don't execute? [SEC=UNCLASSIFIED]
Date Wed, 15 Jun 2011 04:09:12 GMT
UNCLASSIFIED

Hi Chuck,

Thanks for your help. I got it working in the end. I suspect the main
problem had to do with not terminating the running instance of Tomcat
correctly in a tear-down method. I solved this using the example in the
Tomcat unit tests; i.e.

 @AfterClass
    public static void tearDownClass() throws LifecycleException {
        if (tomcat.getServer() != null
                && tomcat.getServer().getState() !=
LifecycleState.DESTROYED) {
            if (tomcat.getServer().getState() != LifecycleState.STOPPED)
{
                tomcat.stop();
            }
            tomcat.destroy();
        }
    }

- James 

-----Original Message-----
From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com]
Sent: Wednesday, 15 June 2011 11:27 AM
To: Tomcat Users List
Subject: RE: Embedded tomcat and unit testing.. Tomcat either stops or
my unit tests don't execute? [SEC=UNCLASSIFIED]

> From: Fraser, James [mailto:James.Fraser@dsto.defence.gov.au]
> Subject: RE: Embedded tomcat and unit testing.. Tomcat either stops or

> my unit tests don't execute? [SEC=UNCLASSIFIED]

> I read that Apache use embedded Tomcat for unit testing. Are there any

> examples floating around?

Good thought.  I believe all of the tests are in the Tomcat source
download; they run inside junit.

I'm sure Mark T could tell you exactly what's wrong, but I suspect he's
sleeping at the moment (UK).

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


IMPORTANT: This email remains the property of the Department of Defence
and is subject to the jurisdiction of section 70 of the Crimes Act 1914.
If you have received this email in error, you are requested to contact
the sender and delete the email.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message