+ private static EntityManagerFactory emf;
+
+ /**
+ * Creates the test DB and keeps it open until all tests complete.
+ *
+ * @throws Exception if an error occurs
+ */
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ Properties props = new Properties();
+ try (FileInputStream inp = new FileInputStream(VALID_FILE)) {
+ props.load(inp);
+ }
+ props.setProperty(PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML,
+ props.getProperty(BrmsPush.BRMSPERSISTENCE));
+
+ emf = Persistence.createEntityManagerFactory("BRMSGW", props);
+ }
+
+ /**
+ * Closes the test DB.
+ */
+ @AfterClass
+ public static void tearDownAfterClass() {
+ emf.close();
+ }
+