UNCLASSIFIED

Thanks Chris! 

-----Original Message-----
From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Sent: Thursday, 16 June 2011 5:01 AM
To: Tomcat Users List
Subject: Re: Embedded tomcat and unit testing.. Tomcat either stops or
my unit tests don't execute? [SEC=UNCLASSIFIED]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

James,

On 6/15/2011 12:09 AM, Fraser, James wrote:
> 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.

That might do it, depending on what resource was under contention (such
as a port number).

Also, calling Tomcat.getServer().await() is /intended/ to block until
the server shuts down. If you run that in your test setup, the test will
never run because it's waiting for Tomcat to shut down.

Instead, I suspect you want to do everything but the "await" in your
test setup, and as you discovered, make sure you shut it down in your
teardown code.

As Chuck points out, Tomcat's internal unit-testing code uses the Tomcat
class and can serve as a useful set of examples if you need further
inspiration.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk35CHgACgkQ9CaO5/Lv0PABxQCeOeNtdE7PjvoyuSDywzV3WSla
2PkAnRWemhH6FeJJ8PlnXT3rfFuhBgRa
=JYsd
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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