I am testing an app with EmbeddedTomEEContainer, but it's unable to inject a
DataSource as a @Resource. This works fine with standard EJBContainer. Is
this because injection is done on web app (deployment) vs. unit test?

Works:
https://github.com/sgjava/datasource-tomee/blob/master/src/test/java/com/codeferm/datasource/DataSourceTest.java

Fails:
https://github.com/sgjava/datasource-tomee/blob/master/src/test/java/com/codeferm/datasource/DataSourceWebTest.java

Considering that is there a way to inject a DataSource resource in a web
base unit test? The app doesn't use any database access, but I need it for
the unit tests. I can always just use DbUtils/Commons Pool, but I like to
get resources from the container for tests.



--
View this message in context: 
http://tomee-openejb.979440.n4.nabble.com/Test-DataSource-injection-with-EmbeddedTomEEContainer-tp4677167.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Reply via email to