[jboss-user] [JBoss Seam] - running testNG test suite in J2SE envmt (w/o JNDI)

asookazian do-not-reply at jboss.com
Thu Jan 25 14:06:23 EST 2007


I am getting following exception when exec'ing following code in testNG test case:

@Configuration(beforeTestClass=true)
    public void init() 
    {
        emf = Persistence.createEntityManagerFactory("RSDB");
    }

javax.persistence.PersistenceException: org.hibernate.HibernateException: Could not find datasource

I realized that b/c I am not running inside a JavaEE app server (just in Eclipse with J2SE), the JNDI lookup is not available or won't work.

I was advise to create a new persistence.xml specifically for testing purposes.  This persistence.xml example (not using datasource) is not available in Gavy's example at following link:

http://docs.jboss.com/seam/1.1GA/reference/en/html/testing.html

Anybody know how to do this?  thx.
	

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006497#4006497

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006497



More information about the jboss-user mailing list