Search in sources :

Example 21 with Car

use of io.vertigo.dynamo.store.data.domain.car.Car in project vertigo by KleeGroup.

the class AbstractStoreManagerTest method testTxCrudInsertRollbackNativeSelectRollback.

@Test
public void testTxCrudInsertRollbackNativeSelectRollback() {
    try (VTransactionWritable transaction = transactionManager.createCurrentTransaction()) {
        final Car car = createNewCar();
        storeManager.getDataStore().create(car);
    }
    try (VTransactionWritable transaction = transactionManager.createCurrentTransaction()) {
        checkNativeCarsCount(0);
    }
}
Also used : Car(io.vertigo.dynamo.store.data.domain.car.Car) VTransactionWritable(io.vertigo.commons.transaction.VTransactionWritable) Test(org.junit.Test)

Example 22 with Car

use of io.vertigo.dynamo.store.data.domain.car.Car in project vertigo by KleeGroup.

the class AbstractStoreManagerTest method testTxCrudInsertTwoCommit.

@Test(expected = IllegalStateException.class)
public void testTxCrudInsertTwoCommit() {
    try (VTransactionWritable transaction = transactionManager.createCurrentTransaction()) {
        final Car car = createNewCar();
        storeManager.getDataStore().create(car);
        transaction.commit();
        transaction.commit();
    }
}
Also used : Car(io.vertigo.dynamo.store.data.domain.car.Car) VTransactionWritable(io.vertigo.commons.transaction.VTransactionWritable) Test(org.junit.Test)

Example 23 with Car

use of io.vertigo.dynamo.store.data.domain.car.Car in project vertigo by KleeGroup.

the class AbstractStoreManagerTest method testTxNativeInsertCrudInsertCommit.

@Test
public void testTxNativeInsertCrudInsertCommit() {
    try (VTransactionWritable transaction = transactionManager.createCurrentTransaction()) {
        final Car car = createNewCar();
        final Car car2 = createNewCar();
        nativeInsertCar(car2);
        storeManager.getDataStore().create(car);
        transaction.commit();
    }
}
Also used : Car(io.vertigo.dynamo.store.data.domain.car.Car) VTransactionWritable(io.vertigo.commons.transaction.VTransactionWritable) Test(org.junit.Test)

Example 24 with Car

use of io.vertigo.dynamo.store.data.domain.car.Car in project vertigo by KleeGroup.

the class AbstractStoreManagerTest method testNativeInsertNoTx.

@Test(expected = NullPointerException.class)
public void testNativeInsertNoTx() {
    final Car car = createNewCar();
    nativeInsertCar(car);
}
Also used : Car(io.vertigo.dynamo.store.data.domain.car.Car) Test(org.junit.Test)

Example 25 with Car

use of io.vertigo.dynamo.store.data.domain.car.Car in project vertigo by KleeGroup.

the class AbstractStoreManagerTest method testTxNativeInsertCrudSelectRollback.

@Test
public void testTxNativeInsertCrudSelectRollback() {
    try (VTransactionWritable transaction = transactionManager.createCurrentTransaction()) {
        final Car car = createNewCar();
        nativeInsertCar(car);
        // on récupère la liste des voitures
        checkCrudCarsCount(1);
    }
}
Also used : Car(io.vertigo.dynamo.store.data.domain.car.Car) VTransactionWritable(io.vertigo.commons.transaction.VTransactionWritable) Test(org.junit.Test)

Aggregations

Car (io.vertigo.dynamo.store.data.domain.car.Car)25 Test (org.junit.Test)23 VTransactionWritable (io.vertigo.commons.transaction.VTransactionWritable)22 DtDefinition (io.vertigo.dynamo.domain.metamodel.DtDefinition)2 DtListURI (io.vertigo.dynamo.domain.model.DtListURI)2 Famille (io.vertigo.dynamo.store.data.domain.famille.Famille)2 DtListURIForCriteria (io.vertigo.dynamo.domain.model.DtListURIForCriteria)1 URI (io.vertigo.dynamo.domain.model.URI)1 ArrayList (java.util.ArrayList)1