Sean,
That's cool, thanks ! :-)
Yes, please submit it to this list. However, can you submit it :
- either in XML format as attached (all our docs are generated from XML
to which we apply a stylesheet),
- or in plain text (no formatting) as I will then take you doc and
transform it to XML.
Thanks
-Vincent
> -----Original Message-----
> From: Sean Zhang [mailto:[EMAIL PROTECTED]]
> Sent: 16 January 2002 23:03
> To: Cactus Users List
> Subject: RE: Best way to run Cactus in an IDE (WAS RE: Using Cactus to
> test EJB deployed to Weblogic6.1)
>
> Vincent,
>
> I will write a detailed instruction for JBuilder5 and Weblogic6.1.
Should
> I
> submit it to this mailing list? Does the mailing list take word
> attachment?
>
> Thanks,
>
> Sean
>
> -----Original Message-----
> From: Vincent Massol [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 16, 2002 4:55 PM
> To: 'Cactus Users List'
> Subject: RE: Best way to run Cactus in an IDE (WAS RE: Using Cactus to
> test EJB deployed to Weblogic6.1)
>
>
> Sean,
>
> I am really amazed that it worked ! :-) I can't believe the
instructions
> I gave were working fine as is ... Could you post the changes you had
to
> make so that we can prepare a page and put it on the Cactus web page ?
>
> How long did you spend ? Was it hard to set up ? Do you think you can
> post (at your own pace and whenever you have some time of course)
> detailed instructions for JBuilder 5 ? What we could do is put the
> general instructions I gave below + add some detailed ones for
specific
> IDEs ?
>
> Thanks
> -Vincent
>
> > -----Original Message-----
> > From: Sean Zhang [mailto:[EMAIL PROTECTED]]
> > Sent: 16 January 2002 19:06
> > To: Cactus Users List
> > Subject: RE: Best way to run Cactus in an IDE (WAS RE: Using Cactus
to
> > test EJB deployed to Weblogic6.1)
> >
> > Vincent,
> >
> > Thanks so much. I followed your steps successfully.
> >
> > One suggestion for anyone who wants to do the same, add
> cactus.properties
> > to your client classpath (such as cactus library defined in
JBuilder).
> >
> > Thanks again,
> >
> > Sean
> >
> > -----Original Message-----
> > From: Vincent Massol [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, January 10, 2002 5:49 PM
> > To: 'Cactus Users List'
> > Subject: Best way to run Cactus in an IDE (WAS RE: Using Cactus to
> test
> > EJB deployed to Weblogic6.1)
> >
> >
> > Here is I think the best way to run Cactus tests from an IDE. I'll
use
> > WebLogic 6.1 as an example but it works with any other application
> > server although you need to adapt it a bit (you can have a look at
the
> > Ant scripts provided as part of the Cactus distribution to learn how
> to
> > start your servlet engine/application server in a directory other
than
> > the default).
> >
> > A - Setup
> > -----------
> >
> > 1/ Have the following kind of directory structure :
> >
> > myproject
> > |_ src
> > |_ output
> > |_config
> > |_ mydomain
> > |_ applications
> > |_ mywebapp
> > |_ WEB-INF
> > |_ classes
> > |_ web.xml
> > |_ lib
> > |_ config.xml
> > |_ SerializedsystemIni.dat
> > |_ fileRealm.properties
> >
> > 2/ In your IDE, set the output classes directory to be
> >
myproject/output/config/mydomain/applications/mywebapp/WEB-INF/classes
> >
> > 3/ Ensure that you have the cactus redirectors defined in web.xml
> >
> > 4/ Copy cactus.properties to
> >
myproject/output/config/mydomain/applications/mywebapp/WEB-INF/classes
> >
> > 5/ Ensure that you have cactus.jar, junit.jar,
commons-httpclient.jar
> > (and optionally log4j.jar) in
> > myproject/output/config/mydomain/applications/mywebapp/WEB-INF/lib
> >
> > 6/ Create an entry in your IDE to start weblogic, using the
following
> > parameters :
> >
> > class name : weblogic.Server
> > class path : weblogic_sp.jar (if it exists) and weblogic.jar
> > jvm arguments :
> >
> > "-hotspot"
> > "-ms64m"
> > "-mx64m"
> > "-Djava.library.path=<bea home>/wlserver6.1/bin"
> > "-Dweblogic.RootDirectory=myproject/output"
> > "-Dweblogic.Domain=mydomain"
> > "-Dweblogic.Name=testserver" (name defined in your WL config.xml
file)
> > "-Dbea.home=<bea home>"
> > "-Dweblogic.management.password=<your password>"
> > "-Djava.security.policy==./lib/weblogic.policy"
> >
> > B- Running a test
> > ------------------
> >
> > 1/ Start weblogic from the defined entry above (in step A-6). You
only
> > need to do this once and do not need to repeat it for each test.
> > Modified classes should be reloaded automatically. If your IDE does
> not
> > support this, you may have to start weblogic manually beforehand,
> using
> > a script for example.
> >
> > *WARNING* : Make sure that your IDE does not prepend your output
> classes
> > directory to the classpath being used to start weblogic. Otherwisem
> your
> > classes will be loaded using the system classloader and won't be
> > reloadable, which means you would have to repeat this step for each
> test
> > run.
> >
> > 2/ Choose a test case class with a main method and run it. Normally
> your
> > IDE will prepend to the classpath the output classes directory.
> Normally
> > you would also have included the cactus.jar, junit.jar,
> > commons-httpclient.jar in your project classpath (to compile the
> > project), thus they would also be added. As you put
cactus.properties
> in
> > WEB-INF/classes (i.e. in your class output directory) the client
part
> of
> > cactus will find it. Configure cactus.properties to point to
> > http://localhost:<port used in
config.xml>/mywebapp/ServletRedirector
> >
> > 3/ Try modifying the test class or a class under test and rerun it
> > without stopping weblogic. The changes should be picked up.
> >
> > C- Conclusion
> > -------------
> >
> > I'm writing this from memory so I may be forgetting stuff. Tell me
if
> it
> > works. I'll try it when I have some time ... If you tell me it
works,
> > I'll put these instructions on the cactus web site.
> >
> > Thanks
> > -Vincent
> >
> > > -----Original Message-----
> > > From: Sean Zhang [mailto:[EMAIL PROTECTED]]
> > > Sent: 10 January 2002 20:26
> > > To: Cactus Users List
> > > Subject: RE: Using Cactus to test EJB deployed to Weblogic6.1
> > >
> > > Thanks Vincent!
> > >
> > > I have set up Jbuilder5 with Cactus and my plan is to run my test
in
> > > Jbuilder to test EJBs deployed on Weblogic. Please help with
> > following
> > > questions:
> > >
> > > 1. I edited cactus.properties like following
> > > Cactus.servletRedirectorURL =
> > > http://localhost:7001/ServletRedirector/ (assuming I deploy EJBs
> > classes
> > > to
> > > classes directory under default app) Is this correct?
> > > 2. Do I need to copy cactus.jar, junit.jar to lib directory
under
> > the
> > > Web-inf under DefaultWebApp? Another other jar files need to be
> moved
> > > there?
> > > 3. I also edited web.xml file in Web-inf directory on
Weblogic to
> > add
> > > the redirector mapping.
> > >
> > > Any other configuration I need to modify?
> > >
> > > Thanks,
> > >
> > > Sean
> > >
> > > -----Original Message-----
> > > From: Vincent Massol [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, January 09, 2002 3:59 PM
> > > To: 'Cactus Users List'
> > > Subject: RE: Using Cactus to test EJB deployed to
> > > Weblogic6.1
> > >
> > > I know that this message is addressed to David but maybe
> > I
> > > can still
> > > help a bit ... :-)
> > >
> > > > -----Original Message-----
> > > > From: Sean Zhang [mailto:[EMAIL PROTECTED]]
> > > > Sent: 09 January 2002 21:45
> > > > To: Cactus Users List
> > > > Subject: RE: Using Cactus to test EJB deployed to
> > > Weblogic6.1
> > > >
> > > > Hi, David,
> > > >
> > > > Thanks for your message. I'm actually at Dallas
> > (former
> > > GTE). Are
> > > you
> > > > working at Verizon as well?
> > > >
> > > > Do you think Cactus is a good testing tool for EJBs?
> > >
> > > Yes, for unit testing EJBs. No for stress/load testing.
> > >
> > > > Can Cactus be used
> > > > to
> > > > test regular beans deployed to Weblogic as well?
> > >
> > > yes
> > >
> > > > Does it use the same way
> > > > to test regular beans as EJBs?
> > >
> > > Yes
> > >
> > > > Sorry that I throw a lot of questions.
> > > > I'm
> > > > new to this.
> > > >
> > > > By the way, have you set up Cactus with your IDE?
> > > (specifically
> > > Jbuilder5
> > > > which we are using now)
> > >
> > > I did set it up with JBuilder4 but haven't tried it with
> > > JBuilder5 nor 6
> > > yet (although I don't see why it would be a problem). On
> > > this subject
> > > you can check
> > > http://jakarta.apache.org/cactus/howto_ide.html
> > >
> > > -Vincent
> > >
> > > >
> > > > Thanks and have a great afternoon,
> > > >
> > > > Sean
> > > >
> > > > -----Original Message-----
> > > > From: David L. Wasler
> > > [mailto:[EMAIL PROTECTED]]
> > > > Sent: Wednesday, January 09, 2002 3:35
> > PM
> > > > To: Cactus Users List
> > > > Subject: Re: Using Cactus to test
> > EJB
> > > deployed to
> > > > Weblogic6.1
> > > >
> > > > Hi Sean:
> > > >
> > > > I have been using Cactus on WL 6.1, I'm
> > not
> > > an expert
> > > > on Cactus, but it does work on WL 6.1
> > > >
> > > > Which Verizon location are you at VA
> > near
> > > DC.
> > > >
> > > > Cheers
> > > > David L. Wasler
> > > > [EMAIL PROTECTED]
> > > >
> > > >
> > > > --- Sean Zhang <[EMAIL PROTECTED]>
> > > wrote:
> > > > > Hi,
> > > > >
> > > > > I researching Cactus for testing EJBs
> > > deployed to
> > > > > Weblogic 6.1. Anyone has
> > > > > done that successfully and can you
> > share
> > > some of
> > > > > your experience with me?
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Sean
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > > >
> > > <mailto:[EMAIL PROTECTED]>
> > > > > For additional commands, e-mail:
> > > > >
> > > <mailto:[EMAIL PROTECTED]>
> > > > >
> > > >
> > > >
> > > >
> > > __________________________________________________
> > > > Do You Yahoo!?
> > > > Send FREE video emails in Yahoo! Mail!
> > > > http://promo.yahoo.com/videomail/
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > > <mailto:[EMAIL PROTECTED]>
> > > > For additional commands, e-mail:
> > > > <mailto:[EMAIL PROTECTED]>
> > > >
> > > > --
> > > > To unsubscribe, e-mail: <mailto:cactus-user-
> > > > [EMAIL PROTECTED]>
> > > > For additional commands, e-mail: <mailto:cactus-user-
> > > > [EMAIL PROTECTED]>
> > > >
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > >
> > > --
> > > To unsubscribe, e-mail: <mailto:cactus-user-
> > > [EMAIL PROTECTED]>
> > > For additional commands, e-mail: <mailto:cactus-user-
> > > [EMAIL PROTECTED]>
> > >
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> > --
> > To unsubscribe, e-mail: <mailto:cactus-user-
> > [EMAIL PROTECTED]>
> > For additional commands, e-mail: <mailto:cactus-user-
> > [EMAIL PROTECTED]>
> >
>
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
> --
> To unsubscribe, e-mail: <mailto:cactus-user-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:cactus-user-
> [EMAIL PROTECTED]>
>
<?xml version="1.0"?>
<!DOCTYPE document SYSTEM "./dtd/document-v10.dtd">
<document>
<header>
<title>JBuilder 4 Integration</title>
<authors>
<person name="Cedric Chabanois" email="[EMAIL PROTECTED]"/>
<person name="Kunal Vaishnav" email="[EMAIL PROTECTED]"/>
<person name="Vincent Massol" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<s1 title="Forewords and Requirements">
<p>
First of all, JUnit and Cactus jar files are needed for this tutorial, please
download them :
</p>
<ul>
<li>
<link href="downloads.html">cactus</link>
</li>
<li>
<link href="http://www.junit.org/">junit</link>
</li>
</ul>
</s1>
<s1 title="Step 1 : Create junit and cactus libraries">
<p>
Let's assume the following conventions :
<strong><code>{Cactus dir}</code></strong> is the directory where you
have unzipped the Cactus distribution or sources.
Let's also assume <strong><code>{Tomcat dir}</code></strong> to be the Tomcat directory.
</p>
<figure src="images/jb_libraries.gif" alt="jbuilder libraries" />
<s2 title="Create the junit library">
<p>
Create a new library named <code>junit</code>.
Add the junit.jar file to this library in the class tab.
</p>
</s2>
<s2 title="Create the cactus library">
<p>
Create a library named <code>cactus</code>.
Add <code>cactus.jar</code> and optionnaly
<code>log4j-core.jar</code>. Note that
<code>log4j-core.jar</code> is useful only if you wish to get
some Cactus runtime logs.
</p>
<note>
You can also add the source file directories in the source tab :
<code>{Cactus dir}/src/framework/servlet22</code> and
<code>{Cactus dir}/src/framework/share</code>
This way, you will be able to debug inside cactus sources.
</note>
</s2>
<s2 title="Create the tomcat library">
<p>
Create another library named <code>tomcat</code>
and add all the jar files from <code>{Tomcat dir}/lib</code>.
</p>
<note>
If you use JBuilder 4 Enterprise or JBuilder 4 Professionnal, you don't need to create
this library because Tomcat 3.1 is provided with those versions.
</note>
</s2>
</s1>
<s1 title="Step 2 : Set up the cactus.properties file">
<p>
Edit a new file named <code>cactus.properties</code>
(see the <link href="howto_config.html">Configuration Howto</link>
tutorial for more details on <code>cactus.properties</code>).
</p>
<p>
Sample <code>cactus.properties</code> file :
</p>
<source><![CDATA[
cactus.servletRedirectorURL = http://localhost:8080/cactus/ServletRedirector
]]></source>
<p>
Copy your <code>cactus.properties</code> file to a directory present
in your classpath. You can copy it to a directory and add this
directory in the class tab of the cactus library.
</p>
</s1>
<s1 title="Step 3 : Configure Tomcat Environment">
<s2 title="Create a cactus webapp">
<p>
Create and edit the file <code>{Tomcat dir}/webapps/cactus/WEB-INF/web.xml</code> :
</p>
<source><![CDATA[
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<servlet>
<servlet-name>ServletRedirector</servlet-name>
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ServletRedirector</servlet-name>
<url-pattern>/ServletRedirector</url-pattern>
</servlet-mapping>
</web-app>
]]></source>
</s2>
<note>
You can edit <code>{Tomcat dir}/conf/web.xml</code> instead if you prefer. <br />
You can also edit the web.xml file of the webapp where is located the servlet(s) you want to test. <br />
Don't forget to modify <code>cactus.properties</code> file accordingly.
</note>
</s1>
<s1 title="Step 4 : Configure your project">
<ol>
<li>
Put <code>-classic -Dtomcat.home="{Tomcat dir}"</code> as the VM parameters for your project and
<code>org.apache.tomcat.startup.Tomcat</code> as the main class.
</li>
<li>
Add the following libraries in the <code>Required Libraries</code> tab in the
project properties :
<ul>
<li>tomcat</li>
<li>servlet</li>
<li>junit</li>
<li>cactus</li>
</ul>
<figure src="images/jb_paths.gif" alt="jbuilder libraries" />
</li>
</ol>
</s1>
<s1 title="Step 5 : Test and debug your servlet">
<s2 title="Test your servlet">
<ol>
<li>
Start Tomcat using the <code>Run/Run Project</code> menu.
</li>
<li>
Run your unit tests : right Click on the file containing your test case and click on <code>run</code>
</li>
</ol>
</s2>
<s2 title="Debug your servlet and your tests">
<p>
You can easily print the results of the methods on the server-side itself.
</p>
<p>
You can also start Tomcat in debug mode (<code>Run/debug project</code>).
This way, you can stop at breakpoints on methods that are executed on the
server side (<code>void testXXX()</code> for example)
</p>
<p>
If you right click on the file containing your test case and click on <code>debug</code>,
you can stop at breakpoints on methods that are executed on the client side like
<code>void endXXX(WebResponse)</code> or <code>void beginXXX(WebRequest)</code>
</p>
</s2>
</s1>
</body>
</document>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>