• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem while writting Junit for EJB

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic