Currently we are writing JUnits for the already existing project. Java1.6, EJB3.0, Oracle10g, Toplink are the technologies being used.
Before building and deploying the project, we are creating two local database schemas in Oracle10g.Schema1 is to be used for the code and Schema2 for the JUnits.
During build and deploy, data is being populated to Schema1.
(We are assuming that data is being populated into Schema1, as Schema1 is given as the unitName in the @PersistenceContext annotation of the stateless EJB - @PersistenceContext(unitName="employer"))
Is there a possibility to populate both the schemas simultaneously during build and deploy?
At the start of the JUnit test, we are creating EntityMangerFactory for Schema1. (Ideally, we need to create the EntityMangerFactory for Schema2 but as there is no data in Schema2, we are using Schema1)
Data that was populated during build is being overwritten. There is a database check at this step, and as there is no data in the database, the test would not proceed further and hence fail.
We want to retain the data that was populated during build. Please suggest a solution for achieving these.