您的位置:首页 > 大数据 > 人工智能

junit.framework.AssertionFailedError: No tests found in com.hyh.test.MainTest

2014-11-23 20:39 776 查看
package com.hyh.test;

import java.util.List;
import javax.inject.Inject;
import org.junit.Test;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests;
import com.hyh.entity.Student;
import com.hyh.entity.Teacher;
import com.hyh.mapper.Mapper;

@ContextConfiguration("classpath:applicationContext-commoms.xml")
public class MainTest extends AbstractJUnit38SpringContextTests {
	@Inject
	private Mapper mapper;

	// @Inject
	// private UserMapper userMapper;
	// @Inject
	// private MessageMapper messageMapper;
	// @Inject
	// private ArticleMapper articleMapper;

	// 注意测试函数名字的命名
	@Test
	public void testGetStudent() {
		List<Student> list = mapper.getStudent(2);
		System.out.println(list);
	}

	@Test
	public void testGetTeacher() {
		List<Teacher> list = mapper.getTeacher(2);
		System.out.println(list);
	}
}


将大写的 TestGetStudent() 修改成 testGetStudent()即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