ExperimentalClassService单元测试

master
shijie 4 years ago
parent 9571b7c766
commit 6e8e98e27a
  1. 14
      src/main/java/com/yipin/liuwanr/entity/Industry.java
  2. 11
      src/main/java/com/yipin/liuwanr/entity/IndustryClass.java
  3. 86
      src/main/java/com/yipin/liuwanr/entity/Student.java
  4. 157
      src/test/java/com/yipin/liuwanr/ExperimentalClassServiceTest.java

@ -13,19 +13,33 @@ public class Industry {
public Integer getIndustryId() {
return industryId;
}
public void setIndustryId(Integer industryId) {
this.industryId = industryId;
}
public Integer getIndustryClassId() {
return industryClassId;
}
public void setIndustryClassId(Integer industryClassId) {
this.industryClassId = industryClassId;
}
public String getIndustryName() {
return industryName;
}
public void setIndustryName(String industryName) {
this.industryName = industryName;
}
@Override
public String toString() {
return "Industry{" +
"industryId=" + industryId +
", industryClassId=" + industryClassId +
", industryName='" + industryName + '\'' +
'}';
}
}

@ -11,13 +11,24 @@ public class IndustryClass {
public Integer getIndustryClassId() {
return industryClassId;
}
public void setIndustryClassId(Integer industryClassId) {
this.industryClassId = industryClassId;
}
public String getIndustryClassName() {
return industryClassName;
}
public void setIndustryClassName(String industryClassName) {
this.industryClassName = industryClassName;
}
@Override
public String toString() {
return "IndustryClass{" +
"industryClassId=" + industryClassId +
", industryClassName='" + industryClassName + '\'' +
'}';
}
}

