This action will force synchronization from ldh123/TestUI, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
package db;import ldh.common.testui.TestUIMainApp;import ldh.common.testui.dao.BeanVarDao;import ldh.common.testui.dao.ParamDao;import ldh.common.testui.dao.TreeDao;import ldh.common.testui.model.BeanVar;import ldh.common.testui.model.ParamModel;import ldh.common.testui.model.TreeNode;import ldh.common.testui.util.JsonUtil;import org.junit.Assert;import org.junit.Before;import org.junit.Ignore;import org.junit.Test;import java.math.BigDecimal;import java.sql.SQLException;import java.util.List;/*** Created by ldh123 on 2017年6月7日.*/@Ignorepublic class TreeDaoTest {@Beforepublic void before() throws Exception {TestUIMainApp.startDb(null);}@Testpublic void test() throws Exception {// TreeNode treeNode = new TreeNode();// treeNode.setName("test001");// treeNode.setParentId(0);// TreeDao.save(treeNode);// Assert.assertNotNull(treeNode.getId());List<TreeNode> treeNodeList = TreeDao.getAll();for(TreeNode treeNode1 : treeNodeList) {listTreeNode(treeNode1);}Assert.assertTrue(treeNodeList.size() > 0);}private void listTreeNode(TreeNode treeNode) throws SQLException {List<ParamModel> params = ParamDao.getByTreeNodeId(treeNode.getId());int n = 0;for(ParamModel pm : params) {if (pm.getIndex() == 0) {pm.setIndex(++n);// ParamDao.update(pm);}}}@Testpublic void query() throws SQLException {List<TreeNode> treeNodeList = TreeDao.getAll();Assert.assertTrue(treeNodeList.size() > 0);}@Testpublic void bigDecimail() throws SQLException {System.out.println(Number.class.isAssignableFrom(BigDecimal.class));List<ParamModel> params = ParamDao.getByTreeNodeId(7);params.forEach(pm -> System.out.println(pm.getIndex()));}@Testpublic void beanVar() throws SQLException {List<BeanVar> beanVars= BeanVarDao.getByTreeNodeId(288);System.out.println(JsonUtil.toJson(beanVars));}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。