Search in sources :

Example 6 with Car

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

the class AbstractStoreManagerTest method testTxCrudInsertRollbackCrudSelectRollback.

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

Example 7 with Car

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

the class AbstractStoreManagerTest method testTxNativeInsertRollbackNativeSelectRollback.

@Test
public void testTxNativeInsertRollbackNativeSelectRollback() {
    try (VTransactionWritable transaction = transactionManager.createCurrentTransaction()) {
        final Car car = createNewCar();
        nativeInsertCar(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 8 with Car

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

the class AbstractStoreManagerTest method initMainStore.

protected void initMainStore() {
    // A chaque test on recrée la table famille
    SqlUtil.execRequests(transactionManager, taskManager, getCreateMainStoreRequests(), "TK_INIT_MAIN", Optional.empty());
    try (VTransactionWritable transaction = transactionManager.createCurrentTransaction()) {
        for (final Car car : carDataBase.getAllCars()) {
            car.setId(null);
            storeManager.getDataStore().create(car);
        }
        transaction.commit();
    }
}
Also used : Car(io.vertigo.dynamo.store.data.domain.car.Car) VTransactionWritable(io.vertigo.commons.transaction.VTransactionWritable)

Example 9 with Car

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

the class AbstractStoreManagerTest method testTxNativeInsertNativeSelectRollback.

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

Example 10 with Car

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

the class AbstractStoreManagerTest method testTxCrudInsertNativeSelectRollback.

@Test
public void testTxCrudInsertNativeSelectRollback() {
    try (final VTransactionWritable transaction = transactionManager.createCurrentTransaction()) {
        final Car car = createNewCar();
        storeManager.getDataStore().create(car);
        // on récupère la liste des voitures
        checkNativeCarsCount(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