测试运行报错

测试运行报错

十一月 28, 2020 3:41:15 下午 org.springframework.test.context.web.WebTestContextBootstrapper getDefaultTestExecutionListenerClassNames
信息: 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]
十一月 28, 2020 3:41:15 下午 org.springframework.test.context.web.WebTestContextBootstrapper getTestExecutionListeners
信息: Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@3a03464, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@2d3fcdbd, org.springframework.test.context.support.DependencyInjectionTestExecutionListener@617c74e5, org.springframework.test.context.support.DirtiesContextTestExecutionListener@6537cf78, org.springframework.test.context.transaction.TransactionalTestExecutionListener@67b6d4ae, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@34b7bfc0]
十一月 28, 2020 3:41:15 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [spring/spring-dao.xml]
十一月 28, 2020 3:41:15 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [spring/spring-service.xml]
十一月 28, 2020 3:41:16 下午 org.springframework.web.context.support.GenericWebApplicationContext prepareRefresh
信息: Refreshing org.springframework.web.context.support.GenericWebApplicationContext@29ee9faa: startup date [Sat Nov 28 15:41:16 CST 2020]; root of context hierarchy
2020-11-28 15:41:16.698 [MLog-Init-Reporter] INFO com.mchange.v2.log.MLog - MLog clients using slf4j logging.
2020-11-28 15:41:16.979 [main] INFO com.mchange.v2.c3p0.C3P0Registry - Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10]
2020-11-28 15:41:17.925 [main] INFO c.m.v2.c3p0.impl.AbstractPoolBackedDataSource - 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, contextClassLoaderSource -> caller, dataSourceName -> 1hge0ywae3tu0rbalxalt|ffaa6af, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.cj.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1hge0ywae3tu0rbalxalt|ffaa6af, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/o2o?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 40, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 10, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]
2020-11-28 15:41:17.951 [main] WARN com.mchange.v2.resourcepool.BasicResourcePool - Bad pool size config, start 3 < min 10. Using 10 as start.
2020-11-28 15:41:18.779 [main] DEBUG com.imooc.o2o.dao.ShopDao.queryByShopId - ==> Preparing: SELECT s.shop_id, s.shop_name, s.shop_desc, s.shop_addr, s.phone, s.shop_img, s.priority, s.create_time, s.last_edit_time, s.enable_status, s.advice, a.area_id, a.area_name, sc.shop_category_id, sc.shop_category_name FROM tb_shop s, tb_area a, tb_shop_category sc WHERE s.area_id=a.area_id AND s.shop_category_id = sc.shop_category_id AND s.shop_id = ?
2020-11-28 15:41:18.859 [main] DEBUG com.imooc.o2o.dao.ShopDao.queryByShopId - ==> Parameters: 1(Long)
2020-11-28 15:41:18.929 [main] DEBUG com.imooc.o2o.dao.ShopDao.queryByShopId - <== Total: 0

老师,这报的是啥错呀?看不明白

正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
好帮手慕小脸 2020-11-28 16:12:28

同学你好,上述贴出的内容是日志信息,并不是报错,也不会影响程序的运行,同学可以暂时忽略它。

祝学习愉快~

  • 提问者 霸气的少年 #1

    http://img1.sycdn.imooc.com//climg/5fc209b80949a98806750209.jpg

    但是运行了是红色的不通过呀,这样子不算是报错的吗?

    2020-11-28 16:26:59
  • 好帮手慕小脸 回复 提问者 霸气的少年 #2

    同学你好,上述图片提示空指针异常,当使用null调用方法就会出现该异常

    http://img1.sycdn.imooc.com//climg/5fc21497099acda803310096.jpg

    建议同学根据报错信息,看一下testQueryBy...()这个方法对应的行数,检查这部分代码哪里为空值

    祝学习愉快~

    2020-11-28 17:15:40
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师