use of eu.ggnet.dwoss.customer.ee.eao.CustomerEao in project dwoss by gg-net.
the class CustomerEoaIT method testPersistence.
@Test
public void testPersistence() throws Exception {
CustomerEao eao = new CustomerEao(em);
utx.begin();
em.joinTransaction();
Customer c = GEN.makeCustomer();
// Make sure no systemcustomer.
c.getFlags().remove(CustomerFlag.SYSTEM_CUSTOMER);
em.persist(c);
utx.commit();
utx.begin();
em.joinTransaction();
assertTrue(eao.findAllSystemCustomerIds().isEmpty());
c = GEN.makeCustomer();
// Make sure it is a systemcustomer.
c.getFlags().add(CustomerFlag.SYSTEM_CUSTOMER);
em.persist(c);
utx.commit();
utx.begin();
em.joinTransaction();
assertEquals(1, eao.findAllSystemCustomerIds().size());
utx.commit();
}
Aggregations