Search in sources :

Example 1 with CustomerEao

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();
}
Also used : Customer(eu.ggnet.dwoss.customer.ee.entity.Customer) CustomerEao(eu.ggnet.dwoss.customer.ee.eao.CustomerEao) Test(org.junit.Test)

Aggregations

CustomerEao (eu.ggnet.dwoss.customer.ee.eao.CustomerEao)1 Customer (eu.ggnet.dwoss.customer.ee.entity.Customer)1 Test (org.junit.Test)1