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.caldar...@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.fra...@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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to