tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aleksandr Ivanov <>
Subject OpenEjb + PowerMock
Date Tue, 06 Apr 2010 20:58:30 GMT
Hello list,

I'm using OpenEjb to unit test my ejb3 code. My application has a
third party dependency, which I'm mocking with PowerMock +EasyMock.
Without mocking OpenEjb works perfectly fine - fetches all
configuration and binds all beans to proper JNDI. I have to use
PowerMock to mock one static service (which is called from EJB)
When PowerMock is used  I'm having trouble in initializing
persistence.xml. XML unmarshaller complains (throws xml parsing
exception) about persistence.xml default namespace.
When I delete the namespace - the code is deployed perfectly and
container is initialized with PowerMock configured. After that I'm
able to run any unit test.
The downside of removing the namespace is that when I try to deploy
the .ear on the real container (JBoss 6.0 M2) it fails with the
complaint about missing namespace (according to J2EE spec the
namespace should be present).

So I my question is - can I programmatically disable persistence.xml
validation when deploying to openEjb?

Thanks in advance,

Aleksandr Ivanov

View raw message