Package com.sm.web.person.service

Source Code of com.sm.web.person.service.PersonServiceTest

package com.sm.web.person.service;

import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.sm.web.person.pojo.Person;

public class PersonServiceTest {
 
 
  private static PersonService personService;
 
  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    try {
     
      ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
          "com/sm/resources/spring/spring-core-basic.xml");
     
          personService=(PersonService)applicationContext.getBean("personService");
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
 
 
  @Test
  public void add()
  {
    Person p=new Person();
    p.setName("��С��");
    p.setAge(25);
    //p.setVersion(10);
    personService.addPerson(p);
    System.out.println("ok");
  }
}
TOP

Related Classes of com.sm.web.person.service.PersonServiceTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.