Search in sources :

Example 1 with PersistenceUnitLinkResolver

use of org.apache.openejb.config.PersistenceUnitLinkResolver in project tomee by apache.

the class PersistenceUnitLinkResolverTest method resolve.

@Test
public void resolve() {
    final AppModule appModule = new AppModule(Thread.currentThread().getContextClassLoader(), "target/classes/foo", new Application(), false);
    Files.mkdir(new File("target/classes/foo/bar"));
    final PersistenceUnitLinkResolver resolver = new PersistenceUnitLinkResolver(appModule);
    resolver.add(URI.create("file:/fake/1"), "foo", new PersistenceUnit());
    resolver.add(URI.create("file:/fake/2"), "foo", new PersistenceUnit());
    // can't resolve but doesn't fail
    assertNull(resolver.resolveLink("foo", URI.create("bar")));
}
Also used : PersistenceUnitLinkResolver(org.apache.openejb.config.PersistenceUnitLinkResolver) AppModule(org.apache.openejb.config.AppModule) PersistenceUnit(org.apache.openejb.jee.jpa.unit.PersistenceUnit) Application(org.apache.openejb.jee.Application) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)1 AppModule (org.apache.openejb.config.AppModule)1 PersistenceUnitLinkResolver (org.apache.openejb.config.PersistenceUnitLinkResolver)1 Application (org.apache.openejb.jee.Application)1 PersistenceUnit (org.apache.openejb.jee.jpa.unit.PersistenceUnit)1 Test (org.junit.Test)1