spring_junit4.4
2011年09月01日
package test; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autow ired; import org.springframework.test.context.ContextConfigurat ion; import org.springframework.test.context.junit4.AbstractTr ansactionalJUnit4SpringContextTests; import org.springframework.test.context.junit4.SpringJUni t4ClassRunner; import com.byd.mmerp.service.impl.T1Service; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"applicationConte xt.xml"}) public class T1ServiceTest extends AbstractTransactionalJUnit4SpringContextTests { @Autowired private T1Service t1Service; @Test public void testGetT1() { String name = t1Service.getT1(1).getName(); System.out.println(name); } }
2011年09月01日
package test; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autow ired; import org.springframework.test.context.ContextConfigurat ion; import org.springframework.test.context.junit4.AbstractTr ansactionalJUnit4SpringContextTests; import org.springframework.test.context.junit4.SpringJUni t4ClassRunner; import com.byd.mmerp.service.impl.T1Service; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"applicationConte xt.xml"}) public class T1ServiceTest extends AbstractTransactionalJUnit4SpringContextTests { @Autowired private T1Service t1Service; @Test public void testGetT1() { String name = t1Service.getT1(1).getName(); System.out.println(name); } }