package com.tian;
import java.util.Date;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.ssfans.core.bean.TestTb;
import com.ssfans.core.service.TestTbService;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations="classpath:applicationContext.xml")
public class TestTestTb {
@Autowired
private TestTbService testTbService;
@Test
public void test1(){
TestTb tb = new TestTb();
tb.setName("heiheihe");
tb.setBirthday(new Date());
testTbService.add(tb);
}
}
import java.util.Date;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.ssfans.core.bean.TestTb;
import com.ssfans.core.service.TestTbService;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations="classpath:applicationContext.xml")
public class TestTestTb {
@Autowired
private TestTbService testTbService;
@Test
public void test1(){
TestTb tb = new TestTb();
tb.setName("heiheihe");
tb.setBirthday(new Date());
testTbService.add(tb);
}
}