forked from sommer1991/javaWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserTest.java
More file actions
37 lines (30 loc) · 865 Bytes
/
UserTest.java
File metadata and controls
37 lines (30 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package webproject;
import javax.annotation.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.weibo.dashboard.entity.User;
import com.weibo.dashboard.service.UserService;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath:conf/spring-mybatis.xml"})
public class UserTest {
@Resource
UserService us;
@Test
public void testAdd(){
User user = new User();
user.setName("test");
user.setPassword("testpd");
int res= us.insert(user);
System.out.println(res);
}
@Test
public void testAccountValid(){
User user = new User();
user.setName("test");
user.setPassword("testpd");
boolean res = us.accountValid(user);
System.out.println(res);
}
}