tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: Using custom data source connection factory in JUnit
Date Wed, 04 Jun 2014 16:04:59 GMT
myDs = new://Resource?type=DataSource&class-name=....&factory-name=...
myDs.auth=Application
....


as properties should work


Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-06-04 17:46 GMT+02:00 Vamsee Lakamsani <vamsee@yahoo.com.invalid>:
>
>
> I have a resource defined like this in tomee.xml and it works fine from TomEE
> <Resource id=“myDS" type="javax.sql.DataSource"
>        factory-name="createJDBCDataSource" class-name=“my.CustomDataSourceFactory"
>
>         auth=Application
>         singleton = true
> </Resource>
>
> Now, I want to test this in JUnit using javax.ejb.embeddable.EJBContainer
>
>
> This example shows how to use Properties to initialize the data source.  But is there
any way I can just pass a javax.sql.DataSource object (created by calling createJDBCDataSource
on my factory above directly) to the embeddable EJB container?
> http://tomee.apache.org/examples-trunk/injection-of-datasource/README.html

Mime
View raw message