• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem while writting Junit for EJB

 
vaidehi Agate-keskar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

1) I have a code in which interaction between two ejb's are there.e.g Bean A and Bean B.A is calling B and from one method of B we are looking up into JNDI.

While writting Junit for this scenario i am getting problem . I need to write standalone java class as a clinet to bean A but i am not getting when my call reach into the method which

lookups into JBDI.Can anybody help me on this?

2) Are there any guidelines for how to write junit of MDB?

Thanks.
 
devendra bargujar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Vaidehi -

[1]For JNDI we need proper Context to lookup the object. Most probably your stand alone client is not getting proper Initial Context. For detail provide more detailed exception...

Regards... Devendra
 
Manuel Alberto Quero
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

For EJB testing you may find interesting this framework (it is based on junit, and uses cargo to deal with application servers management):

http://jakarta.apache.org/cactus/writing/howto_ejb.html

The tests are executed "inside the application server" so you do not have problems related to application servers resources since you can use them while testing.

Hope this helps,

Manuel
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!