The Source for Java Technology Collaboration
User: Password:



Richard Monson-Haefel

Richard Monson-Haefel's Blog

OpenEJB: The BEST way to test EJBs

Posted by monsonhaefel on June 11, 2004 at 09:10 AM | Comments (3)

The server side has published an article by N. Alex Rupp on how to use OpenEJB for testing your EJB applications.

Advanced EJB Testing with OpenEJB

David Blevin's and I founded OpenEJB some five years ago to create a fast and lightweight EJB container system that could be easily embedded in any application (its even been used in handheld devices). I stayed with the project for the first couple of years, but haven't been very involved in it since. David Blevins, on the other hand, has kept the project going and has continuously improved it (along with a small army of volunteers). Today OpenEJB the EJB container system used with Apache Geronimo - its very powerful, fast, and best of all lightweight.

The fact that OpenEJB is so lightweight and embeddable is why it actually serves as an excellent EJB testing tool. It starts up and deploys EJBs is seconds (that right I said seconds, not minutes). In addition, it provides a robust and fully compliant EJB container system - one that is used by Apache Geronimo for production enviorments.

Rather than create some type of home spun "moch" container system use OpenEJB. All the hard stuff is done - you don't have to re-invent the wheel. As you'll see in Rupp's article, OpenEJB is ridiculously easy to work with and provides you with the best EJB testing framework available today.

I would go a bit further and encourage people who are using commercial products like WebLogic and WebSphere to use OpenEJB in development. A developer can deploy and redeploy his EJBs over and over again quickly, giving him time to focus on developing his EJBs rather than waiting for a server to start-up and deploy an J2EE application - a process that I believe saps as much as 80% of development time.


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • Not that easy
    At present I have an existing EJB project which I would like to test using N.Rupp's method. I have to admit when I read that article it looked pretty easy. However, trying to do it with my app was not that easy.

    Just a note though, I am using the latest snapshot of OpenEJB 2.0 not the one that N.Rupp was using (I think), because I am using the EJB 2.0 stuff.

    Basically what I am looking for is without any XML configuration files, I could just do something like...


    protected void setUp() throws Exception {
    Container c = OpenEJB.getContainer();
    c.deploy(new EjbDeploymentInfo(ExampleHome.class, Example.class, ExampleBean.class);
    // Automatic determination by the container whether its session, MDB or entitybean by introspection.
    c.deploy(new EjbDeploymentInfo(ExampleFacadeHome.class, ExampleFacade.class, ExampleFacadeBean.class);

    // Override the security manager to pass in the user "admin" with the "adminrole" priviledges.
    SecurityManager dummySecurityManager = new DummySecurityManager("admin", "adminrole");
    OpenEJB.setSecurityManager(dummySecurityManager);

    Properties props = new Props();
    props.put("...initcontext...", "...Local...Context");
    context = new InitialContext(props);
    }


    However, its not as easy as I thought it would be. I guess EJB testing won't be as straight forward as testing on other contexts (with the exception of GUI or HTTP testing which are also hard to do) for a while.

    Posted by: atrajano on July 11, 2004 at 07:39 PM

  • OpenEJB 3 is what you want if you have an EJB 1.1, 2.x or EJB 3.0 application that needs embedded testing. OpenEJB 3.0 pics up where OpenEJB 1.0 left off.


    No releases of OpenEJB 2.0 were ever made from the OpenEJB website as it was only useable to Geronimo and no one else in any other setting. It is also officially deprecated. Geronimo now uses OpenEJB 3.0 as well.


    Posted by: dblevins on August 13, 2007 at 11:38 AM

  • The Most Energy Efficient Washers And All homes use washers and dryers. Since the invention of these nifty little machines, life .washers dryers washers dryers: Golf was forever changed in 1934 by brilliant man named Brandon Conley. Noticing the .Commercial Pressure Washers Pressure washers, also called power washers, are heavy-duty cleaners. These use heavy water pressure and ..zoom teeth whitening zoom teeth whitening: Tooth whitening, also called bleaching, is process of lightening and removing stains from .Teeth Whitening Products Teeth Whitening Products

    A "brite smile" is considered to be person's greatest asset. Yellow or .White Light Teeth Whitening System Do you have time to go to dentist? What about patience? Are you patient ..Laser Eye Surgery Taking The Laser Eye Surgery Taking The Confusion Out Of Laser Eye Surgery
    Laser eye surgery has .Eye Surgery Providers TLC Laser TLC Laser Eye Centers is premier provider of LASIK and other refractive surgery procedures. .Your Eye Surgery Report Is LASIK stands for Laser in-Situ Keratomileusis

    The Ideal Candidate

    In general, the ideal candidate for LASIK ..washing machines washing machines: How To Identify Faults For Washing Machines

    When you enter her house, the facial expression is .kenmore washing machines kenmore washing machines: Cleaning Your Washing Machine

    Is cleaning your washing machine important? It certainly is! The inside of .washing machines washing machines: Washing Machines, How Do Choose The One For Me?

    When choosing washing machine many ..Dry Chemical Carpet Cleaning for Your Dry Chemical Carpet Cleaning for Your Carpet

    Chemical Carpet Cleaning: Keep Your Carpet Dry

    Cleaning your carpet .Carpet Cleaning Tips to Try Before Carpet Cleaning Tips to Try Before Calling the Professional Carpet Cleaner

    Most of us can’t afford .cancer cancer: Professional Carpet Cleaning: How Often Should Carpet Be Cleaned

    When was the last time you had ..coach wallets coach wallets: Women take great deal of time to choose their handbags and wallets recognizing them .Mens Leather Wallets: Wallet For There are many popular designers of mens leather wallets located on every corner of the .wallets wallets: It seems the days of carrying cash are almost thing of the past. Now ..tempurpedic reviews tempurpedic reviews: When you are searching for new mattress for your bed the first thing you .Tempurpedic Mattress Pad Is tempurpedic mattress pad any good? Does buying tempurpedic mattress pad help me .Great Information on Tempurpedic and Tempurpedic Are you waking up stiff and sore every morning? Well there may be an easy ..myrtle beach online myrtle beach online: Popular for fun-filled family vacation, Myrtle Beach attracts lot of tourists around the .myrtle beach south carolina hotels myrtle beach south carolina hotels: There is reason Myrtle Beach ranks consistently among the top vacation destinations for American .North Myrtle Beach North Myrtle Beach is home to Vanna White, and the birth place of South Carolina’s ..fine jewelry fine jewelry: David Yurman (born October 12, 1942) is the founder of the David Yurman jewelry company. .david yurman david yurman: When David Yurman began designing and creating jewelry over twenty-five years ago, he probably didn’t .david yurman david yurman: David Yurman Opens First Chicago Jewelry Store

    Jewelry designer, David Yurman, has opened his first jewelry ..Pros And Cons Of LCD Televisions Televisions have become primary product in almost every home of United Kingdom. As technology .LCD HDTV Televisions and Displays Explained LCD HDTV Televisions and Displays Explained

    LCD displays have been around for years in everything from .Installation Techniques of LCD Televisions Installation Techniques of LCD Televisions

    Most people think that installing LCD TV is very tough. ..

    Posted by: ruthrobeson on October 25, 2007 at 04:41 AM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds