spring3.0 使用 AbstractTransactionalJUnit4SpringContextTests 进行单元测试
@RunWith(Suite.class) @Suite.SuiteClasses({ TempTest.class }) public class SuitTest { } /** 单元测试 **/ @ContextConfiguration( locations = {"classpath:applicationContext.xml"} ) @RunWith(SpringJUnit4ClassRunner.class) @Transactional @TransactionConfiguration(transactionManager = "transactionManager", defaultRollback = true) public class TempTest extends AbstractTransactionalJUnit4SpringContextTests { @Autowired private IService iService; @Before public void init() { String [] command = new String[5]; command[0] = "....." ..... simpleJdbcTemplate.getJdbcOperations().batchUpdate(command); } @Test public void queryReport() { //...... Assert.assertEquals(returnVal, expectVal); } }
相关推荐
Cocolada 2020-11-12
86427019 2020-06-28
84284855 2020-06-11
snowphy 2020-05-30
敏敏张 2020-11-11
SCNUHB 2020-11-10
小木兮子 2020-11-11
wwwsurfphpseocom 2020-10-28
WasteLand 2020-10-18
杜鲁门 2020-11-05
shirleypaddy 2020-10-19
qingmumu 2020-10-19
Testingba工作室 2020-09-15
周公周金桥 2020-09-13
专注前端开发 2020-08-16
emagtestage 2020-08-16
heniancheng 2020-08-15
hanjinixng00 2020-08-12