This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Hi, Both of the websites for these frameworks make note of each other.
I'm just not too clear right now on how they differ from each other. Both frameworks note that one can use the other. Cactus notes that you can use JUnitEE to run your tests from a browser and JUnitEE notes that Cactus has a really useful ant task.
Does anyone have experience with either or both of these tools? I'd like to hear your opinions
JUnitEE is a much simpler framework than Cactus, and provides a mechanism with which to invoke regular JUnit tests inside the container. You write your JUnit tests as normal and deploy them along with your application. You then (from your browser) request a predefined Servlet and tell it which JUnit tests to run. The results are then presented to you in a readble HTML form. Cactus on the other hand is a much more complex beast and provides you with a ready-made set of classes from which you can write tests for Servlets, JSPs, taglibs and EJBs. With JUnitEE, writing standard JUnit tests doesn't provide you with easy access to the environment, meaning that you can't easily run assertions on things like the current ServletRequest, response, etc. The classes (test cases) that you extend in Cactus provide you with wrappers to the actual objects that are currently "live" within the server. In other words, you can actually get access to things like the current ServletRequest and run assertions against it. <shameless plug> The thing that I don't like about Cactus is its support for testingJSP custom tags as you have to test them by writing the code to mimic the way that the JSP container uses them. If you need to test custom tags, check out TagUnit for an alternative that allows you to write tests within JSP. </shameless plug> Cheers Simon
I've set up my JUnit tests as part of my Ant build process in the past to verify that a build was good. Is that possible with either of these frameworks? E.g., I write test cases to test my servlet, and then as part of the build/deploy cycle, run the test set to verify that all is well in development land.