• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Running JUnit against TomCat server from Ant

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have a bunch of j-unit tests I have written, half of which have to be run from my TomCat server (integration style tests). In my build script I am deploying my WAR to the TomCat server.

My question is, is it possible to get Ant to run these j-unit tests on the running TomCat server using the <junit> task? I don't want to go down the route of Cactus or something, as the tests that require TomCat running are designed to be full integration tests where the environment is setup as a production environment.

Cheers,

Ants.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, you can't do that with the <junit> task unless you write your own TestRunner implementation that contacts your application running on Tomcat and sends it a list of class names to execute as JUnit tests.

Effectively, you'd be reinventing Cactus...
 
Anthony Bull
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Lasse Koskela:
No, you can't do that with the <junit> task unless you write your own TestRunner implementation that contacts your application running on Tomcat and sends it a list of class names to execute as JUnit tests.

Effectively, you'd be reinventing Cactus...



Ok, I know how to get my build script to kick my unit testing off on the TomCat server - all I need to know is - can I somehow log the results of the unit tests and then get my build script to generate a report based on those? And also fail or email a failure message based on the results?
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Again, Cactus would do this (collect test results) for you. I know that Cactus is a bit of a pain to set up but once you've done that, it should be a relatively smooth ride (compared to writing your own).
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic