use of org.jboss.arquillian.junit.InSequence in project deltaspike by apache.
the class TransactionalQueryRunnerTest method should_find_with_lockmode_in_transaction.
@Test
@InSequence(3)
public void should_find_with_lockmode_in_transaction() throws Exception {
// when
Simple simple = repository.findByName(NAME);
// then
assertNotNull(simple);
assertTrue(wrapper.isRunInTx());
}
use of org.jboss.arquillian.junit.InSequence in project deltaspike by apache.
the class TransactionalQueryRunnerTest method should_save_in_transaction.
@Test
@InSequence(2)
public void should_save_in_transaction() throws Exception {
// given
Simple simple = new Simple(NAME);
// when
simple = repository.save(simple);
// then
assertNotNull(simple.getId());
assertTrue(wrapper.isRunInTx());
}
use of org.jboss.arquillian.junit.InSequence in project deltaspike by apache.
the class HouseRepositoryTest method should_run_modifying_in_transaction.
@Test
@InSequence(1)
public void should_run_modifying_in_transaction() throws Exception {
House house = repository.findByName("Bellevue");
assertNotNull(house);
assertNotNull(house.getId());
assertEquals("Bellevue", house.getName());
assertTrue(puu.isLoaded(house, "flats"));
assertFalse(puu.isLoaded(house, "garages"));
}
use of org.jboss.arquillian.junit.InSequence in project deltaspike by apache.
the class HouseRepositoryTest method shouldNotLoadLazyAssociationsWithoutGraph.
@Test
@InSequence(2)
public void shouldNotLoadLazyAssociationsWithoutGraph() throws Exception {
House house = repository.findOptionalByName("Bellevue");
assertNotNull(house);
PersistenceUnitUtil puu = entityManager.getEntityManagerFactory().getPersistenceUnitUtil();
assertFalse(puu.isLoaded(house, "flats"));
assertFalse(puu.isLoaded(house, "garages"));
}
use of org.jboss.arquillian.junit.InSequence in project deltaspike by apache.
the class HouseRepositoryTest method should_build_dynamic_graph_from_paths.
@Test
@InSequence(5)
public void should_build_dynamic_graph_from_paths() throws Exception {
House house = repository.fetchByNameWithDynamicGraph("Bellevue");
assertNotNull(house);
assertTrue(puu.isLoaded(house, "flats"));
assertTrue(puu.isLoaded(house, "garages"));
assertEquals(2, house.getFlats().size());
assertEquals(2, house.getGarages().size());
Flat flat = house.getFlats().get(0);
assertFalse(puu.isLoaded(flat, "tenants"));
}
Aggregations