@ -60,163 +60,249 @@ public class Student {
public String getStuProfessionalArchitectureName() {
return stuProfessionalArchitectureName;
}
public void setStuProfessionalArchitectureName(String stuProfessionalArchitectureName) {
this.stuProfessionalArchitectureName = stuProfessionalArchitectureName;
}
public String getAttendance() {
return attendance;
}
public void setAttendance(String attendance) {
this.attendance = attendance;
}
public Integer getLoginNumber() {
return loginNumber;
}
public void setLoginNumber(Integer loginNumber) {
this.loginNumber = loginNumber;
}
public String getLastLoginTime() {
return lastLoginTime;
}
public void setLastLoginTime(String lastLoginTime) {
this.lastLoginTime = lastLoginTime;
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public Integer getIntExperimentalClassId() {
return intExperimentalClassId;
}
public void setIntExperimentalClassId(Integer intExperimentalClassId) {
this.intExperimentalClassId = intExperimentalClassId;
}
public String getStudentNameNumber() {
return studentNameNumber;
}
public void setStudentNameNumber(String studentNameNumber) {
this.studentNameNumber = studentNameNumber;
}
public String getProfessionalName() {
return professionalName;
}
public void setProfessionalName(String professionalName) {
this.professionalName = professionalName;
}
public String getGradeName() {
return gradeName;
}
public void setGradeName(String gradeName) {
this.gradeName = gradeName;
}
public String getProfessionalIds() {
return professionalIds;
}
public void setProfessionalIds(String professionalIds) {
this.professionalIds = professionalIds;
}
public String getGradeIds() {
return gradeIds;
}
public void setGradeIds(String gradeIds) {
this.gradeIds = gradeIds;
}
public String getClassIds() {
return classIds;
}
public void setClassIds(String classIds) {
this.classIds = classIds;
}
public String getSearchContent() {
return searchContent;
}
public void setSearchContent(String searchContent) {
this.searchContent = searchContent;
}
public String getUniqueIdentificationAccount() {
return uniqueIdentificationAccount;
}
public void setUniqueIdentificationAccount(String uniqueIdentificationAccount) {
this.uniqueIdentificationAccount = uniqueIdentificationAccount;
}
public Integer getStudentId() {
return studentId;
}
public void setStudentId(Integer studentId) {
this.studentId = studentId;
}
public String getStudentName() {
return studentName;
}
public void setStudentName(String studentName) {
this.studentName = studentName;
}
public String getStudentNumber() {
return studentNumber;
}
public void setStudentNumber(String studentNumber) {
this.studentNumber = studentNumber;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Integer getRoleId() {
return roleId;
}
public void setRoleId(Integer roleId) {
this.roleId = roleId;
}
public Integer getSchoolId() {
return schoolId;
}
public void setSchoolId(Integer schoolId) {
this.schoolId = schoolId;
}
public Integer getProfessionalId() {
return professionalId;
}
public void setProfessionalId(Integer professionalId) {
this.professionalId = professionalId;
}
public Integer getGradeId() {
return gradeId;
}
public void setGradeId(Integer gradeId) {
this.gradeId = gradeId;
}
public Integer getClassId() {
return classId;
}
public void setClassId(Integer classId) {
this.classId = classId;
}
public String getExperimentalClassName() {
return experimentalClassName;
}
public void setExperimentalClassName(String experimentalClassName) {
this.experimentalClassName = experimentalClassName;
}
public String getExperimentalClassId() {
return experimentalClassId;
}
public void setExperimentalClassId(String experimentalClassId) {
this.experimentalClassId = experimentalClassId;
}
public Integer getIsAssess() {
return isAssess;
}
public void setIsAssess(Integer isAssess) {
this.isAssess = isAssess;
}
@Override
public String toString() {
return "Student{" +
"studentId=" + studentId +
", studentName='" + studentName + '\'' +
", studentNumber='" + studentNumber + '\'' +
", phone='" + phone + '\'' +
", email='" + email + '\'' +
", roleId=" + roleId +
", schoolId=" + schoolId +
", professionalId=" + professionalId +
", gradeId=" + gradeId +
", classId=" + classId +
", experimentalClassName='" + experimentalClassName + '\'' +
", experimentalClassId='" + experimentalClassId + '\'' +
", isAssess=" + isAssess +
", uniqueIdentificationAccount='" + uniqueIdentificationAccount + '\'' +
", searchContent='" + searchContent + '\'' +
", professionalIds='" + professionalIds + '\'' +
", gradeIds='" + gradeIds + '\'' +
", classIds='" + classIds + '\'' +
", professionalName='" + professionalName + '\'' +
", gradeName='" + gradeName + '\'' +
", studentNameNumber='" + studentNameNumber + '\'' +
", intExperimentalClassId=" + intExperimentalClassId +
", className='" + className + '\'' +
", loginNumber=" + loginNumber +
", lastLoginTime='" + lastLoginTime + '\'' +
", attendance='" + attendance + '\'' +
", stuProfessionalArchitectureName='" + stuProfessionalArchitectureName + '\'' +
'}';
}
}

@ -0,0 +1,157 @@
package com.yipin.liuwanr;
import com.yipin.liuwanr.entity.ExperimentalClass;
import com.yipin.liuwanr.entity.Student;
import com.yipin.liuwanr.service.ExperimentalClassService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@RunWith(SpringRunner.class)
@SpringBootTest
public class ExperimentalClassServiceTest {
@Autowired
private ExperimentalClassService experimentalClassService;
//添加客户
@Test
@Transactional
public void experimentClassAddStudent() {
List<Student> studentList = new ArrayList<>();
Student stu = new Student();
stu.setStudentId(1);
stu.setExperimentalClassId("123");
studentList.add(stu);
HashMap<String, Object> map = experimentalClassService.experimentClassAddStudent(studentList);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
//实验班级删除学生
@Test
@Transactional
public void experimentClassDeleteStudent() {
List<Student> studentList = new ArrayList<>();
Student stu = new Student();
stu.setStudentId(1);
stu.setExperimentalClassId("123");
studentList.add(stu);
HashMap<String, Object> map = experimentalClassService.experimentClassDeleteStudent(studentList);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
//创建实验班级
@Test
@Transactional
public void addExperimentalClass() {
ExperimentalClass experimentalClass = new ExperimentalClass();
experimentalClass.setExperimentalClassName("测试");
experimentalClass.setClassSize(12);
experimentalClass.setFounder("测试");
experimentalClass.setCourseId(2);
experimentalClass.setUserId(2);
experimentalClass.setSchoolId(2);
HashMap<String, Object> map = experimentalClassService.addExperimentalClass(experimentalClass);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
@Test
public void queryExperimentalClass() {
Integer schoolId = 1;
Integer courseId = 2;
HashMap<String, Object> map = experimentalClassService.queryExperimentalClass(schoolId, courseId);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
//查询实验班级专业
@Test
public void queryExperimentalClassSP() {
Integer experimentalClassId = 1;
HashMap<String, Object> map = experimentalClassService.queryExperimentalClassSP(experimentalClassId);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
//查询学生行政班级
@Test
public void queryStudentClass() {
Integer experimentalClassId = 1;
HashMap<String, Object> map = experimentalClassService.queryStudentClass(experimentalClassId);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
/**
* 班级详情
*/
@Test
public void queryExperimentalClassDetails() {
Student student = new Student();
Integer courseId = 1;
HashMap<String, Object> map = experimentalClassService.queryExperimentalClassDetails(student, courseId);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
//新增学生显示数据
@Test
public void queryexperimentalClass() {
Integer experimentalClassId = 1;
HashMap<String, Object> map = experimentalClassService.queryexperimentalClass(experimentalClassId);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
//专业下拉框
@Test
public void getProfessionals() {
Integer experimentalClassId = 1;
HashMap<String, Object> map = experimentalClassService.getProfessionals(experimentalClassId);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
//班级下拉框
@Test
public void getStudentClass() {
Integer experimentalClassId = 1;
HashMap<String, Object> map = experimentalClassService.getStudentClass(experimentalClassId);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
@Test
@Transactional
public void deleteExperimentalClass() {
Integer experimentalClassId = 1;
HashMap<String, Object> map = experimentalClassService.deleteExperimentalClass(experimentalClassId);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
@Test
@Transactional
public void updateExperimentalClass() {
ExperimentalClass experimentalClass = new ExperimentalClass();
HashMap<String, Object> map = experimentalClassService.updateExperimentalClass(experimentalClass);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
//修改实验班级名称
@Test
@Transactional
public void updateExperimentClassName() {
ExperimentalClass experimentalClass = new ExperimentalClass();
HashMap<String, Object> map = experimentalClassService.updateExperimentalClass(experimentalClass);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
//——————————————————————————————全承珠
@Test
public void queryGetByExperimentalClassName() {
String experimentalClassName = "";
HashMap<String, Object> map = experimentalClassService.queryGetByExperimentalClassName(experimentalClassName);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
}
Loading…
Cancel
Save