⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 teacheriotest.java

📁 成绩查询系统(学校期末的作业) Struts+jdbc+mysql+tomcat 开发工具为BEA WORKSHOP 功能无非就是增删查改加用户权限判断
💻 JAVA
字号:
package sfs.entity.io;

import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import junit.framework.TestCase;
import sfs.entity.Teacher;

public class TeacherIoTest extends TestCase {

	/*
	 * “sfs.entity.io.TeacherIo.TeacherIo()”的测试方法
	 */
	public void testTeacherIo() {

	}

	/*
	 * “sfs.entity.io.TeacherIo.query()”的测试方法
	 */
	public void testQuery() throws ClassNotFoundException, SQLException {
		List list=new ArrayList();
		TeacherIo teio=new TeacherIo();
		list=teio.query();
		System.out.println(list.size());
	}

	/*
	 * “sfs.entity.io.TeacherIo.queryByid(Teacher)”的测试方法
	 */
	public void testQueryByid() throws ClassNotFoundException, SQLException, NumberFormatException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
		TeacherIo teio=new TeacherIo();
		Teacher te=new Teacher();
		te.setId(1);
//		System.out.println(teio.queryByid(te));
		
	}

	/*
	 * “sfs.entity.io.TeacherIo.queryBynumber(Teacher)”的测试方法
	 */
	public void testQueryBynumber() throws ClassNotFoundException, SQLException, NumberFormatException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
		TeacherIo teio=new TeacherIo();
		Teacher te=new Teacher();
		te.setNumber("2001");
//		System.out.println(teio.queryBynumber(te));
	}

	/*
	 * “sfs.entity.io.TeacherIo.deletByid(Teacher)”的测试方法
	 */
	public void testDeletByid() throws ClassNotFoundException, SQLException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
		TeacherIo teio=new TeacherIo();
		Teacher te=new Teacher();
		te.setId(4);
		System.out.println(teio.deletByid(te));
	}

	/*
	 * “sfs.entity.io.TeacherIo.deletBynumber(Teacher)”的测试方法
	 */
	public void testDeletBynumber() throws ClassNotFoundException, SQLException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
		TeacherIo teio=new TeacherIo();
		Teacher te=new Teacher();
		te.setNumber("2001");
		System.out.println(teio.deletBynumber(te));
	}

	/*
	 * “sfs.entity.io.TeacherIo.saveorupdata(Teacher)”的测试方法
	 */
	public void testSaveorupdata() throws ClassNotFoundException, SQLException, NumberFormatException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
		Teacher te=new Teacher();
		te.setAuthority("1");
//		te.setId(5);
		te.setNumber("2002");
		te.setPassword("asdf2");
		te.setRealname("我的");
		TeacherIo teio=new TeacherIo();
		teio.saveorupdata(te);
		System.out.print("-->添加或更新数据。。检查数据库");//TODO ----测试输出---away
		
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -