KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > ejb > test > connection > DataSourceInjectionTest


1 //$Id: DataSourceInjectionTest.java,v 1.1 2005/07/15 00:07:03 epbernard Exp $
2
package org.hibernate.ejb.test.connection;
3
4 import javax.persistence.EntityManagerFactory;
5
6 import junit.framework.TestCase;
7 import org.hibernate.ejb.HibernatePersistence;
8
9 /**
10  * @author Emmanuel Bernard
11  */

12 public class DataSourceInjectionTest extends TestCase {
13     public void testDatasourceInjection() {
14         PersistenceInfoImpl info = new PersistenceInfoImpl();
15         try {
16             EntityManagerFactory emf = ( new HibernatePersistence() ).createContainerEntityManagerFactory( info );
17             fail("FakeDatasource should have been used");
18         } catch (FakeDataSourceException fde) {
19             //success
20
}
21     }
22 }
23
Popular Tags