tazi

使用注解方式

 1 package junit.test;
2
3 import static org.junit.Assert.*;
4
5 import org.junit.BeforeClass;
6 import org.junit.Test;
7 import org.springframework.context.ApplicationContext;
8 import org.springframework.context.support.ClassPathXmlApplicationContext;
9
10 import com.tazi.domin.Person;
11 import com.tazi.service.PersonService;
12
13 public class PersonServiceTest {
14 private static PersonService pService;
15 @BeforeClass
16 public static void setUpBeforeClass() throws Exception {
17 ApplicationContext apc=new ClassPathXmlApplicationContext("bean.xml");
18 pService=(PersonService)apc.getBean("personService");
19 }
20 @Test
21 public void save() {
22 pService.save(new Person("tazi"));
23 }
24 }



分类:

技术点:

相关文章:

  • 2021-08-22
  • 2021-09-16
  • 2021-08-09
  • 2021-11-23
  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-19
  • 2021-05-20
  • 2021-05-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-03
相关资源
相似解决方案