57 lines
1.1 KiB
Java
57 lines
1.1 KiB
Java
package de.wazong.ironblogger;
|
|
|
|
import javax.persistence.EntityManager;
|
|
import javax.persistence.EntityManagerFactory;
|
|
import javax.persistence.Persistence;
|
|
|
|
import org.apache.log4j.Logger;
|
|
import org.junit.AfterClass;
|
|
import org.junit.BeforeClass;
|
|
import org.junit.Test;
|
|
|
|
public class TestTest {
|
|
|
|
private static EntityManager em;
|
|
private static final Logger log = Logger.getLogger(TestTest.class);
|
|
|
|
@Test
|
|
public void testNothing() throws Exception {
|
|
|
|
if (em == null)setUp();
|
|
|
|
|
|
|
|
}
|
|
|
|
/**
|
|
* Creates an {@link EntityManager} for this test.
|
|
*
|
|
* @throws Exception
|
|
*/
|
|
@BeforeClass
|
|
public static void setUp() throws Exception {
|
|
if (em == null) {
|
|
final EntityManagerFactory emf = Persistence
|
|
.createEntityManagerFactory("ibTest");
|
|
em = emf.createEntityManager();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Cleans up after this test has run.
|
|
*/
|
|
@AfterClass
|
|
public static void cleanUp() {
|
|
em.clear();
|
|
em.getTransaction().begin();
|
|
// for (Record r : ids) {
|
|
// Object o = em.find(r.getClazz(), r.getId());
|
|
// if (o != null)
|
|
// em.remove(o);
|
|
// }
|
|
em.getTransaction().commit();
|
|
em.close();
|
|
}
|
|
|
|
|
|
} |