1 Reply Latest reply on Aug 4, 2009 12:51 PM by alrubinger

    Testing MDBs

    jharting

      Hello,

      I am writting a test that verifies that my MDB is instantiated properly. I need the container to create a new instance in a normal way (including execution of @PostConstruct callback) The most intuitive way of testing this is to set up a queue, subscribe the MDB to it and send a message to the queue - letting the container to do the instantation, however:

      1) I need the test to be able to run on various containers. Therefore, I cannot depend on vendor specific ways of JMS configuration etc.
      2) The test should be as little complex as possible.

      So to summarize, I need to make the container instantiate my MDB in a fully EE5 compatible way.

      Any ideas will be appreciated.

        • 1. Re: Testing MDBs
          alrubinger

          While MDBs themselves are agnostic to the vendor container, the activation config properties and their values are not.

          Recommend extracting this metadata into a partial XML descriptor, and making one descriptor per target container. The build may then leave you with separate artifacts specific to each vendor, while the underlying class is the same.

          S,
          ALR