package com.shpun.service;
import com.shpun.pojo.Course;
import com.shpun.pojo.Score;
import com.shpun.pojo.Student;
import com.shpun.pojo.Teacher;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.List;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:spring/spring-*.xml"})
public class TestScoreService {
@Test
public void testInsertScore(){
ApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring/spring-*.xml");
ScoreService scoreService = context.getBean(ScoreService.class);
Score score = new Score();
Student student = new Student();
student.setStudentId(10103);
Course course = new Course();
course.setCourseId(10004);
score.setStudent(student);
score.setCourse(course);
score.setStuCouScore(68);
scoreService.insertScore(score);
}
@Test
public void testDeleteScore(){
ApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring/spring-*.xml");
ScoreService scoreService = context.getBean(ScoreService.class);
Score score = new Score();
Student student = new Student();
student.setStudentId(10103);
Course course = new Course();
course.setCourseId(10003);
score.setStudent(student);
score.setCourse(course);
scoreService.deleteScore(score);
}
@Test
public void testUpdateScore(){
ApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring/spring-*.xml");
ScoreService scoreService = context.getBean(ScoreService.class);
Score score = new Score();
Student student = new Student();
student.setStudentId(10105);
Course course = new Course();
course.setCourseId(10004);
score.setStudent(student);
score.setCourse(course);
score.setStuCouScore(77);
scoreService.updateScore(score);
}
@Test
public void testSearchFromScore(){
ApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring/spring-*.xml");
ScoreService scoreService = context.getBean(ScoreService.class);
List<Score> scoreList = scoreService.searchFromScore("94");
for(Score s : scoreList){
System.out.println(s);
}
}
@Test
public void testSelectScoreById(){
ApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring/spring-*.xml");
ScoreService scoreService = context.getBean(ScoreService.class);
Score score = new Score();
Student student = new Student();
student.setStudentId(10102);
Course course = new Course();
course.setCourseId(10002);
score.setStudent(student);
score.setCourse(course);
System.out.println(scoreService.selectScoreById(score));
}
@Test
public void testSelectAllScores(){
ApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring/spring-*.xml");
ScoreService scoreService = context.getBean(ScoreService.class);
List<Score> scoreList = scoreService.selectAllScores();
for(Score s : scoreList){
System.out.println(s);
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
一个学生学籍信息管理系统.zip (108个子文件)
spring.components 1017B
spring.components 1017B
bootstrap.min.css 141KB
bootstrap.min.css 141KB
SSMStuSys.iml 80B
TestScoreService.java 4KB
TestStudentService.java 3KB
TestCourseService.java 3KB
ScoreController.java 3KB
TestTeacherService.java 3KB
CourseController.java 3KB
ManagerController.java 3KB
StudentServiceImpl.java 2KB
StudentController.java 2KB
TeacherServiceImpl.java 2KB
Student.java 2KB
CourseServiceImpl.java 2KB
ScoreServiceImpl.java 2KB
LoginController.java 1KB
Course.java 1KB
RequestCourse.java 1015B
RequestScore.java 1007B
Score.java 859B
Teacher.java 842B
TeacherDao.java 462B
CourseDao.java 445B
StudentDao.java 431B
ScoreDao.java 427B
Login.java 415B
TeacherService.java 408B
StudentService.java 377B
CourseService.java 360B
ScoreService.java 343B
jquery-3.3.1.min.js 85KB
jquery-3.3.1.min.js 85KB
bootstrap.min.js 48KB
bootstrap.min.js 48KB
popper.min.js 19KB
popper.min.js 19KB
student.js 1KB
student.js 1KB
course.js 627B
course.js 627B
score.js 621B
score.js 621B
studentResult.jsp 14KB
studentResult.jsp 14KB
student.jsp 13KB
student.jsp 13KB
courseResult.jsp 12KB
courseResult.jsp 12KB
course.jsp 12KB
course.jsp 12KB
scoreResult.jsp 12KB
scoreResult.jsp 12KB
score.jsp 12KB
score.jsp 12KB
index.jsp 4KB
index.jsp 4KB
MANIFEST.MF 86B
修改.PNG 99KB
学生管理.PNG 96KB
添加.PNG 95KB
查询.PNG 88KB
成绩管理.PNG 82KB
课程管理.PNG 81KB
登录失败.PNG 24KB
log4j.properties 238B
log4j.properties 238B
log4j.properties 238B
jdbcMysql.properties 162B
jdbcMysql.properties 162B
jdbcMysql.properties 162B
studentsystem.sql 7KB
workspace.xml 56KB
uiDesigner.xml 9KB
pom.xml 8KB
spring-dao.xml 3KB
spring-dao.xml 3KB
spring-dao.xml 3KB
ScoreMapper.xml 3KB
ScoreMapper.xml 3KB
ScoreMapper.xml 3KB
CourseMapper.xml 2KB
CourseMapper.xml 2KB
CourseMapper.xml 2KB
StudentMapper.xml 2KB
StudentMapper.xml 2KB
StudentMapper.xml 2KB
web.xml 2KB
web.xml 2KB
spring-mvc.xml 1KB
spring-mvc.xml 1KB
spring-mvc.xml 1KB
TeacherMapper.xml 1KB
TeacherMapper.xml 1KB
TeacherMapper.xml 1KB
spring-service.xml 1KB
spring-service.xml 1KB
spring-service.xml 1KB
共 108 条
- 1
- 2
资源评论
博士僧小星
- 粉丝: 1880
- 资源: 5878
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功