use of sqlite.kripton64.BindBean64ADataSource.Transaction in project kripton by xcesco.
the class Test64BRuntime method testRunSqlite.
@Test
public void testRunSqlite() {
BindBean64ADataSource dataSource = BindBean64ADataSource.instance();
dataSource.execute(new Transaction() {
@Override
public TransactionResult onExecute(BindBean64ADaoFactory daoFactory) {
Bean64ADaoImpl dao = daoFactory.getBean64ADao();
Bean64A bean = new Bean64A();
bean.valueString = "hello";
bean.valueMapStringBean = new HashMap<>();
bean.valueMapStringBean.put("key1", new Bean64A());
bean.valueSetString = new HashSet<String>();
bean.valueSetString.add("hello");
dao.insert(bean);
List<Bean64A> list = dao.selectList(bean.id);
Assert.assertEquals("not list ", 1, list.size());
Assert.assertEquals("not map", 1, list.size());
Assert.assertEquals("not set", 1, list.get(0).valueSetString.size());
return TransactionResult.COMMIT;
}
});
}
use of sqlite.kripton64.BindBean64ADataSource.Transaction in project kripton by xcesco.
the class Test64ARuntime method testRunSqlite.
@Test
public void testRunSqlite() throws IOException, InstantiationException, IllegalAccessException {
BindBean64ADataSource dataSource = BindBean64ADataSource.instance();
dataSource.execute(new Transaction() {
@Override
public TransactionResult onExecute(BindBean64ADaoFactory daoFactory) {
Bean64ADaoImpl dao = daoFactory.getBean64ADao();
Bean64A bean = new Bean64A();
bean.valueString = "hello";
bean.valueMapStringBean = new HashMap<>();
bean.valueMapStringBean.put("key1", new Bean64A());
bean.valueSetString = new HashSet<String>();
bean.valueSetString.add("hello");
dao.insert(bean);
List<Bean64A> list = dao.selectList(bean.id);
Assert.assertEquals("not list ", 1, list.size());
Assert.assertEquals("not map", 1, list.size());
Assert.assertEquals("not set", 1, list.get(0).valueSetString.size());
return TransactionResult.COMMIT;
}
});
}
use of sqlite.kripton64.BindBean64ADataSource.Transaction in project kripton by xcesco.
the class Test64Runtime method testRunSqlite.
@Test
public void testRunSqlite() throws IOException, InstantiationException, IllegalAccessException {
BindBean64DataSource dataSource = BindBean64DataSource.instance();
dataSource.execute(new Transaction() {
@Override
public TransactionResult onExecute(BindBean64DaoFactory daoFactory) {
Bean64DaoImpl dao = daoFactory.getBean64Dao();
Bean64 bean = new Bean64();
bean.valueString = "hello";
bean.valueMapStringBean = new HashMap<>();
bean.valueMapStringBean.put("key1", new Bean64());
bean.valueSetString = new HashSet<String>();
bean.valueSetString.add("hello");
dao.insert(bean);
List<Bean64> list = dao.selectList(bean.id);
Assert.assertEquals("not list ", 1, list.size());
Assert.assertEquals("not set", 1, list.get(0).valueSetString.size());
return TransactionResult.COMMIT;
}
});
}
Aggregations