Spring4.x第⼆章实例1.0chapter2【原书源码报错】
/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/bin/java -Dmaven.multiModuleProjectDirectory=/Volumes/我的电脑/我的电脑/Desktop/wangpan/chapter2 "-Dmaven.home=/Volumes/我的电脑/我的电脑/Applications/IntelliJ
IDEA.app/Contents/plugins/maven/lib/maven3" "-f=/Volumes/我的电脑/我的电脑/Applications/IntelliJ
IDEA.app/Contents/plugins/maven/lib/maven3/f" -ding=UTF-8 -classpath "/Volumes/我的电脑/我的电
脑/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/boot/plexus-classworlds-2.5.2.jar"
[INFO] Scanning
[INFO]
[INFO] ------------------------------------------------------------------------
用友凭证
[INFO] Building Spring4.x第⼆章实例 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-jetty-plugin:6.1.25:run-exploded (default-cli) > package @ chapter2 >>>
[INFO]excel怎么用
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ chapter2 ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ chapter2 ---
[INFO] Nothing to compile - all class are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ chapter2 ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Volumes/我的电脑/我的电脑/Desktop/wangpan/chapter2/src/test/resources
[INFO]
绩效考核的意义
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ chapter2 ---
[INFO] Nothing to compile - all class are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ chapter2 ---
[INFO] Surefire report directory: /Volumes/我的电脑/我的电脑/Desktop/wangpan/chapter2/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.smart.rvice.UrServiceTest
Configuring TestNG with: TestNG652Configurator
Nov 23, 2017 4:20:47 PM st.context.support.DefaultTestContextBootstrapper getTestExecutionListeners
: Using TestExecutionListeners: [st.context.web.ServletTestExecutionListener@544fe44c,
st.context.support.DirtiesContextBeforeModesTestExecutionListener@31610302,
st.context.support.DependencyInjectionTestExecutionListener@71318ec4,
st.context.support.DirtiesContextTestExecutionListener@21213b92,
ansaction.TransactionalTestExecutionListener@a67c67e,
st.context.jdbc.SqlScriptsTestExecutionListener@3327bd23]
Nov 23, 2017 4:20:47 PM org.springframework.l.XmlBeanDefinitionReader loadBeanDefinitions
: Loading XML bean definitions from URL [file:/Volumes/我的电脑/我的电脑/Desktop/wangpan/chapter2/target/l]
Nov 23, 2017 4:20:48 PM t.support.GenericApplicationContext prepareRefresh
: Refreshing t.support.GenericApplicationContext@3c1f9361: startup date [Thu Nov 23 16:20:48 HKT 2017]; root of context hierarchy
Nov 23, 2017 4:20:49 PM ansaction.TransactionContext startTransaction
: Began transaction (1) for test context [DefaultTestContext@4c411a88 testClass = UrServiceTest, testInstance =
com.smart.rvice.UrServiceTest@6e0e048a, testMethod = testFindUrByUrName@UrServiceTest, testException = [null], mergedContextConfiguration = [MergedContextConfiguration@7b1a0cce testClass = UrServiceTest, locations =
'{classpath*:/l}', class = '{}', contextInitializerClass = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'st.context.support.DelegatingSmartContextLoader', parent = [null]]]; transaction manager [org.springframework.jdbc.datasource.DataSourceTransactionManager@702c06fe]; rollback [true]
Nov 23, 2017 4:20:49 PM ansaction.TransactionContext startTransaction
:
Began transaction (1) for test context [DefaultTestContext@4c411a88 testClass = UrServiceTest, testInstance =
com.smart.rvice.UrServiceTest@6e0e048a, testMethod = testFindUrByUrName@UrServiceTest, testException = [null], mergedContextConfiguration = [MergedContextConfiguration@7b1a0cce testClass = UrServiceTest, locations =
'{classpath*:/l}', class = '{}', contextInitializerClass = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'st.context.support.DelegatingSmartContextLoader', parent = [null]]]; transaction manager [org.springframework.jdbc.datasource.DataSourceTransactionManager@702c06fe]; rollback [true]
Nov 23, 2017 4:20:49 PM ansaction.TransactionContext startTransaction
: Began transaction (1) for test context [DefaultTestContext@4c411a88 testClass = UrServiceTest, testInstance =
com.smart.rvice.UrServiceTest@6e0e048a, testMethod = testFindUrByUrName@UrServiceTest, testException = [null], mergedContextConfiguration = [MergedContextConfiguration@7b1a0cce testClass = UrServiceTest, locations =
'{classpath*:/l}', class = '{}', contextInitializerClass = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'st.context.support.DelegatingSmartContextLoader', parent = [null]]]; transaction manager [org.springframework.jdbc.datasource.DataSourceTransactionManager@702c06fe]; rollback [true]
Nov 23, 2017 4:20:49 PM ansaction.TransactionContext endTransaction
: Rolled back transaction for test context [DefaultTestContext@4c411a88 testClass = UrServiceTest, testInstance =
com.smart.rvice.UrServiceTest@6e0e048a, testMethod = testFindUrByUrName@UrServiceTest, testException =
java.lang.AsrtionError: expected [true] but found [fal], mergedContextConfiguration = [MergedContextConfiguration@7b1a0cce testClass = UrServiceTest, locations = '{classpath*:/l}', class = '{}', contextInitializerClass = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader =
'st.context.support.DelegatingSmartContextLoader', parent = [null]]].
Nov 23, 2017 4:20:49 PM ansaction.TransactionContext endTransaction
: Rolled back transaction for test context [DefaultTestContext@4c411a88 testClass = UrServiceTest, testInstance =
com.smart.rvice.UrServiceTest@6e0e048a, testMethod = testFindUrByUrName@UrServiceTest, testException =
java.lang.AsrtionError: expected [true] but found [fal], mergedContextConfiguration = [MergedContextConfiguration@7b1a0cce testClass = UrServiceTest, locations = '{classpath*:/l}', class = '{}', contextInitializerClass = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader =
'st.context.support.DelegatingSmartContextLoader', parent = [null]]].
Nov 23, 2017 4:20:49 PM org.springframework.l.XmlBeanDefinitionReader loadBeanDefinitions
: Loading XML bean definitions from class path resource [org/springframework/jdbc/l]
Nov 23, 2017 4:20:49 PM org.springframework.jdbc.support.SQLErrorCodesFactory <init>
: SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Syba, Hana]
Nov 23, 2017 4:20:49 PM ansaction.TransactionContext endTransaction
: Rolled back transaction for test context [DefaultTestContext@4c411a88 testClass = UrServiceTest, testInstance =26个英语单词
com.smart.rvice.UrServiceTest@6e0e048a, testMethod = testAddLoginLog@UrServiceTest, testException =
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [INSERT INTO
t_login_log(ur_id,ip,login_datetime) VALUES(?,?,?)]; nested exception is
'st.context.support.DelegatingSmartContextLoader', parent = [null]]].
Nov 23, 2017 4:20:49 PM t.support.GenericApplicationContext doClo
: Closing t.support.GenericApplicationContext@3c1f9361: startup date [Thu Nov 23 16:20:48 HKT 2017]; root of context hierarchy
Tests run: 3, Failures: 3, Errors: 0, Skipped: 0, Time elapd: 1.963 c <<< FAILURE! - in com.smart.rvice.UrServiceTest testFindUrByUrName(com.smart.rvice.UrServiceTest)
Time elapd: 0.11 c <<< FAILURE!
java.lang.AsrtionError: expected [admin] but found [null]
stng.Asrt.fail(Asrt.java:94)
均布荷载
stng.Asrt.failNotEquals(Asrt.java:494)
stng.Asrt.asrtEquals(Asrt.java:123)
stng.Asrt.asrtEquals(Asrt.java:176)
stng.Asrt.asrtEquals(Asrt.java:186)
at com.smart.stFindUrByUrName(UrServiceTest.java:29)
testHasMatchUr(com.smart.rvice.UrServiceTest) Time elapd: 0.111 c <<< FAILURE!
java.lang.AsrtionError: expected [true] but found [fal]
stng.Asrt.fail(Asrt.java:94)
stng.Asrt.failNotEquals(Asrt.java:494)
stng.Asrt.asrtTrue(Asrt.java:42)
stng.Asrt.asrtTrue(Asrt.java:52)
at com.smart.stHasMatchUr(UrServiceTest.java:21)
testAddLoginLog(com.smart.rvice.UrServiceTest) Time elapd: 0.323 c <<< FAILURE!
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [INSERT INTO
t_login_log(ur_id,ip,login_datetime) VALUES(?,?,?)]; nested exception is
wInstance0(Native Method)
wInstance(NativeConstructorAccessorImpl.java:62)
wInstance(DelegatingConstructorAccessorImpl.java:45)
at wInstance(Constructor.java:423)
sql.jdbc.Util.handleNewInstance(Util.java:411)
sql.Instance(Util.java:386)
sql.ateSQLException(SQLError.java:1054)
sql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
sql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
sql.jdbc.MysqlIO.ndCommand(MysqlIO.java:2617)
藏羚王sql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778)
sql.SQL(ConnectionImpl.java:2834)
sql.uteInternal(PreparedStatement.java:2156)
sql.uteUpdate(PreparedStatement.java:2441)
sql.uteUpdate(PreparedStatement.java:2366)
sql.uteUpdate(PreparedStatement.java:2350)
at s.uteUpdate(DelegatingPreparedStatement.java:105)
at s.uteUpdate(DelegatingPreparedStatement.java:105)
at org.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:873)
经济增长
at org.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:866)
at org.ute(JdbcTemplate.java:629)
at org.JdbcTemplate.update(JdbcTemplate.java:866)
at org.JdbcTemplate.update(JdbcTemplate.java:927)
at org.JdbcTemplate.update(JdbcTemplate.java:937)
at com.smart.dao.LoginLogDao.inrtLoginLog(LoginLogDao.java:19)
at com.smart.rvice.UrService.loginSuccess(UrService.java:36)
at com.smart.rvice.UrService$$FastClassBySpringCGLIB$$753a64bf.invoke(<generated>)
at lib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at ansaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at
ansaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) at ansaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)
at org.springframework.aop.interceptor.ExpoInvocationInterceptor.invoke(ExpoInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvidInterceptor.intercept(CglibAopProxy.java:653)
at com.smart.rvice.UrService$$EnhancerBySpringCGLIB$$36adc704.loginSuccess(<generated>)
at com.smart.stAddLoginLog(UrServiceTest.java:42)
Results :
Failed tests:
UrServiceTest>AbstractTestNGSpringContextTests.run:175->testFindUrByUrName:29 expected [admin] but found [null] UrServiceTest>AbstractTestNGSpringContextTests.run:175->testHasMatchUr:21 expected [true] but found [fal]
UrServiceTest>AbstractTestNGSpringContextTests.run:175->testAddLoginLog:42 » BadSqlGrammar
Tests run: 3, Failures: 3, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE茶业经营
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.374 s
[INFO] Finished at: 2017-11-23T16:20:49+08:00
[INFO] Final Memory: 10M/232M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test (default-test) on project chapter2: There are test failures.
[ERROR]
[ERROR] Plea refer to /Volumes/我的电脑/我的电脑/Desktop/wangpan/chapter2/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To e the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, plea read the following articles:
[ERROR] [Help 1] cwiki.apache/confluence/display/MAVEN/MojoFailureException
Process finished with exit code 1