首页 新闻 会员 周边 捐助

junit测试mybatis数据插入出错

1
悬赏园豆:10 [已关闭问题] 关闭于 2015-05-11 11:19

已设置:defaultRollback = false

控制台输出信息:

[2014-12-08 23:53:56,103] [wisdom] [main] [USER_REG.insertUserInfo] [D] ==>  Preparing: insert into WIT_USER ( ID, LOGIN_NAME, PHONE, EMAIL, USER_YPTE, PASSWORD, SALT ) values ( ID = ?, LOGIN_NAME = ?, PHONE = ? ,EMAIL = ?, USER_YPTE = ?, PASSWORD = ? ,SALT = ? ) 
[2014-12-08 23:53:56,143] [wisdom] [main] [USER_REG.insertUserInfo] [D] ==> Parameters: 91003deea56882ea4a4097946b27c071fc2d(String), WZ11111(String), 13566666666(String), 123121@126.com(String), null, 4e447aaa45da6ad844dd5e57cbfd4af38e27fc50(String), bdd3078c7395affd(String)
[2014-12-08 23:53:56,153] [wisdom] [main] [USER_REG.insertUserInfo] [D] <==    Updates: 1
[2014-12-08 23:53:56,163] [wisdom] [main] [o.m.spring.SqlSessionUtils] [D] Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3c925617]
[2014-12-08 23:53:56,163] [wisdom] [main] [sactionalTestExecutionListener] [D] No method-level @Rollback override: using default rollback [false] for test context [DefaultTestContext@469d4b24 testClass = UserServiceTest, testInstance = com.wit.wisdom.module.UserServiceTest@b04cb4, testMethod = testSaveUserInfo@UserServiceTest, testException = [null], mergedContextConfiguration = [MergedContextConfiguration@367bbdc6 testClass = UserServiceTest, locations = '{classpath:conf/spring/applicationContext.xml, classpath:conf/spring/applicationContext-shiro.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]].
[2014-12-08 23:53:56,163] [wisdom] [main] [o.m.spring.SqlSessionUtils] [D] Transaction synchronization committing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3c925617]
[2014-12-08 23:53:56,163] [wisdom] [main] [o.m.spring.SqlSessionUtils] [D] Transaction synchronization deregistering SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3c925617]
[2014-12-08 23:53:56,163] [wisdom] [main] [o.m.spring.SqlSessionUtils] [D] Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3c925617]
[2014-12-08 23:53:56,163] [wisdom] [main] [d.DataSourceTransactionManager] [D] Initiating transaction commit
[2014-12-08 23:53:56,163] [wisdom] [main] [d.DataSourceTransactionManager] [D] Committing JDBC transaction on Connection [com.mysql.jdbc.JDBC4Connection@2c1ec049]
[2014-12-08 23:53:56,233] [wisdom] [main] [d.DataSourceTransactionManager] [D] Releasing JDBC Connection [com.mysql.jdbc.JDBC4Connection@2c1ec049] after transaction
[2014-12-08 23:53:56,233] [wisdom] [main] [o.s.j.d.DataSourceUtils] [D] Returning JDBC Connection to DataSource
[2014-12-08 23:53:56,233] [wisdom] [main] [sactionalTestExecutionListener] [I] Committed transaction after test execution for test context [DefaultTestContext@469d4b24 testClass = UserServiceTest, testInstance = com.wit.wisdom.module.UserServiceTest@b04cb4, testMethod = testSaveUserInfo@UserServiceTest, testException = [null], mergedContextConfiguration = [MergedContextConfiguration@367bbdc6 testClass = UserServiceTest, locations = '{classpath:conf/spring/applicationContext.xml, classpath:conf/spring/applicationContext-shiro.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]
[2014-12-08 23:53:56,233] [wisdom] [main] [esContextTestExecutionListener] [D] After test method: context [DefaultTestContext@469d4b24 testClass = UserServiceTest, testInstance = com.wit.wisdom.module.UserServiceTest@b04cb4, testMethod = testSaveUserInfo@UserServiceTest, testException = [null], mergedContextConfiguration = [MergedContextConfiguration@367bbdc6 testClass = UserServiceTest, locations = '{classpath:conf/spring/applicationContext.xml, classpath:conf/spring/applicationContext-shiro.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]], class dirties context [false], class mode [null], method dirties context [false].
[2014-12-08 23:53:56,243] [wisdom] [main] [esContextTestExecutionListener] [D] After test class: context [DefaultTestContext@469d4b24 testClass = UserServiceTest, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [MergedContextConfiguration@367bbdc6 testClass = UserServiceTest, locations = '{classpath:conf/spring/applicationContext.xml, classpath:conf/spring/applicationContext-shiro.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]], dirtiesContext [false].
[2014-12-08 23:53:56,243] [wisdom] [Thread-1] [.c.s.GenericApplicationContext] [I] Closing org.springframework.context.support.GenericApplicationContext@12339dd9: startup date [Mon Dec 08 23:53:53 CST 2014]; root of context hierarchy
[2014-12-08 23:53:56,243] [wisdom] [Thread-1] [f.s.DefaultListableBeanFactory] [D] Returning cached instance of singleton bean 'sqlSessionFactory'
[2014-12-08 23:53:56,243] [wisdom] [Thread-1] [f.s.DefaultListableBeanFactory] [D] Returning cached instance of singleton bean 'lifecycleProcessor'
[2014-12-08 23:53:56,243] [wisdom] [Thread-1] [f.s.DefaultListableBeanFactory] [D] Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@324eba57: defining beans [appConfig,baseDao,baseService,accountService,captchaController,loginController,mainController,roleServiceImpl,userService,userRegisterController,workbenchController,person,stoneAxe,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,propertyConfigurer,dataSource,sqlSessionFactory,transactionManager,transactionInterceptor,BeanProxy,captchaProducer,securityManager,shiroDbRealm,shiroFilter,shiroEhcacheManager,lifecycleBeanPostProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor]; root of factory hierarchy
[2014-12-08 23:53:56,243] [wisdom] [Thread-1] [s.s.LifecycleBeanPostProcessor] [D] Destroying bean [securityManager]...
[2014-12-08 23:53:56,253] [wisdom] [Thread-1] [s.s.LifecycleBeanPostProcessor] [D] Destroying bean [shiroEhcacheManager]...
[2014-12-08 23:53:56,253] [wisdom] [Thread-1] [f.s.DefaultListableBeanFactory] [D] Retrieved dependent beans for bean 'userService': [com.wit.wisdom.module.UserServiceTest]

数据库情况为:

之前为空数据,运行过后ID选项变为0,其他为null

 

请帮忙看看这是出了什么问题?谢谢先!

小忙的主页 小忙 | 初学一级 | 园豆:153
提问于:2014-12-08 23:57
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册