package cn.itcast;
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 cn.itcast.core.bean.TestTable;
import cn.itcast.core.service.TestTbService;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations="classpath:application-context.xml")
public class TestTestTb {
@Resource
private TestTbService testTbService;
@Test
public void testAdd(){
TestTable testTable=new TestTable();
testTable.setName("test");
testTbService.addTbTest(testTable);
}
}
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 cn.itcast.core.bean.TestTable;
import cn.itcast.core.service.TestTbService;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations="classpath:application-context.xml")
public class TestTestTb {
@Resource
private TestTbService testTbService;
@Test
public void testAdd(){
TestTable testTable=new TestTable();
testTable.setName("test");
testTbService.addTbTest(testTable);
}
}