[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-dev] Dynamic persistence unit
|
I spent some more time on this today and came up with the following. I created a new @Emf annotation that a testcase can use in conjunction with a custom test runner that will dynamically create(and inject) a persistence unit depending on the annotated configuration. The test runner is responsible for translating the Emf annotation into a SEPersistenceUnitInfo. Note that a persistence.xml is required, nor is one used for this testing.
Also as I posted in my previous note, I would still like someone to take a look at the
JPAInitializer change that I'll need to introduce for this to work. Attached is a patch of the new test framework and a small test case. I also fixed some of the build problems I had in my previous patch. If I get a thumbs up on the runtime changes required for this, I'll go ahead and get something delivered so others can start to kick the tires.
Example :
@RunWith(EmfRunner.class)
public class TestBasicPersistence {
@Emf(classes = { Dog.class, XmlFish.class },
properties = { @Property(name = "name", value = "value")},
mappingFiles= {"META-INF/fish-orm.xml"})
private EntityManagerFactory emf;
Attachment:
jse.test.patch
Description: Binary data