Entries tagged [embedded]

Wednesday August 05, 2009

Screencast: EJB Unit Testing with Eclipse and OpenEJB (repost)

We've had some download issues with the original screencast, so we have uploaded it to a video sight and are reposting it to the blog.

This screencast shows how you can turn the plain, non-javaee version of Eclipse into an EJB testing machine. The tutorial walks you through installing Eclipse, adding OpenEJB to your project's classpath, and creating a simple EJB with a JUnit unit test.

EJB Unit Testing with Eclipse and OpenEJB from OpenEJB on Vimeo.

(video made with ScreenFlow)

Thursday June 18, 2009

Screencast: EJB Unit Testing with Eclipse and OpenEJB

We've put together the first of hopefully many screencasts to walk you through various aspects of using OpenEJB. This screencast shows how you can turn the plain, non-javaee version of Eclipse into an EJB testing machine. The tutorial walks you through installing Eclipse, adding OpenEJB to your project's classpath, and creating a simple EJB with a JUnit unit test.

EJB Unit Testing with Eclipse and OpenEJB

Enjoy!

Friday June 05, 2009

Apache OpenEJB 3.1.1 Released

The Apache OpenEJB team is excited to announce the release of OpenEJB 3.1.1.

This release includes some great enhancements for the embedded testing scenarios and general EJB programming. Notable improvements include:

- Dependency injection for test cases and clients of the embedded ejb container via new @LocalClient annotation.
- Support for annotating the same interface as @Local, @Remote and @WebService making it possible to exposing all possible EJB views with a single interface.
- Web Service views securable with @RolesAllowed, @PermitAll and @DenyAll annotations.
- Ability to easily use alternate sets of deployment descriptors for some or all tests via new 'openejb.altdd.prefix' property.
- Global lookups from any context simplified via new "openejb:" jndi namespace.

The release also contains several new examples including Applets invoking EJBs in webapps, Struts with JPA and EJB, secured web services and web services with Perl SOAP::Lite clients and more.

Tuesday April 28, 2009

Alternate descriptors for testing

Inspired by some user blog posts, we've added a new feature so support for altDD (alternative deployment descriptors) can be done in a test or other environment without much work.

Basically, just set the new "openejb.altdd.prefix" system property or initialcontext property to something like "test", then any descriptors in your META-INF/ directory that start with "test." will override the regular descriptor. So for example with an app like this:

  • META-INF/ejb-jar.xml
  • META-INF/test.ejb-jar.xml
  • META-INF/persistence.xml
  • META-INF/test.env-entry.properties

    Just initialize your test case like so:

     Properties properties = new Properties();
     properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
          "org.apache.openejb.client.LocalInitialContextFactory");
     properties.setProperty("openejb.altdd.prefix", "test");
    
     InitialContext initialContext = new InitialContext(properties);
    
    The logical result will be:

  • META-INF/ejb-jar.xml (via test.ejb-jar.xml)
  • META-INF/persistence.xml
  • META-INF/env-entry.properties (via test.env-entry.properties)

    This will work in any environment in which OpenEJB works (embedded, standalone, tomcat, geronimo, etc.).

  • Calendar

    Search

    Hot Blogs (today's hits)

    Tag Cloud

    Categories

    Feeds

    Links

    Navigation