DAO单元测试

来源:4-1 Dao层之新增店铺

慕慕0286245

2018-02-07

二月 07, 2018 2:26:17 下午 org.springframework.test.context.support.DefaultTestContextBootstrapper 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]

二月 07, 2018 2:26:17 下午 org.springframework.test.context.support.DefaultTestContextBootstrapper 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]

二月 07, 2018 2:26:17 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions

信息: Loading XML bean definitions from class path resource [spring/spring-dao.xml]

二月 07, 2018 2:26:17 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions

信息: Loading XML bean definitions from class path resource [spring/spring-service.xml]

二月 07, 2018 2:26:18 下午 org.springframework.context.support.GenericApplicationContext prepareRefresh

信息: Refreshing org.springframework.context.support.GenericApplicationContext@39aeed2f: startup date [Wed Feb 07 14:26:18 CST 2018]; root of context hierarchy

二月 07, 2018 2:26:18 下午 com.mchange.v2.log.MLog <clinit>

信息: MLog clients using java 1.4+ standard logging.

二月 07, 2018 2:26:18 下午 com.mchange.v2.c3p0.C3P0Registry banner

信息: Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]

二月 07, 2018 2:26:20 下午 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 -> 1hge1iv9tus6m1d17z7e77|3a93b025, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge1iv9tus6m1d17z7e77|3a93b025, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/o2o?useUnicode=true&characterEncoding=utf8, 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 ]

2018-02-07 14:26:20.421 [main] DEBUG com.mo.o2o.dao.ShopDao.insertShop - ==>  Preparing: INSERT INTO tb_shop(owner_id, area_id, shop_category_id, shop_name, shop_desc, shop_addr, phone, shop_img, priority, create_time,last_edit_time, enable_status, advice) VALUES (?,?,?,?, ?,?,?,?,?, ?,?, ?,?) 

2018-02-07 14:26:20.478 [main] DEBUG com.mo.o2o.dao.ShopDao.insertShop - ==> Parameters: 1(Long), 2(Integer), 1(Long), 测试的店铺(String), test(String), test(String), test(String), test(String), null, 2018-02-07 14:26:19.905(Timestamp), null, 1(Integer), 审核中(String)

二月 07, 2018 2:26:20 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions

信息: Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]

二月 07, 2018 2:26:20 下午 org.springframework.jdbc.support.SQLErrorCodesFactory <init>

信息: SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase, Hana]

之前怀疑SQL代码写错了,重打一遍发现还是这个错误

写回答

2回答

慕慕0286245

提问者

2018-02-07

有一个主键没写好导致错误,重新写了一遍就没问题了
1
0

翔仔

2018-02-07

同学好,请问还有没有别的详细的错误。。并且同学要站在问题解答者的角度来看哈,尽可能缩短问题的定位信息:)

此外同学可以把这句话贴到客户端执行下

INSERT INTO tb_shop(owner_id, area_id, shop_category_id, shop_name, shop_desc, shop_addr, phone, shop_img, priority, create_time,last_edit_time, enable_status, advice) VALUES (?,?,?,?, ?,?,?,?,?, ?,?, ?,?) 

问号传入对应的信息1(Long), 2(Integer), 1(Long), 测试的店铺(String), test(String), test(String), test(String), test(String), null, 2018-02-07 14:26:19.905(Timestamp), null, 1(Integer), 审核中(String)

看看是否报错

0
0

Java双版本(SSM到SpringBoot)校园商铺全栈开发

SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需

5113 学习 · 8144 问题

查看课程

相似问题