users@glassfish.java.net

Re: Junit testing using glassfish embedded EJBContainer

From: Bhavanishankar <bhavanishankara.sapaliga_at_oracle.com>
Date: Wed, 06 Apr 2011 21:19:07 +0530

With org.glassfish.embeddable
<http://embedded-glassfish.java.net/nonav/apidocs/> APIs or with
embedded maven plugin
<http://embedded-glassfish.java.net/nonav/plugindocs/3.1/plugin-info.html>,
messaging is testable.

MDB test with embedded GlassFish is available here
<http://java.net/projects/glassfish/sources/svn/show/trunk/v3/tests/embedded/maven-plugin/mdb>.

HTH,
_Bhavani.

On 04/06/2011 02:53 PM, forums_at_java.net wrote:
> Has anyone successfully tested messaging using glassfish's embedded
> container on version 3.1 or 3.01?
>
> As I was building my project, I could test [1] my session beans and
> persistence but my tests stopped working the moment I introduced
> queues. on
> creating the EJB [2] container (EJBContainer.createEJBContainer()) I
> get the
> following error:
> *No EJBContainer provider available, Returned null from
> createEJBContainer
> call*
> To test my theory I deleted the Producer and Consumer and removed the xml
> references on the project and the tests work. Is there an issue with
> queues/topics when testing [3] with the embedded container OR has anyone
> successfully tested this.
> Maybe there are additional properties to be passed to
> EJBContainer.createEJBContainer() when dealing with queues???
>
>
>
>
> [1] http://www.javaranch.com/unit-testing.jsp
> [2] http://www.coderanch.com/forums/f-11/EJB-JEE
> [3] http://www.javaranch.com/unit-testing.jsp
>
> --
>
> [Message sent by forum member 'patmuga']
>
> View Post: http://forums.java.net/node/789033
>
>

-- 
Sun, an Oracle Company