?? examservicetest.java
字號(hào):
package org.yeeku.test;
import java.util.List;
import junit.framework.TestCase;
import junit.textui.TestRunner;
import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;
import org.yeeku.service.*;
import org.yeeku.model.*;
/**
* @author yeeku.H.lee kongyeeku@163.com
* @version 1.0
* <br>Copyright (C), 2005-2008, yeeku.H.Lee
* <br>This program is protected by copyright laws.
* <br>Program Name:
* <br>Date:
*/
public class ExamServiceTest extends AbstractTransactionalDataSourceSpringContextTests
{
ExamService examService;
public String[] getConfigLocations()
{
String[] configLocations = {"daoContext.xml","appContext.xml"};
return configLocations;
}
public void onSetUpInTransaction()
{
examService = (ExamService)applicationContext.getBean("examService");
}
public void onTearDownInTransaction()
{
examService = null;
}
public void testListStudent()throws Exception
{
List<Student> studentList = examService.listStudent(2);
for (Student s : studentList)
{
System.out.println(s.getName());
}
assertEquals(1 , 1);
}
public void testListQuestion()throws Exception
{
List<Question> questionList = examService.listQuestion(3);
for (Question q : questionList)
{
System.out.println(q.getQuTitle());
}
assertEquals(1 , 1);
}
public void testGetNextQuestion()throws Exception
{
System.out.println("獲取的下一題為:" + examService.getNextQuestion(null , 1).getQuTitle());
assertEquals(1 , 1);
}
public static void main(String[] args)
{
TestRunner.run(ExamServiceTest.class);
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -