You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Rick <ri...@gmail.com> on 2008/11/09 22:12:16 UTC

[OT-ish] testing EJB3 components? ( embedded jboss? )

I'm really having a heck of time figuring out how to EASILY test my
EJB3 components with Maven2/TestNG. I'm using the @EJB annotations to
inject EJBs into my Stateless session beans and it works fine in my
deployed ear to JBoss5.  What I want to do is to test some of these
EJB3s. Some of them call other stateless session beans so it's a bit
difficult from a pure pojo approach since the whole context needs to
be set up so the EJB3 injection can take place.

I briefly looked at EJB3Unit and I thought it look overly complicated
(but maybe I should continue to pursue that?). Using an embedded jboss
instance looked pretty easy, but the problem is this... what I'll need
to do is have my ejb jars deployed to my embedded jboss deploy
directory as part of my project. How do I tell testing in maven2 to
build jars to a deploy directory and not just target?

Thanks for any help.

-- 
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [OT-ish] testing EJB3 components? ( embedded jboss? )

Posted by Stephen Connolly <st...@gmail.com>.
depending on what you want to test, you might get part of the way (for
unit testing anyway) with easygloss.dev.java.net

it only covers injecting the resources, but with a good mocking
framework you can get the important stuff tested

(I wrote it, so I should know ;-) )

-Stephen

On 09/11/2008, Rick <ri...@gmail.com> wrote:
> I'm really having a heck of time figuring out how to EASILY test my
> EJB3 components with Maven2/TestNG. I'm using the @EJB annotations to
> inject EJBs into my Stateless session beans and it works fine in my
> deployed ear to JBoss5.  What I want to do is to test some of these
> EJB3s. Some of them call other stateless session beans so it's a bit
> difficult from a pure pojo approach since the whole context needs to
> be set up so the EJB3 injection can take place.
>
> I briefly looked at EJB3Unit and I thought it look overly complicated
> (but maybe I should continue to pursue that?). Using an embedded jboss
> instance looked pretty easy, but the problem is this... what I'll need
> to do is have my ejb jars deployed to my embedded jboss deploy
> directory as part of my project. How do I tell testing in maven2 to
> build jars to a deploy directory and not just target?
>
> Thanks for any help.
>
> --
> Rick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [OT-ish] testing EJB3 components? ( embedded jboss? )

Posted by Karsten Ohme <wi...@t-online.de>.
Rick schrieb:
> I'm really having a heck of time figuring out how to EASILY test my
> EJB3 components with Maven2/TestNG. I'm using the @EJB annotations to
> inject EJBs into my Stateless session beans and it works fine in my
> deployed ear to JBoss5.  What I want to do is to test some of these
> EJB3s. Some of them call other stateless session beans so it's a bit
> difficult from a pure pojo approach since the whole context needs to
> be set up so the EJB3 injection can take place.
> 
> I briefly looked at EJB3Unit and I thought it look overly complicated
> (but maybe I should continue to pursue that?). Using an embedded jboss
> instance looked pretty easy, but the problem is this... what I'll need
> to do is have my ejb jars deployed to my embedded jboss deploy
> directory as part of my project. How do I tell testing in maven2 to
> build jars to a deploy directory and not just target?
> 
> Thanks for any help.
> 

You can take a look at OpenEJB. This is simple and works.

General: The test setup must be done in a setUp method. Usually you
looking up a context and the embedded container starts and you run the
test.

Regards,
Karsten



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [OT-ish] testing EJB3 components? ( embedded jboss? )

Posted by Mick Knutson <mk...@baselogic.com>.
Look at the cargo plugin to start and deploy to jboss.

On Sun, Nov 9, 2008 at 1:12 PM, Rick <ri...@gmail.com> wrote:

> I'm really having a heck of time figuring out how to EASILY test my
> EJB3 components with Maven2/TestNG. I'm using the @EJB annotations to
> inject EJBs into my Stateless session beans and it works fine in my
> deployed ear to JBoss5.  What I want to do is to test some of these
> EJB3s. Some of them call other stateless session beans so it's a bit
> difficult from a pure pojo approach since the whole context needs to
> be set up so the EJB3 injection can take place.
>
> I briefly looked at EJB3Unit and I thought it look overly complicated
> (but maybe I should continue to pursue that?). Using an embedded jboss
> instance looked pretty easy, but the problem is this... what I'll need
> to do is have my ejb jars deployed to my embedded jboss deploy
> directory as part of my project. How do I tell testing in maven2 to
> build jars to a deploy directory and not just target?
>
> Thanks for any help.
>
> --
> Rick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Thank You…

Mick Knutson
BASE Logic, inc.
(415) 685-4233

Website: http://baselogic.com
Blog: http://baselogic.com/blog
BLiNC Magazine: http://blincmagazine.com
Linked IN: http://linkedin.com/in/mickknutson
DJ Mick: http://djmick.com
MySpace: http://myspace.com/mickknutson
Vacation Rental: http://tahoe.baselogic.com

coming soon: (866-BLiNC-411: (254-6241-1)
---