老师 我检查了配置文件 运行后数据库没有更新 console报错内容:
信息: Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]
一月 22, 2020 5:17:12 下午 org.springframework.test.context.support.DefaultTestContextBootstrapper getTestExecutionListeners
信息: Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@6b143ee9, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@1936f0f5, org.springframework.test.context.support.DependencyInjectionTestExecutionListener@6615435c, org.springframework.test.context.support.DirtiesContextTestExecutionListener@4909b8da, org.springframework.test.context.transaction.TransactionalTestExecutionListener@3a03464, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@2d3fcdbd]
一月 22, 2020 5:17:12 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [spring/spring-dao.xml]
一月 22, 2020 5:17:13 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [spring/spring-service.xml]
一月 22, 2020 5:17:13 下午 org.springframework.context.support.GenericApplicationContext prepareRefresh
信息: Refreshing org.springframework.context.support.GenericApplicationContext@6767c1fc: startup date [Wed Jan 22 17:17:13 CST 2020]; root of context hierarchy
一月 22, 2020 5:17:13 下午 com.mchange.v2.log.MLog <clinit>
信息: MLog clients using java 1.4+ standard logging.
一月 22, 2020 5:17:13 下午 com.mchange.v2.c3p0.C3P0Registry banner
信息: Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]
17:17:13.718 [main] DEBUG org.apache.ibatis.logging.LogFactory - Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter.
17:17:13.858 [main] DEBUG org.apache.ibatis.io.VFS - Class not found: org.jboss.vfs.VFS
17:17:13.866 [main] DEBUG org.apache.ibatis.io.JBoss6VFS - JBoss 6 VFS API is not available in this environment.
17:17:13.872 [main] DEBUG org.apache.ibatis.io.VFS - Class not found: org.jboss.vfs.VirtualFile
17:17:13.873 [main] DEBUG org.apache.ibatis.io.VFS - VFS implementation org.apache.ibatis.io.JBoss6VFS is not valid in this environment.
17:17:13.873 [main] DEBUG org.apache.ibatis.io.VFS - Using VFS adapter org.apache.ibatis.io.DefaultVFS
17:17:13.874 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity
17:17:13.874 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity
17:17:13.958 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: Area.class
17:17:13.959 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: HeadLine.class
17:17:13.959 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: LocalAuth.class
17:17:13.959 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: PersonInfo.class
17:17:13.959 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: ProductCategory.class
17:17:13.960 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: Shop.class
17:17:13.961 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: ShopCategory.class
17:17:13.961 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: WechatAuth.class
17:17:13.961 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Listing file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity
17:17:13.963 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/Area.class
17:17:13.963 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/Area.class
17:17:13.964 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: ����33
17:17:13.964 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/HeadLine.class
17:17:13.965 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/HeadLine.class
17:17:13.965 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: ����3D
17:17:13.965 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/LocalAuth.class
17:17:13.965 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/LocalAuth.class
17:17:13.968 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: ����3:
17:17:13.968 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/PersonInfo.class
17:17:13.969 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/PersonInfo.class
17:17:13.970 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: ����3J
17:17:13.970 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/ProductCategory.class
17:17:13.970 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/ProductCategory.class
17:17:13.971 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: ����35
17:17:13.971 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/Shop.class
17:17:13.971 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/Shop.class
17:17:13.997 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: ����3k
17:17:13.997 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/ShopCategory.class
17:17:13.997 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/ShopCategory.class
17:17:13.998 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: ����3F
17:17:13.998 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/WechatAuth.class
17:17:13.998 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/Users/qiaojingwen/IdeaProjects/o2o/target/classes/com/imooc/o2o/entity/WechatAuth.class
17:17:13.998 [main] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: ����30
17:17:13.998 [main] DEBUG org.apache.ibatis.io.ResolverUtil - Checking to see if class com.imooc.o2o.entity.Area matches criteria [is assignable to Object]
17:17:13.999 [main] DEBUG org.apache.ibatis.io.ResolverUtil - Checking to see if class com.imooc.o2o.entity.HeadLine matches criteria [is assignable to Object]
17:17:14.001 [main] DEBUG org.apache.ibatis.io.ResolverUtil - Checking to see if class com.imooc.o2o.entity.LocalAuth matches criteria [is assignable to Object]
17:17:14.001 [main] DEBUG org.apache.ibatis.io.ResolverUtil - Checking to see if class com.imooc.o2o.entity.PersonInfo matches criteria [is assignable to Object]
17:17:14.001 [main] DEBUG org.apache.ibatis.io.ResolverUtil - Checking to see if class com.imooc.o2o.entity.ProductCategory matches criteria [is assignable to Object]
17:17:14.002 [main] DEBUG org.apache.ibatis.io.ResolverUtil - Checking to see if class com.imooc.o2o.entity.Shop matches criteria [is assignable to Object]
17:17:14.002 [main] DEBUG org.apache.ibatis.io.ResolverUtil - Checking to see if class com.imooc.o2o.entity.ShopCategory matches criteria [is assignable to Object]
17:17:14.003 [main] DEBUG org.apache.ibatis.io.ResolverUtil - Checking to see if class com.imooc.o2o.entity.WechatAuth matches criteria [is assignable to Object]
17:17:14.003 [main] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Scanned package: 'com.imooc.o2o.entity' for aliases
17:17:14.061 [main] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed configuration file: 'class path resource [mybatis-config.xml]'
17:17:14.176 [main] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed mapper file: 'file [/Users/qiaojingwen/IdeaProjects/o2o/target/classes/mapper/AreaDao.xml]'
17:17:14.221 [main] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Parsed mapper file: 'file [/Users/qiaojingwen/IdeaProjects/o2o/target/classes/mapper/ShopDao.xml]'
17:17:14.416 [main] DEBUG org.mybatis.spring.SqlSessionUtils - Creating a new SqlSession
17:17:14.420 [main] DEBUG org.mybatis.spring.SqlSessionUtils - SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2bdd8394] was not registered for synchronization because synchronization is not active
一月 22, 2020 5:17:14 下午 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager
信息: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 2, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 10000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> z8kflta71kr3v54s58myb|dd8ba08, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.cj.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> z8kflta71kr3v54s58myb|dd8ba08, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://127.0.0.1:3306/o2o?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 30, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 10, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]
17:17:15.097 [main] DEBUG org.mybatis.spring.transaction.SpringManagedTransaction - JDBC Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@495ee280] will not be managed by Spring
17:17:15.102 [main] DEBUG com.imooc.o2o.dao.ShopDao.updateShop - ==> Preparing: update tb_shop SET shop_desc=?, shop_addr=?, last_edit_time=? where shop_id=?
17:17:15.146 [main] DEBUG com.imooc.o2o.dao.ShopDao.updateShop - ==> Parameters: 测试描述(String), 测试地址(String), 2020-01-22 17:17:14.407(Timestamp), 1(Long)
17:17:15.148 [main] DEBUG com.imooc.o2o.dao.ShopDao.updateShop - <== Updates: 0
17:17:15.148 [main] DEBUG org.mybatis.spring.SqlSessionUtils - Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@2bdd8394]
java.lang.AssertionError:
Expected :1
Actual :0
<Click to see difference>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:834)
at org.junit.Assert.assertEquals(Assert.java:645)
at org.junit.Assert.assertEquals(Assert.java:631)
at com.imooc.o2o.dao.ShopDaoTest.testUpdateShop(ShopDaoTest.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Process finished with exit code 255
不知道是什么原因?
SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需
了解课程