ALM/Test Automation

JUnitEE vs Catcus

Terry Cho 2007. 8. 27. 22:45
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 testing JSP 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
==
정리하자면, JUnitEE는 JUnit테스트를 단순하게, Server container안에서 동작하게 해주는것이고, Catcus는 JSP,TagLib,Servlet,EJB에 대한 좀더 구체적인 테스트 프레임웍을 제공한다. (HTTP로 Request를 넣어서 Response를 받는것은 HttpUnit을 사용해야 한다.)

그리드형

'ALM > Test Automation' 카테고리의 다른 글

Cactus 빌드 스크립트 샘플  (0) 2007.09.12
Unit Testing WebLogic Workshop 8.1 Applications & JWebUnit  (0) 2007.08.27
DBUnit 예제  (1) 2007.08.27
단위 성능 테스트  (0) 2007.08.24
단위 테스트 방법  (0) 2007.08.24