?? personservicetest.java
字號:
package junit.test;
import java.util.List;
import javax.naming.InitialContext;
import org.junit.BeforeClass;
import org.junit.Test;
import ent.user.bean.Person;
import ent.user.service.*;
public class PersonServiceTest {
private static PersonService personService;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
try {
InitialContext ctx = new InitialContext();
personService = (PersonService) ctx
.lookup("PersonServiceBean/remote");
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
public void testSave() {
personService.save(new Person("桂家琪", "mencous", "1988305", "0723110018",
1, 5));
}
@Test
public void testUpdate() {
Person person = personService.getPerson(1);
personService.update(person);
}
@Test
public void testDelete() {
personService.delete(1);
}
@Test
public void testGetPerson() {
Person person = personService.getPerson(1);
System.out.println(person.getPassword());
}
@Test
public void testGetPersons() {
List<Person> persons = personService.getPersons("mencouse", "1988305");
System.out.println(persons.isEmpty());
}
@Test
public void testGetUserName() {
List<Person> persons = personService.getUserName("mencouse");
System.out.println(persons.isEmpty());
}
@Test
public void testGetClasses() {
List<Person> persons = personService.getClasses(5);
System.out.println(persons.isEmpty());
}
@Test
public void testGetPurview() {
List<Person> persons = personService.getPurview(0);
System.out.println(persons.isEmpty());
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -