From 72d9d0afc7dc21b9d7e92b7ca489a099bf9d0acb Mon Sep 17 00:00:00 2001 From: bseayin Date: Sat, 17 Aug 2019 20:45:45 +0800 Subject: [PATCH] junit --- .../src/test/java/com/zz/StudentTest.java | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 SpringBootJPA/src/test/java/com/zz/StudentTest.java diff --git a/SpringBootJPA/src/test/java/com/zz/StudentTest.java b/SpringBootJPA/src/test/java/com/zz/StudentTest.java new file mode 100644 index 0000000..84ec8ed --- /dev/null +++ b/SpringBootJPA/src/test/java/com/zz/StudentTest.java @@ -0,0 +1,54 @@ +package com.zz; + +import java.util.List; + +import javax.annotation.Resource; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import com.zz.entity.Student; +import com.zz.repository.StudentRepository; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class StudentTest { + + @Resource + StudentRepository studentRepository; + @Test + public void t1(){ + Student s=studentRepository.getStudentsdfsdfnative(1, "JDBC"); + System.out.println(s.getScore()); + } + + + @Test + public void t2(){ + List s=studentRepository.getSubGroup(); + System.out.println(s.get(0)[0]); + System.out.println(s.get(0)[1]); + + System.out.println(s.get(1)[0]); + System.out.println(s.get(1)[1]); + } + + @Test + public void t3(){ + List s=studentRepository.selectHomeWork("1"); + System.out.println(s.get(0)[0]); + System.out.println(s.get(0)[1]); + +// System.out.println(s.get(1)[0]); +// System.out.println(s.get(1)[1]); + } + + + @Test + public void t4(){ + int i=studentRepository.updateStu(6); + } + +}