Java Mailing List Archive

http://www.gg3721.com/

Home » user.groovy »

[groovy-user] Ant, JUnit 4, Groovy and JPA

samd

2010-03-16

Replies: Find Java Web Hosting

Author LoginPost Reply
Hello,

I'm attempting to execute JUnit 4 tests using the org.junit.runner.JUnitCore.runClasses utility for commandline execution.
This is done from using the groovy ant task e.g.

<groovy classpathref="groovy.test.classpath">
def basedir = project.references.groovytests.getDirectoryScanner().basedir
project.references.groovytests.getDirectoryScanner().getIncludedFiles().each {
    println "Executing: ${it}"
    def testClass = loader.parseClass(new File("${basedir}/${it}"))
     org.junit.runner.JUnitCore.runClasses(testClass)
}
</groovy>

I get the javax.persistence.PersistenceException: No Persistence provider for EntityManager named ... exception when trying to create an EntityManager and I know the classpath, classes and persistence.xml are configured properly.

Has anyone encountered an issue like this before?
©2008 gg3721.com - Jax Systems, LLC, U.S.A.