Win a copy of Rust Web Development this week in the Other Languages 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

EJB3Unit: Mocked Session Bean

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have implemented a Session Bean (e.g. EmployeeServiceBean).
This Session Bean uses another Session Bean (e.g. ServiceBean).
EmployeeServiceBean references ServiceBean using the JEE Annotation @EJB (e.g. in EmployeeServiceBean: @EJB private Service service;)

I test the beans with EJB3Unit using Mock Objecst (EmployeeServiceBeanTest extends MockedSessionBeanJUnit4Fixture<EmployeeServiceBean>).
My ServiceBean is mocked.

When the Bean implementations and the interfaces (Remote/Local) are in the same package, all works fine with EJB3Unit.
Whe the interfaces and the implementations are not in the same package my mockService complains that some expectations are not satisfied.

How do I set up EJB3Unit to make it find all interfaces and implementations when they are not in the same package?
Do I have to use a property file ejb3unit.properties? I didn't find any very useful documentation about it.

Thank you for your help.
Jean-Claude
 
Jean-Claude Rouvinez
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jean-Claude Rouvinez wrote:Hi,

I have implemented a Session Bean (e.g. EmployeeServiceBean).
This Session Bean uses another Session Bean (e.g. ServiceBean).
EmployeeServiceBean references ServiceBean using the JEE Annotation @EJB (e.g. in EmployeeServiceBean: @EJB private Service service;)

...

Thank you for your help.
Jean-Claude



This sounds very interesting: Sourceforge / EJB3Unit Forum
 
Jean-Claude Rouvinez
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

ejb3unit doesn't work when the Interfaces (Remote or Local) and the implementation (Bean) are not in the same JAR.
More about it: ejb3unit at sourceforge
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for posting this kind of information... i don't use the mock feature yet, but maybe I will use it in the future...
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic