blob: 96261bafeb3f32f1d120d6d34ea793eb19f52a2e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
package org.fedoraproject.candlepin.model.test;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import org.fedoraproject.candlepin.model.ConsumerType;
import org.fedoraproject.candlepin.util.EntityManagerUtil;
import org.junit.Test;
import static org.junit.Assert.*;
public class ConsumerTypeTest {
@Test
public void testSomething() {
EntityManager em = EntityManagerUtil.createEntityManager();
EntityTransaction tx = null;
tx = em.getTransaction();
tx.begin();
ConsumerType ct = new ConsumerType("standard-system");
em.persist(ct);
tx.commit();
List<EntityManager> results = em.createQuery("select ct from ConsumerType as ct")
.getResultList();
assertEquals(1, results.size());
}
}
|