Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

problem while writting Junit for EJB

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?

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
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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

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,

Or we might never have existed at all. Freaky. So we should cherish everything. Even this tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic