From 84fa18bde23ebb56b8e27b38e4d1678cc7a043e9 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Fri, 7 Aug 2020 15:07:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yipin/liuwanr/Project_ManagementTest.java | 47 +++++++++++++++---- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/src/test/java/com/yipin/liuwanr/Project_ManagementTest.java b/src/test/java/com/yipin/liuwanr/Project_ManagementTest.java index 8babec7..d1ca2cd 100644 --- a/src/test/java/com/yipin/liuwanr/Project_ManagementTest.java +++ b/src/test/java/com/yipin/liuwanr/Project_ManagementTest.java @@ -225,10 +225,10 @@ public class Project_ManagementTest { /** * 添加项目管理信息 */ - @Transactional + @Transactional //在单元测试中 Transaction注解会对数据库的更新(insert update delete)进行回滚 ,以保证数据不污染 @Test public void testInsertProjectManagement() { - Project_Management pro = new Project_Management(); + /*Project_Management pro = new Project_Management(); pro.setProjectName("简单加法计算"); pro.setProjectPermissions(1); pro.setExperimentalGoal("本项目将会帮助学生了解简单的加法计算"); @@ -242,12 +242,17 @@ public class Project_ManagementTest { pro.setFounder(0); List points = new ArrayList<>(); Judgment_Points judgmentPoints = new Judgment_Points(); - judgmentPoints.setJudgmentPointsId(153); - judgmentPoints.setExperimentalRequirements("声明两个变量,让其相加,得到其和....."); + judgmentPoints.setJudgmentPointsId(205); + judgmentPoints.setExperimentalRequirements("按要求写出代码并正确运行显示小明考核结果"); judgmentPoints.setScore(100); points.add(judgmentPoints); List roles = new ArrayList<>(); - roles.add(120); + roles.add(433);*/ + Project_Management pro = projectManagementMapper.getProjectId(302); + pro.setProjectId(null); + pro.setFounder(0); + List points = projectManagementMapper.queryProjectIds(302); + List roles = projectManagementMapper.getByRoleProjectId(302); HashMap map = managementService.insertProjectManagement(pro, points, roles); map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value)); } @@ -258,9 +263,9 @@ public class Project_ManagementTest { */ @Test public void testGetByName() { - String projectName = null; + String projectName = "测试2"; HashMap map = managementService.getByName(projectName); - map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value)); + map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); } /** @@ -270,9 +275,31 @@ public class Project_ManagementTest { @Transactional @Test public void testUpdateProjectManagement() { - Project_Management pro = null; - List points = null; - List roles = null; + /*Project_Management pro = new Project_Management(); + pro.setProjectId(302); + pro.setProjectName("简单加法计算"); + pro.setProjectPermissions(1); + pro.setExperimentalGoal("本项目将会帮助学生了解简单的加法计算"); + pro.setCaseDescription("声明两个变量,让其相加,得到其和"); + pro.setIsstartexperimental(0); + pro.setExperimentSuggests("使用加号,将声明的变量相加"); + pro.setIsstartexperimentSuggests(0); + pro.setState(1); + pro.setSystemId(6); + pro.setUserId(4); + pro.setFounder(0); + List points = new ArrayList<>(); + Judgment_Points judgmentPoints = new Judgment_Points(); + judgmentPoints.setJudgmentPointsId(205); + judgmentPoints.setExperimentalRequirements("按要求写出代码并正确运行显示小明考核结果"); + judgmentPoints.setScore(100); + points.add(judgmentPoints); + List roles = new ArrayList<>(); + roles.add(433);*/ + Project_Management pro = projectManagementMapper.getProjectId(302); + pro.setFounder(0); + List points = projectManagementMapper.queryProjectIds(302); + List roles = projectManagementMapper.getByRoleProjectId(302); HashMap map = managementService.updateProjectManagement(pro, points, roles); map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value)); }