Search in sources :

Example 6 with Simple

use of org.apache.deltaspike.data.test.ee7.domain.Simple in project deltaspike by apache.

the class DeltaSpikeTransactionalRepositoryAbstractTest 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());
}
Also used : Simple(org.apache.deltaspike.data.test.ee7.domain.Simple) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Example 7 with Simple

use of org.apache.deltaspike.data.test.ee7.domain.Simple in project deltaspike by apache.

the class JtaTransactionalRepositoryAbstractTest method should_save_when_app_scoped_bean_is_found.

@Test
@InSequence(21)
public void should_save_when_app_scoped_bean_is_found() throws Exception {
    // when
    Simple simple = simpleClientApp.createSimple("application scoped");
    Simple found = repository.findOptionalByName("application scoped");
    // then
    assertNotNull(simple);
    assertNotNull(found);
    assertEquals("application scoped", found.getName());
}
Also used : Simple(org.apache.deltaspike.data.test.ee7.domain.Simple) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Example 8 with Simple

use of org.apache.deltaspike.data.test.ee7.domain.Simple in project deltaspike by apache.

the class JtaTransactionalRepositoryAbstractTest 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());
}
Also used : Simple(org.apache.deltaspike.data.test.ee7.domain.Simple) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Example 9 with Simple

use of org.apache.deltaspike.data.test.ee7.domain.Simple in project deltaspike by apache.

the class JtaTransactionalRepositoryAbstractTest method should_find_with_lockmode_in_transaction.

@Test
@InSequence(3)
public void should_find_with_lockmode_in_transaction() throws Exception {
    // when
    Simple simple = repository.findOptionalByName(NAME);
    // then
    assertNotNull(simple);
    assertTrue(wrapper.isRunInTx());
}
Also used : Simple(org.apache.deltaspike.data.test.ee7.domain.Simple) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Example 10 with Simple

use of org.apache.deltaspike.data.test.ee7.domain.Simple in project deltaspike by apache.

the class SimpleClientApp method createSimple.

public Simple createSimple(String name) {
    Simple simple = new Simple(name);
    simpleHolder.setSimple(simple);
    return repo.saveOnMatchApp(simple);
}
Also used : Simple(org.apache.deltaspike.data.test.ee7.domain.Simple)

Aggregations

Simple (org.apache.deltaspike.data.test.ee7.domain.Simple)21 InSequence (org.jboss.arquillian.junit.InSequence)18 Test (org.junit.Test)18