use of sqlite.kripton209.model1.BindApp1DaoFactory in project kripton by xcesco.
the class Test209Model1Runtime method testRunSqlite1.
@Test
public void testRunSqlite1() {
BindApp1DataSource ds = BindApp1DataSource.instance();
ds.execute(new Transaction() {
@Override
public TransactionResult onExecute(BindApp1DaoFactory daoFactory) {
Device device = new Device();
device.name = "device-test";
daoFactory.getDeviceDao().insert(device);
User user = new User();
user.userName = "user-test";
daoFactory.getUserDao().insert(user);
UserDevice userDevice = new UserDevice();
userDevice.deviceId = device.id;
userDevice.userId = user.id;
daoFactory.getUserDeviceDao().insert(userDevice);
List<Device> devices = daoFactory.getDeviceDao().getUserDevices(user.id);
Assert.assertTrue(devices.size() == 1);
return TransactionResult.ROLLBACK;
}
});
}
Aggregations