You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@attic.apache.org by se...@apache.org on 2015/08/19 19:50:27 UTC
svn commit: r1696636 [6/6] - in /jakarta/site/docs/cactus: ./ images/
integration/ integration/eclipse/ integration/manual/ integration/maven/
participating/ resources/ writing/
Added: jakarta/site/docs/cactus/writing/howto_ejb.html
URL: http://svn.apache.org/viewvc/jakarta/site/docs/cactus/writing/howto_ejb.html?rev=1696636&view=auto
==============================================================================
--- jakarta/site/docs/cactus/writing/howto_ejb.html (added)
+++ jakarta/site/docs/cactus/writing/howto_ejb.html Wed Aug 19 17:50:26 2015
@@ -0,0 +1,544 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+
+
+
+
+
+
+
+
+<html>
+ <head>
+
+
+ <title>Jakarta Cactus -
+ EJB Testing with Cactus Howto</title>
+ <style type="text/css" media="all">
+ @import url("http://jakarta.apache.org/cactus/css/maven-base.css");
+ @import url("http://jakarta.apache.org/cactus/css/maven-theme.css");
+ @import url("http://jakarta.apache.org/cactus/css/site.css");
+ </style>
+ <link rel="stylesheet" href="http://jakarta.apache.org/cactus/css/print.css" type="text/css" media="print" />
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ </head>
+ <body class="composite">
+
+
+<div style="background: red"><h1>2011/08/05 - Jakarta Cactus has been retired. </h1><h2>For more information, please explore the <a href="http://attic.apache.org/">Attic</a>. </h2></div>
+ <div id="banner">
+ <a href="" id="bannerLeft">
+
+ <img src="http://jakarta.apache.org/cactus/images/logocactus.gif" alt="" />
+
+ </a>
+ <a href="http://jakarta.apache.org/cactus/" id="bannerRight">
+
+ <img src="http://jakarta.apache.org/cactus/images/jakarta-logo.gif" alt="" />
+
+ </a>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ <div id="breadcrumbs">
+
+
+
+
+
+
+
+ <div class="xleft">
+ Last Published: 01/18/2009
+ |
+ <a href="http://www.apache.org/">Apache</a>
+ >
+
+ <a href="http://www.jakarta.apache.org/">Jakarta</a>
+ >
+
+ <a href="http://jakarta.apache.org/cactus/">Cactus</a>
+ </div>
+ <div class="xright">
+
+
+
+
+
+
+ </div>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ <div id="leftColumn">
+ <div id="navcolumn">
+
+
+
+
+
+
+
+ <h5>About</h5>
+ <ul>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/index.html">Overview</a>
+ </li>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/goals.html">Goals</a>
+ </li>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/features.html">Features</a>
+ </li>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/news.html">News</a>
+ </li>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/downloads.html">Downloads</a>
+ </li>
+
+ <li class="none">
+ <a href="http://issues.apache.org/jira/secure/BrowseProject.jspa?id=10471">Bug Database</a>
+ </li>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/mail-lists.html">Mailing Lists</a>
+ </li>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/faq.html">FAQ</a>
+ </li>
+
+ <li class="none">
+ <a href="http://wiki.apache.org/jakarta-cactus/FrontPage">Wiki</a>
+ </li>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/license.html">License</a>
+ </li>
+ </ul>
+ <h5>Project Documentation</h5>
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="collapsed">
+ <a href="http://jakarta.apache.org/cactus/project-info.html">Project Information</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="collapsed">
+ <a href="http://jakarta.apache.org/cactus/project-reports.html">Project Reports</a>
+ </li>
+ </ul>
+ <h5>Documentation</h5>
+ <ul>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/getting_started.html">Getting started</a>
+ </li>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/how_it_works.html">How it works</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="expanded">
+ <strong>Writing tests</strong>
+ <ul>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/writing/howto_ejb_j2eeri.html">Howto EJB</a>
+ </li>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/writing/howto_ejb_3.html">Howto EJB3</a>
+ </li>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/writing/howto_httpunit.html">Howto HTTPUnit</a>
+ </li>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/writing/howto_htmlunit.html">Howto HTMLUnit</a>
+ </li>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/writing/howto_jsp.html">Howto JSP</a>
+ </li>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/writing/howto_security.html">Howto Security</a>
+ </li>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/writing/howto_testcase.html">Howto TestCase</a>
+ </li>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/writing/howto_testcase_jsp.html">Howto TestCase-JSP</a>
+ </li>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/writing/howto_testcase_filter.html">Howto TestCase-Filter</a>
+ </li>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/writing/howto_testcase_servlet.html">Howto TestCase-Servlet</a>
+ </li>
+ </ul>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="collapsed">
+ <a href="http://jakarta.apache.org/cactus/integration/index.html">Running tests</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="collapsed">
+ <a href="http://jakarta.apache.org/cactus/participating/index.html">Participating</a>
+ </li>
+ </ul>
+ <h5>Miscellaneous</h5>
+ <ul>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/cactusname.html">Why the name</a>
+ </li>
+
+ <li class="none">
+ <a href="http://jakarta.apache.org/cactus/mock_vs_cactus.html">Mock vs Container</a>
+ </li>
+
+ <li class="none">
+ <a href="http://wiki.apache.org/jakarta-cactus/TestedOn">Tested On...</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="collapsed">
+ <a href="http://jakarta.apache.org/cactus/resources/index.html">Resources</a>
+ </li>
+ </ul>
+ <h5>Translations</h5>
+ <ul>
+
+ <li class="none">
+ <a href="http://www.ressources-java.net/cactus">French</a>
+ </li>
+
+ <li class="none">
+ <a href="http://jakarta.apache-korea.org/cactus/index.html">Korean</a>
+ </li>
+
+ <li class="none">
+ <a href="http://www.jajakarta.org/cactus/">Japanese</a>
+ </li>
+ </ul>
+ <h5>See also</h5>
+ <ul>
+
+ <li class="none">
+ <a href="http://www.apachebookstore.com/">Apache Bookstore</a>
+ </li>
+
+ <li class="none">
+ <a href="http://www.planetapache.org/">Planet Apache</a>
+ </li>
+
+ <li class="none">
+ <a href="http://apache.org/foundation/thanks.html">Apache Sponsors</a>
+ </li>
+ </ul>
+
+
+
+ <a href="http://jakarta.apache.org/cactus/" title="Jakarta Cactus" id="poweredBy">
+ <img alt="Jakarta Cactus" src="http://jakarta.apache.org/cactus/images/cactusbanner.gif" />
+ </a>
+
+
+
+
+
+
+
+ </div>
+ </div>
+ <div id="bodyColumn">
+ <div id="contentBox">
+
+
+
+
+
+
+ <a name="Introduction"></a><div class="section"><h2>Introduction</h2>
+ <p>
+ This document explains how to unit test EJBs with Cactus. It is
+ divided in 2 parts:
+ </p>
+ <ul>
+ <li>
+ <a href="howto_ejb.html#ejb_general">General concepts</a>: explains the
+ generic concepts behind EJB unit testing with Cactus,
+ </li>
+ <li>
+ <a href="howto_ejb.html#ejb_j2eeri">J2EE RI tutorial</a>: provides a
+ detailed tutorial, on a sample, on how to explicitely perform EJB
+ unit testing with the
+ <a href="http://java.sun.com/j2ee/download.html#sdk">J2EE Reference
+ Implementation</a> server from Sun.
+ </li>
+ </ul>
+
+ <note>
+ EJB unit testing works with Cactus 1.0 or later.
+ </note>
+
+ <note>
+ EJB3 unit testing works with Cactus 1.8.1 or later.
+ </note>
+ </div>
+
+ <anchor id="ejb_general"></anchor>
+ <a name="General Concepts"></a><div class="section"><h2>General Concepts</h2>
+
+ <a name="Why use Cactus for testing EJBs?"></a><div class="section"><h2>Why use Cactus for testing EJBs?</h2>
+
+
+ You might be wondering why you would use Cactus to unit test your
+ EJBs whereas you could use standard JUnit test cases. Indeed,
+ you could write a standard JUnit test case and view your code as
+ client side code for the EJB to test ... There are actually a few
+ reasons to choose Cactus instead:
+
+ <ul>
+ <li>
+ If you are using local interfaces (EJB 2.0), then your beans cannot be called remotely
+ (i.e. the caller need to be in the same jvm). However, as all Cactus redirectors run on
+ the server side, you can unit test your local interfaces with Cactus.
+ </li>
+ <li>
+ Very often the production code that will call the EJBs is server
+ side code (Servlets, JSPs, Tag libs or Filters). This means that if
+ you run the tests from a standard JUnit test case, your tests will
+ run in a different execution environment than the production one,
+ which can lead to different test results,
+ </li>
+ <li>
+ An application using EJBs very often includes a front end part which
+ is in almost all cases a web application (i.e. using Servlets,
+ JSP, Tag libs or Filters). It means that you would also need a
+ framework for unit testing these components. Cactus is providing
+ a comprehensive and consistent framework for testing all server
+ side components. This is a compelling enough reason to use it !
+ </li>
+ <li>
+ Cactus provides automated Ant tasks to automatically start your
+ EJB server, run the tests and stop it, thus automating your
+ entire test process and making it easy to implement continuous
+ build and continuous integration of your J2EE project.
+ </li>
+ </ul>
+
+ </div>
+
+ <a name="The process"></a><div class="section"><h2>The process</h2>
+
+
+ You can unit test your EJBs from any of Cactus redirectors:
+ <code>ServletTestCase</code>, <code>JspTestCase</code> or
+ <code>FilterTestCase</code>.
+
+
+ This means that you would write a test case class that extends any
+ of Cactus redirectors, get a home reference to your EJB, create an
+ instance of it, call the method to test and perform asserts on the
+ result.
+
+
+ It is that simple ! What is slightly more complex is the deployment
+ of your EJBs to your EJB container but you should be familiar with
+ this, right?
+
+
+ </div>
+
+ </div>
+
+ <anchor id="ejb_j2eeri"></anchor>
+ <a name="J2EE RI Tutorial"></a><div class="section"><h2>J2EE RI Tutorial</h2>
+
+
+ This <a href="howto_ejb_j2eeri.html">J2EE RI tutorial</a>
+ is a step by step guide for writing Cactus EJB unit test for the
+ Sun J2EE RI server.
+
+
+ </div>
+
+
+
+ </div>
+ </div>
+ <div class="clear">
+ <hr/>
+ </div>
+ <div id="footer">
+ <div class="xright">©
+ 2001-2009
+
+ Apache Software Foundation
+
+
+
+
+
+
+
+ </div>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ </body>
+</html>
Propchange: jakarta/site/docs/cactus/writing/howto_ejb.html
------------------------------------------------------------------------------
svn:eol-style = native