springMVC 与mybatis 整合 demo(maven 工程)

一、准备工作(MySQL数据库安装)

1. 首先创建一个表:

  1. CREATE TABLE `t_user` (  
  2.   `USER_ID` int(11) NOT NULL AUTO_INCREMENT,  
  3.   `USER_NAME` char(30) NOT NULL,  
  4.   `USER_PASSWORD` char(10) NOT NULL,  
  5.   `USER_EMAIL` char(30) NOT NULL,  
  6.   PRIMARY KEY (`USER_ID`),  
  7.   KEY `IDX_NAME` (`USER_NAME`)  
  8. ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8  

随便插入一些数据:

  1. INSERT INTO t_user (USER_ID, USER_NAME, USER_PASSWORD, USER_EMAIL) VALUES (1, '林炳文', '1234567@', 'ling20081005@126.com');  
  2. INSERT INTO t_user (USER_ID, USER_NAME, USER_PASSWORD, USER_EMAIL) VALUES (2, 'evan', '123', 'fff@126.com');  
  3. INSERT INTO t_user (USER_ID, USER_NAME, USER_PASSWORD, USER_EMAIL) VALUES (3, 'kaka', 'cadg', 'fwsfg@126.com');  
  4. INSERT INTO t_user (USER_ID, USER_NAME, USER_PASSWORD, USER_EMAIL) VALUES (4, 'simle', 'cscs', 'fsaf@126.com');  
  5. INSERT INTO t_user (USER_ID, USER_NAME, USER_PASSWORD, USER_EMAIL) VALUES (5, 'arthur', 'csas', 'fsaff@126.com');  
  6. INSERT INTO t_user (USER_ID, USER_NAME, USER_PASSWORD, USER_EMAIL) VALUES (6, '小德', 'yuh78', 'fdfas@126.com');  
  7. INSERT INTO t_user (USER_ID, USER_NAME, USER_PASSWORD, USER_EMAIL) VALUES (7, '小小', 'cvff', 'fsaf@126.com');  
  8. INSERT INTO t_user (USER_ID, USER_NAME, USER_PASSWORD, USER_EMAIL) VALUES (8, '林林之家', 'gvv', 'lin@126.com');  
  9. INSERT INTO t_user (USER_ID, USER_NAME, USER_PASSWORD, USER_EMAIL) VALUES (9, '林炳文Evankaka', 'dfsc', 'ling2008@126.com');  
  10. INSERT INTO t_user (USER_ID, USER_NAME, USER_PASSWORD, USER_EMAIL) VALUES (10, 'apple', 'uih6', 'ff@qq.com');

二、工程创建

1、Maven工程创建

(1)新建


(2)选择快速框架


(3)输出项目名,包,记得选war(表示web项目,以后可以spingMVC连起来用)


(4)创建好之后 



(5)检查下

这三个地方JDK的版本一定要一样!!!!




三、sping+mybatis配置

1、整个工程目录如下:


2、POM文件

[html]  view plain  copy
  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    
  2.     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">    
  3.     <modelVersion>4.0.0</modelVersion>    
  4.     <groupId>com.lin</groupId>    
  5.     <artifactId>ssm_project</artifactId>    
  6.     <version>0.0.1-SNAPSHOT</version>    
  7.     <packaging>war</packaging>    
  8.     <properties>    
  9.         <!-- spring版本号 -->    
  10.         <spring.version>3.2.8.RELEASE</spring.version>    
  11.         <!-- log4j日志文件管理包版本 -->    
  12.         <slf4j.version>1.6.6</slf4j.version>    
  13.         <log4j.version>1.2.12</log4j.version>    
  14.         <!-- junit版本号 -->    
  15.         <junit.version>4.10</junit.version>    
  16.         <!-- mybatis版本号 -->    
  17.         <mybatis.version>3.2.1</mybatis.version>    
  18.     </properties>    
  19.     
  20.     <dependencies>    
  21.         <!-- 添加Spring依赖 -->    
  22.         <dependency>    
  23.             <groupId>org.springframework</groupId>    
  24.             <artifactId>spring-core</artifactId>    
  25.             <version>${spring.version}</version>    
  26.         </dependency>    
  27.         <dependency>    
  28.             <groupId>org.springframework</groupId>    
  29.             <artifactId>spring-webmvc</artifactId>    
  30.             <version>${spring.version}</version>    
  31.         </dependency>    
  32.         <dependency>    
  33.             <groupId>org.springframework</groupId>    
  34.             <artifactId>spring-context</artifactId>    
  35.             <version>${spring.version}</version>    
  36.         </dependency>    
  37.         <dependency>    
  38.             <groupId>org.springframework</groupId>    
  39.             <artifactId>spring-context-support</artifactId>    
  40.             <version>${spring.version}</version>    
  41.         </dependency>    
  42.         <dependency>    
  43.             <groupId>org.springframework</groupId>    
  44.             <artifactId>spring-aop</artifactId>    
  45.             <version>${spring.version}</version>    
  46.         </dependency>    
  47.         <dependency>    
  48.             <groupId>org.springframework</groupId>    
  49.             <artifactId>spring-aspects</artifactId>    
  50.             <version>${spring.version}</version>    
  51.         </dependency>    
  52.         <dependency>    
  53.             <groupId>org.springframework</groupId>    
  54.             <artifactId>spring-tx</artifactId>    
  55.             <version>${spring.version}</version>    
  56.         </dependency>    
  57.         <dependency>    
  58.             <groupId>org.springframework</groupId>    
  59.             <artifactId>spring-jdbc</artifactId>    
  60.             <version>${spring.version}</version>    
  61.         </dependency>    
  62.         <dependency>    
  63.             <groupId>org.springframework</groupId>    
  64.             <artifactId>spring-web</artifactId>    
  65.             <version>${spring.version}</version>    
  66.         </dependency>    
  67.     
  68.         <!--单元测试依赖 -->    
  69.         <dependency>    
  70.             <groupId>junit</groupId>    
  71.             <artifactId>junit</artifactId>    
  72.             <version>${junit.version}</version>    
  73.             <scope>test</scope>    
  74.         </dependency>    
  75.     
  76.         <!-- 日志文件管理包 -->    
  77.         <!-- log start -->    
  78.         <dependency>    
  79.             <groupId>log4j</groupId>    
  80.             <artifactId>log4j</artifactId>    
  81.             <version>${log4j.version}</version>    
  82.         </dependency>    
  83.         <dependency>    
  84.             <groupId>org.slf4j</groupId>    
  85.             <artifactId>slf4j-api</artifactId>    
  86.             <version>${slf4j.version}</version>    
  87.         </dependency>    
  88.         <dependency>    
  89.             <groupId>org.slf4j</groupId>    
  90.             <artifactId>slf4j-log4j12</artifactId>    
  91.             <version>${slf4j.version}</version>    
  92.         </dependency>    
  93.         <!-- log end -->    
  94.     
  95.         <!--spring单元测试依赖 -->    
  96.         <dependency>    
  97.             <groupId>org.springframework</groupId>    
  98.             <artifactId>spring-test</artifactId>    
  99.             <version>${spring.version}</version>    
  100.             <scope>test</scope>    
  101.         </dependency>    
  102.     
  103.         <!--mybatis依赖 -->    
  104.         <dependency>    
  105.             <groupId>org.mybatis</groupId>    
  106.             <artifactId>mybatis</artifactId>    
  107.             <version>${mybatis.version}</version>    
  108.         </dependency>    
  109.     
  110.         <!-- mybatis/spring包 -->    
  111.         <dependency>    
  112.             <groupId>org.mybatis</groupId>    
  113.             <artifactId>mybatis-spring</artifactId>    
  114.             <version>1.2.0</version>    
  115.         </dependency>    
  116.     
  117.         <!-- mysql驱动包 -->    
  118.         <dependency>    
  119.             <groupId>mysql</groupId>    
  120.             <artifactId>mysql-connector-java</artifactId>    
  121.             <version>5.1.29</version>    
  122.         </dependency>    
  123.     </dependencies>    
  124.     
  125. </project>    

3、Java代码-------src/main/java

目录如下:


(1)User.java

对应数据库中表的字段,放在src/main/java下的包com.lin.domain


[java]  view plain  copy
  1. package com.lin.domain;    
  2.     
  3. /**  
  4.  * User映射类  
  5.  *   
  6.  */    
  7. public class User {    
  8.     private Integer userId;    
  9.     private String userName;    
  10.     private String userPassword;    
  11.     private String userEmail;    
  12.     
  13.     public Integer getUserId() {    
  14.         return userId;    
  15.     }    
  16.     
  17.     public void setUserId(Integer userId) {    
  18.         this.userId = userId;    
  19.     }    
  20.     
  21.     public String getUserName() {    
  22.         return userName;    
  23.     }    
  24.     
  25.     public void setUserName(String userName) {    
  26.         this.userName = userName;    
  27.     }    
  28.     
  29.     public String getUserPassword() {    
  30.         return userPassword;    
  31.     }    
  32.     
  33.     public void setUserPassword(String userPassword) {    
  34.         this.userPassword = userPassword;    
  35.     }    
  36.     
  37.     public String getUserEmail() {    
  38.         return userEmail;    
  39.     }    
  40.     
  41.     public void setUserEmail(String userEmail) {    
  42.         this.userEmail = userEmail;    
  43.     }    
  44.     
  45.     @Override    
  46.     public String toString() {    
  47.         return "User [userId=" + userId + ", userName=" + userName    
  48.                 + ", userPassword=" + userPassword + ", userEmail=" + userEmail    
  49.                 + "]";    
  50.     }    
  51.         
  52. }    

(2)UserDao.java

Dao接口类,用来对应mapper文件。放在src/main/java下的包com.lin.dao,内容如下:

[java]  view plain  copy
  1. package com.lin.dao;    
  2.     
  3.     
  4. import com.lin.domain.User;    
  5.     
  6. /**  
  7.  * 功能概要:User的DAO类  
  8.  *   
  9.  * @author linbingwen  
  10.  * @since 2015年9月28日  
  11.  */    
  12. public interface UserDao {    
  13.     /**  
  14.      *   
  15.      * @param userId  
  16.      * @return  
  17.      */    
  18.     public User selectUserById(Integer userId);    
  19.     
  20. }    

(2)UserService.java和UserServiceImpl.java

service接口类和实现类,放在src/main/java下的包com.lin.service,内容如下:

UserService.java

[java]  view plain  copy
  1. package com.lin.service;    
  2.     
  3. import org.springframework.stereotype.Service;    
  4.     
  5. import com.lin.domain.User;    
  6.     
  7. /**  
  8.  * 功能概要:UserService接口类  
  9.  *   
  10.  */    
  11. public interface UserService {    
  12.     User selectUserById(Integer userId);    
  13.     
  14. }    
UserServiceImpl.java
[java]  view plain  copy
  1. package com.lin.service;    
  2.     
  3. import org.springframework.beans.factory.annotation.Autowired;    
  4. import org.springframework.stereotype.Service;    
  5.     
  6. import com.lin.dao.UserDao;    
  7. import com.lin.domain.User;    
  8.     
  9. /**  
  10.  * 功能概要:UserService实现类  
  11.  *   
  12.  *  
  13.  */    
  14. @Service    
  15. public class UserServiceImpl implements UserService{    
  16.     @Autowired    
  17.     private UserDao userDao;    
  18.     
  19.     public User selectUserById(Integer userId) {    
  20.         return userDao.selectUserById(userId);    
  21.             
  22.     }    
  23.     
  24. }    

(4)mapper文件

用来和dao文件对应,放在src/main/java下的com.lin.mapper包下

[html]  view plain  copy
  1. <?xml version="1.0" encoding="UTF-8"?>      
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"      
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">    
  4. <mapper namespace="com.lin.dao.UserDao">    
  5. <!--设置domain类和数据库中表的字段一一对应,注意数据库字段和domain类中的字段名称不致,此处一定要!-->    
  6.     <resultMap id="BaseResultMap" type="com.lin.domain.User">    
  7.         <id column="USER_ID" property="userId" jdbcType="INTEGER" />    
  8.         <result column="USER_NAME" property="userName" jdbcType="CHAR" />    
  9.         <result column="USER_PASSWORD" property="userPassword" jdbcType="CHAR" />    
  10.         <result column="USER_EMAIL" property="userEmail" jdbcType="CHAR" />    
  11.     </resultMap>    
  12.     <!-- 查询单条记录 -->    
  13.     <select id="selectUserById" parameterType="int" resultMap="BaseResultMap">    
  14.         SELECT * FROM t_user WHERE USER_ID = #{userId}    
  15.     </select>    
  16. </mapper>    

4、资源配置-------src/main/resources  目录:



(1)mybatis配置文件

这里没有什么内容,因为都被放到application.xml中去了,放在src/main/resources下的mybatis文件夹下

mybatis-config.xml内容如下:

[html]  view plain  copy
  1. <?xml version="1.0" encoding="UTF-8"?>      
  2. <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"      
  3. "http://mybatis.org/dtd/mybatis-3-config.dtd">      
  4. <configuration>        
  5. </configuration>   

(2)数据源配置jdbc.properties

放在src/main/resources下的propertiesy文件夹下

[html]  view plain  copy
  1. jdbc_driverClassName=com.mysql.jdbc.Driver    
  2. jdbc_url=jdbc:mysql://localhost:3306/lxlbase   
  3. jdbc_username=root    
  4. jdbc_password=lxl  

(3)spring配置

这是最重要的:application.xml内容如下

[html]  view plain  copy
  1. <?xml version="1.0" encoding="UTF-8"?>    
  2. <beans xmlns="http://www.springframework.org/schema/beans"    
  3.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"    
  4.     xmlns:aop="http://www.springframework.org/schema/aop"    
  5.     xsi:schemaLocation="      
  6.            http://www.springframework.org/schema/beans      
  7.            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd      
  8.            http://www.springframework.org/schema/aop      
  9.            http://www.springframework.org/schema/aop/spring-aop-3.0.xsd    
  10.            http://www.springframework.org/schema/context      
  11.            http://www.springframework.org/schema/context/spring-context-3.0.xsd">    
  12.          
  13.      <!-- 引入jdbc配置文件 -->      
  14.      <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">    
  15.         <property name="locations">    
  16.             <list>    
  17.                <value>classpath:properties/*.properties</value>    
  18.                 <!--要是有多个配置文件,只需在这里继续添加即可 -->    
  19.             </list>    
  20.         </property>    
  21.     </bean>    
  22.         
  23.         
  24.     
  25.     <!-- 配置数据源 -->    
  26.     <bean id="dataSource"    
  27.         class="org.springframework.jdbc.datasource.DriverManagerDataSource">    
  28.         <!-- 不使用properties来配置 -->    
  29.         <!-- <property name="driverClassName" value="com.mysql.jdbc.Driver" />     
  30.             <property name="url" value="jdbc:mysql://localhost:3306/learning" />     
  31.             <property name="username" value="root" />     
  32.             <property name="password" value="christmas258@" /> -->    
  33.        <!-- 使用properties来配置 -->    
  34.         <property name="driverClassName">    
  35.             <value>${jdbc_driverClassName}</value>    
  36.         </property>    
  37.         <property name="url">    
  38.             <value>${jdbc_url}</value>    
  39.         </property>    
  40.         <property name="username">    
  41.             <value>${jdbc_username}</value>    
  42.         </property>    
  43.         <property name="password">    
  44.             <value>${jdbc_password}</value>    
  45.         </property>    
  46.     </bean>    
  47.     
  48.     <!-- 自动扫描了所有的XxxxMapper.xml对应的mapper接口文件,这样就不用一个一个手动配置Mpper的映射了,只要Mapper接口类和Mapper映射文件对应起来就可以了。 -->    
  49.     <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">    
  50.         <property name="basePackage"    
  51.             value="com.lin.dao" />    
  52.     </bean>    
  53.     
  54.     <!-- 配置Mybatis的文件 ,mapperLocations配置**Mapper.xml文件位置,configLocation配置mybatis-config文件位置-->    
  55.     <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">    
  56.         <property name="dataSource" ref="dataSource" />    
  57.         <property name="mapperLocations" value="classpath*:com/lin/mapper/**/*.xml"/>      
  58.         <property name="configLocation" value="classpath:mybatis/mybatis-config.xml" />    
  59.         <!-- <property name="typeAliasesPackage" value="com.tiantian.ckeditor.model"     
  60.             /> -->    
  61.     </bean>    
  62.     
  63.     <!-- 自动扫描注解的bean -->    
  64.     <context:component-scan base-package="com.lin.service" />    
  65.     
  66. </beans>    

(4)日志打印log4j.properties

就放在src/main/resources

[html]  view plain  copy
  1. log4j.rootLogger=DEBUG,Console,Stdout    
  2.     
  3. #Console    
  4. log4j.appender.Console=org.apache.log4j.ConsoleAppender    
  5. log4j.appender.Console.layout=org.apache.log4j.PatternLayout    
  6. log4j.appender.Console.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n    
  7.     
  8. log4j.logger.java.sql.ResultSet=INFO    
  9. log4j.logger.org.apache=INFO    
  10. log4j.logger.java.sql.Connection=DEBUG    
  11. log4j.logger.java.sql.Statement=DEBUG    
  12. log4j.logger.java.sql.PreparedStatement=DEBUG     
  13.     
  14. log4j.appender.Stdout = org.apache.log4j.DailyRollingFileAppender      
  15. log4j.appender.Stdout.File = E://logs/log.log      
  16. log4j.appender.Stdout.Append = true      
  17. log4j.appender.Stdout.Threshold = DEBUG       
  18. log4j.appender.Stdout.layout = org.apache.log4j.PatternLayout      
  19. log4j.appender.Stdout.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss}  [ %t:%r ] - [ %p ]  %m%n  

四、单元测试

 上面的配置完好,接下来就是测验成功

整个目录 如下:


(1)测试基类

[java]  view plain  copy
  1. package com.lin.baseTest;    
  2.     
  3. import org.junit.runner.RunWith;    
  4. import org.slf4j.Logger;    
  5. import org.slf4j.LoggerFactory;    
  6. import org.springframework.test.context.ContextConfiguration;    
  7. import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;    
  8. import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;    
  9.     
  10. /**  
  11.  * 功能概要:  
  12.  *    
  13.  */    
  14. //指定bean注入的配置文件    
  15. @ContextConfiguration(locations = { "classpath:application.xml" })    
  16. //使用标准的JUnit @RunWith注释来告诉JUnit使用Spring TestRunner    
  17. @RunWith(SpringJUnit4ClassRunner.class)    
  18. public abstract class SpringTestCase extends AbstractJUnit4SpringContextTests{    
  19.     protected Logger logger = LoggerFactory.getLogger(getClass());    
  20. }    

(2)测试类

[java]  view plain  copy
  1. package com.lin.service;    
  2.     
  3. import org.apache.log4j.Logger;    
  4. import org.junit.Test;    
  5. import org.springframework.beans.factory.annotation.Autowired;    
  6.     
  7. import com.lin.baseTest.SpringTestCase;    
  8. import com.lin.domain.User;    
  9.     
  10. /**  
  11.  * 功能概要:UserService单元测试  
  12.  *     
  13.  */    
  14. public class UserServiceTest extends SpringTestCase {    
  15.     @Autowired    
  16.     private UserService userService;    
  17.     Logger logger = Logger.getLogger(UserServiceTest.class);    
  18.         
  19.     @Test    
  20.     public void selectUserByIdTest(){    
  21.         User user = userService.selectUserById(10);    
  22.         logger.debug("查找结果" + user);    
  23.     }    
  24.         
  25. }    

选中selectUserByIdTest,然后右键如下运行



***************************************************************************************************************************************************************************************

注意:

要是jdk1.8 那么spring 版本需要4.0以上

在文件 pom修改 (这里就随意选择4.1.5)

[html]  view plain  copy
  1. <!-- spring版本号 -->    
  2.       <spring.version>4.1.5.RELEASE</spring.version>    
application.xml  修改:

[html]  view plain  copy
  1. <?xml version="1.0" encoding="UTF-8"?>    
  2. <beans xmlns="http://www.springframework.org/schema/beans"    
  3.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"    
  4.     xmlns:aop="http://www.springframework.org/schema/aop"    
  5.     xsi:schemaLocation="      
  6.            http://www.springframework.org/schema/beans      
  7.            http://www.springframework.org/schema/beans/spring-beans-4.0.xsd      
  8.            http://www.springframework.org/schema/aop      
  9.            http://www.springframework.org/schema/aop/spring-aop-4.0.xsd    
  10.            http://www.springframework.org/schema/context      
  11.            http://www.springframework.org/schema/context/spring-context-4.0.xsd">    
  12.          
  13.      <!-- 引入jdbc配置文件 -->      
  14.      <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">    
  15.         <property name="locations">    
  16.             <list>    
  17.                <value>classpath:properties/*.properties</value>    
  18.                 <!--要是有多个配置文件,只需在这里继续添加即可 -->    
  19.             </list>    
  20.         </property>    
  21.     </bean>    
  22.         
  23.         

#################################################################################################################################

运行结果:(以jdk1.8为例)

2017-06-03 20:09:04,035 [main] DEBUG [org.springframework.test.context.junit4.SpringJUnit4ClassRunner] - SpringJUnit4ClassRunner constructor called with [class com.lin.service.UserServiceTest].
  2017-06-03 20:09:04,267 [main] DEBUG [org.springframework.test.context.BootstrapUtils] - Instantiating TestContextBootstrapper from class [org.springframework.test.context.support.DefaultTestContextBootstrapper]
  2017-06-03 20:09:04,387 [main] DEBUG [org.springframework.test.context.support.AbstractDelegatingSmartContextLoader] - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@2aaf7cc2 declaringClass = 'com.lin.baseTest.SpringTestCase', classes = '{}', locations = '{classpath:application.xml}', inheritLocations = true, initializers = '{}', inheritInitializers = true, name = [null], contextLoaderClass = 'org.springframework.test.context.ContextLoader'].
  2017-06-03 20:09:04,419 [main] DEBUG [org.springframework.test.context.support.ActiveProfilesUtils] - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [com.lin.service.UserServiceTest]
  2017-06-03 20:09:04,538 [main] INFO  [org.springframework.test.context.support.DefaultTestContextBootstrapper] - Could not instantiate TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener]. Specify custom listener classes or make the default listener classes (and their required dependencies) available. Offending class: [javax/servlet/ServletContext]
  2017-06-03 20:09:04,557 [main] INFO  [org.springframework.test.context.support.DefaultTestContextBootstrapper] - Using TestExecutionListeners: [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@35bbe5e8, org.springframework.test.context.support.DirtiesContextTestExecutionListener@2c8d66b2]
  2017-06-03 20:09:04,559 [main] DEBUG [org.springframework.test.annotation.ProfileValueUtils] - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.lin.service.UserServiceTest]
  2017-06-03 20:09:04,560 [main] DEBUG [org.springframework.test.annotation.ProfileValueUtils] - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.lin.service.UserServiceTest]
  2017-06-03 20:09:04,561 [main] DEBUG [org.springframework.test.annotation.ProfileValueUtils] - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.lin.service.UserServiceTest]
  2017-06-03 20:09:04,561 [main] DEBUG [org.springframework.test.annotation.ProfileValueUtils] - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.lin.service.UserServiceTest]
  2017-06-03 20:09:04,631 [main] DEBUG [org.springframework.test.annotation.ProfileValueUtils] - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.lin.service.UserServiceTest]
  2017-06-03 20:09:04,632 [main] DEBUG [org.springframework.test.annotation.ProfileValueUtils] - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.lin.service.UserServiceTest]
  2017-06-03 20:09:04,633 [main] DEBUG [org.springframework.test.annotation.ProfileValueUtils] - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.lin.service.UserServiceTest]
  2017-06-03 20:09:04,633 [main] DEBUG [org.springframework.test.annotation.ProfileValueUtils] - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.lin.service.UserServiceTest]
  2017-06-03 20:09:04,634 [main] DEBUG [org.springframework.test.annotation.ProfileValueUtils] - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.lin.service.UserServiceTest]
  2017-06-03 20:09:04,635 [main] DEBUG [org.springframework.test.annotation.ProfileValueUtils] - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.lin.service.UserServiceTest]
  2017-06-03 20:09:04,652 [main] DEBUG [org.springframework.test.annotation.ProfileValueUtils] - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.lin.service.UserServiceTest]
  2017-06-03 20:09:04,652 [main] DEBUG [org.springframework.test.annotation.ProfileValueUtils] - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.lin.service.UserServiceTest]
  2017-06-03 20:09:04,737 [main] DEBUG [org.springframework.test.context.support.DependencyInjectionTestExecutionListener] - Performing dependency injection for test context [[DefaultTestContext@7f690630 testClass = UserServiceTest, testInstance = com.lin.service.UserServiceTest@edf4efb, testMethod = [null], testException = [null], mergedContextConfiguration = [MergedContextConfiguration@2f7a2457 testClass = UserServiceTest, locations = '{classpath:application.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]].
  2017-06-03 20:09:04,738 [main] DEBUG [org.springframework.test.context.support.AbstractDelegatingSmartContextLoader] - Delegating to GenericXmlContextLoader to load context from [MergedContextConfiguration@2f7a2457 testClass = UserServiceTest, locations = '{classpath:application.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]].
  2017-06-03 20:09:04,738 [main] DEBUG [org.springframework.test.context.support.AbstractGenericContextLoader] - Loading ApplicationContext for merged context configuration [[MergedContextConfiguration@2f7a2457 testClass = UserServiceTest, locations = '{classpath:application.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]].
  2017-06-03 20:09:05,271 [main] DEBUG [org.springframework.core.env.StandardEnvironment] - Adding [systemProperties] PropertySource with lowest search precedence
  2017-06-03 20:09:05,272 [main] DEBUG [org.springframework.core.env.StandardEnvironment] - Adding [systemEnvironment] PropertySource with lowest search precedence
  2017-06-03 20:09:05,273 [main] DEBUG [org.springframework.core.env.StandardEnvironment] - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]
  2017-06-03 20:09:05,498 [main] INFO  [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from class path resource [application.xml]
  2017-06-03 20:09:05,839 [main] DEBUG [org.springframework.beans.factory.xml.DefaultDocumentLoader] - Using JAXP provider [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl]
  2017-06-03 20:09:06,365 [main] DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] - Loading schema mappings from [META-INF/spring.schemas]
  2017-06-03 20:09:06,446 [main] DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] - Loaded schema mappings: {http://www.springframework.org/schema/tx/spring-tx-2.5.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd, http://www.springframework.org/schema/aop/spring-aop-4.1.xsd=org/springframework/aop/config/spring-aop-4.1.xsd, http://www.springframework.org/schema/context/spring-context-3.1.xsd=org/springframework/context/config/spring-context-3.1.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-4.1.xsd=org/springframework/jdbc/config/spring-jdbc-4.1.xsd, http://www.springframework.org/schema/util/spring-util-3.0.xsd=org/springframework/beans/factory/xml/spring-util-3.0.xsd, http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd=org/springframework/web/servlet/config/spring-mvc-4.1.xsd, http://mybatis.org/schema/mybatis-spring-1.2.xsd=org/mybatis/spring/config/mybatis-spring-1.2.xsd, http://www.springframework.org/schema/tool/spring-tool.xsd=org/springframework/beans/factory/xml/spring-tool-4.1.xsd, http://www.springframework.org/schema/aop/spring-aop-3.2.xsd=org/springframework/aop/config/spring-aop-3.2.xsd, http://www.springframework.org/schema/lang/spring-lang-4.1.xsd=org/springframework/scripting/config/spring-lang-4.1.xsd, http://www.springframework.org/schema/context/spring-context-4.0.xsd=org/springframework/context/config/spring-context-4.0.xsd, http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd=org/springframework/web/servlet/config/spring-mvc-3.2.xsd, http://www.springframework.org/schema/tool/spring-tool-4.1.xsd=org/springframework/beans/factory/xml/spring-tool-4.1.xsd, http://www.springframework.org/schema/lang/spring-lang-3.2.xsd=org/springframework/scripting/config/spring-lang-3.2.xsd, http://www.springframework.org/schema/cache/spring-cache-3.2.xsd=org/springframework/cache/config/spring-cache-3.2.xsd, http://www.springframework.org/schema/jee/spring-jee-4.1.xsd=org/springframework/ejb/config/spring-jee-4.1.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd=org/springframework/jdbc/config/spring-jdbc-3.1.xsd, http://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd, http://www.springframework.org/schema/tool/spring-tool-3.2.xsd=org/springframework/beans/factory/xml/spring-tool-3.2.xsd, http://www.springframework.org/schema/context/spring-context.xsd=org/springframework/context/config/spring-context-4.1.xsd, http://www.springframework.org/schema/cache/spring-cache-4.1.xsd=org/springframework/cache/config/spring-cache-4.1.xsd, http://www.springframework.org/schema/aop/spring-aop-4.0.xsd=org/springframework/aop/config/spring-aop-4.0.xsd, http://www.springframework.org/schema/jee/spring-jee-3.2.xsd=org/springframework/ejb/config/spring-jee-3.2.xsd, http://www.springframework.org/schema/context/spring-context-3.0.xsd=org/springframework/context/config/spring-context-3.0.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-4.0.xsd=org/springframework/jdbc/config/spring-jdbc-4.0.xsd, http://www.springframework.org/schema/util/spring-util-2.5.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd, http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd=org/springframework/web/servlet/config/spring-mvc-4.0.xsd, http://www.springframework.org/schema/beans/spring-beans-3.2.xsd=org/springframework/beans/factory/xml/spring-beans-3.2.xsd, http://www.springframework.org/schema/aop/spring-aop-3.1.xsd=org/springframework/aop/config/spring-aop-3.1.xsd, http://www.springframework.org/schema/lang/spring-lang-4.0.xsd=org/springframework/scripting/config/spring-lang-4.0.xsd, http://www.springframework.org/schema/mvc/spring-mvc.xsd=org/springframework/web/servlet/config/spring-mvc-4.1.xsd, http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd=org/springframework/web/servlet/config/spring-mvc-3.1.xsd, http://www.springframework.org/schema/beans/spring-beans-4.1.xsd=org/springframework/beans/factory/xml/spring-beans-4.1.xsd, http://www.springframework.org/schema/tool/spring-tool-4.0.xsd=org/springframework/beans/factory/xml/spring-tool-4.0.xsd, http://www.springframework.org/schema/tx/spring-tx-3.2.xsd=org/springframework/transaction/config/spring-tx-3.2.xsd, http://www.springframework.org/schema/lang/spring-lang-3.1.xsd=org/springframework/scripting/config/spring-lang-3.1.xsd, http://www.springframework.org/schema/cache/spring-cache-3.1.xsd=org/springframework/cache/config/spring-cache-3.1.xsd, http://www.springframework.org/schema/jee/spring-jee-4.0.xsd=org/springframework/ejb/config/spring-jee-4.0.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd=org/springframework/jdbc/config/spring-jdbc-3.0.xsd, http://www.springframework.org/schema/task/spring-task-4.1.xsd=org/springframework/scheduling/config/spring-task-4.1.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc.xsd=org/springframework/jdbc/config/spring-jdbc-4.1.xsd, http://www.springframework.org/schema/tool/spring-tool-3.1.xsd=org/springframework/beans/factory/xml/spring-tool-3.1.xsd, http://www.springframework.org/schema/tx/spring-tx-4.1.xsd=org/springframework/transaction/config/spring-tx-4.1.xsd, http://www.springframework.org/schema/cache/spring-cache-4.0.xsd=org/springframework/cache/config/spring-cache-4.0.xsd, http://www.springframework.org/schema/jee/spring-jee-3.1.xsd=org/springframework/ejb/config/spring-jee-3.1.xsd, http://www.springframework.org/schema/task/spring-task-3.2.xsd=org/springframework/scheduling/config/spring-task-3.2.xsd, http://www.springframework.org/schema/beans/spring-beans-3.1.xsd=org/springframework/beans/factory/xml/spring-beans-3.1.xsd, http://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-4.1.xsd, http://www.springframework.org/schema/aop/spring-aop-3.0.xsd=org/springframework/aop/config/spring-aop-3.0.xsd, http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd=org/springframework/web/servlet/config/spring-mvc-3.0.xsd, http://www.springframework.org/schema/beans/spring-beans-4.0.xsd=org/springframework/beans/factory/xml/spring-beans-4.0.xsd, http://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-4.1.xsd, http://mybatis.org/schema/mybatis-spring.xsd=org/mybatis/spring/config/mybatis-spring-1.2.xsd, http://www.springframework.org/schema/tx/spring-tx-3.1.xsd=org/springframework/transaction/config/spring-tx-3.1.xsd, http://www.springframework.org/schema/lang/spring-lang-3.0.xsd=org/springframework/scripting/config/spring-lang-3.0.xsd, http://www.springframework.org/schema/context/spring-context-2.5.xsd=org/springframework/context/config/spring-context-2.5.xsd, http://www.springframework.org/schema/task/spring-task-4.0.xsd=org/springframework/scheduling/config/spring-task-4.0.xsd, http://www.springframework.org/schema/tool/spring-tool-3.0.xsd=org/springframework/beans/factory/xml/spring-tool-3.0.xsd, http://www.springframework.org/schema/tx/spring-tx-4.0.xsd=org/springframework/transaction/config/spring-tx-4.0.xsd, http://www.springframework.org/schema/aop/spring-aop-2.0.xsd=org/springframework/aop/config/spring-aop-2.0.xsd, http://www.springframework.org/schema/jee/spring-jee-3.0.xsd=org/springframework/ejb/config/spring-jee-3.0.xsd, http://www.springframework.org/schema/util/spring-util-4.1.xsd=org/springframework/beans/factory/xml/spring-util-4.1.xsd, http://www.springframework.org/schema/task/spring-task-3.1.xsd=org/springframework/scheduling/config/spring-task-3.1.xsd, http://www.springframework.org/schema/beans/spring-beans-3.0.xsd=org/springframework/beans/factory/xml/spring-beans-3.0.xsd, http://www.springframework.org/schema/jee/spring-jee.xsd=org/springframework/ejb/config/spring-jee-4.1.xsd, http://www.springframework.org/schema/aop/spring-aop-2.5.xsd=org/springframework/aop/config/spring-aop-2.5.xsd, http://www.springframework.org/schema/lang/spring-lang-2.0.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd, http://www.springframework.org/schema/util/spring-util-3.2.xsd=org/springframework/beans/factory/xml/spring-util-3.2.xsd, http://www.springframework.org/schema/task/spring-task.xsd=org/springframework/scheduling/config/spring-task-4.1.xsd, http://www.springframework.org/schema/tool/spring-tool-2.0.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd, http://www.springframework.org/schema/tx/spring-tx-3.0.xsd=org/springframework/transaction/config/spring-tx-3.0.xsd, http://www.springframework.org/schema/lang/spring-lang-2.5.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd, http://www.springframework.org/schema/jee/spring-jee-2.0.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd, http://www.springframework.org/schema/tool/spring-tool-2.5.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd, http://www.springframework.org/schema/jee/spring-jee-2.5.xsd=org/springframework/ejb/config/spring-jee-2.5.xsd, http://www.springframework.org/schema/util/spring-util-4.0.xsd=org/springframework/beans/factory/xml/spring-util-4.0.xsd, http://www.springframework.org/schema/task/spring-task-3.0.xsd=org/springframework/scheduling/config/spring-task-3.0.xsd, http://www.springframework.org/schema/lang/spring-lang.xsd=org/springframework/scripting/config/spring-lang-4.1.xsd, http://www.springframework.org/schema/context/spring-context-3.2.xsd=org/springframework/context/config/spring-context-3.2.xsd, http://www.springframework.org/schema/util/spring-util-3.1.xsd=org/springframework/beans/factory/xml/spring-util-3.1.xsd, http://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd, http://www.springframework.org/schema/cache/spring-cache.xsd=org/springframework/cache/config/spring-cache-4.1.xsd, http://www.springframework.org/schema/tx/spring-tx.xsd=org/springframework/transaction/config/spring-tx-4.1.xsd, http://www.springframework.org/schema/context/spring-context-4.1.xsd=org/springframework/context/config/spring-context-4.1.xsd, http://www.springframework.org/schema/beans/spring-beans-2.5.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd, http://www.springframework.org/schema/tx/spring-tx-2.0.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd=org/springframework/jdbc/config/spring-jdbc-3.2.xsd, http://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-4.1.xsd}
  2017-06-03 20:09:06,449 [main] DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] - Found XML schema [http://www.springframework.org/schema/beans/spring-beans-4.0.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-4.0.xsd
  2017-06-03 20:09:06,562 [main] DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] - Found XML schema [http://www.springframework.org/schema/context/spring-context-4.0.xsd] in classpath: org/springframework/context/config/spring-context-4.0.xsd
  2017-06-03 20:09:06,593 [main] DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] - Found XML schema [http://www.springframework.org/schema/tool/spring-tool-4.0.xsd] in classpath: org/springframework/beans/factory/xml/spring-tool-4.0.xsd
  2017-06-03 20:09:06,630 [main] DEBUG [org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader] - Loading bean definitions
  2017-06-03 20:09:06,799 [main] DEBUG [org.springframework.beans.factory.xml.BeanDefinitionParserDelegate] - Neither XML 'id' nor 'name' specified - using generated bean name [org.mybatis.spring.mapper.MapperScannerConfigurer#0]
  2017-06-03 20:09:06,884 [main] DEBUG [org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver] - Loaded NamespaceHandler mappings: {http://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler, http://www.springframework.org/schema/mvc=org.springframework.web.servlet.config.MvcNamespaceHandler, http://www.springframework.org/schema/util=org.springframework.beans.factory.xml.UtilNamespaceHandler, http://www.springframework.org/schema/jee=org.springframework.ejb.config.JeeNamespaceHandler, http://www.springframework.org/schema/aop=org.springframework.aop.config.AopNamespaceHandler, http://www.springframework.org/schema/jdbc=org.springframework.jdbc.config.JdbcNamespaceHandler, http://www.springframework.org/schema/cache=org.springframework.cache.config.CacheNamespaceHandler, http://mybatis.org/schema/mybatis-spring=org.mybatis.spring.config.NamespaceHandler, http://www.springframework.org/schema/c=org.springframework.beans.factory.xml.SimpleConstructorNamespaceHandler, http://www.springframework.org/schema/tx=org.springframework.transaction.config.TxNamespaceHandler, http://www.springframework.org/schema/task=org.springframework.scheduling.config.TaskNamespaceHandler, http://www.springframework.org/schema/lang=org.springframework.scripting.config.LangNamespaceHandler, http://www.springframework.org/schema/context=org.springframework.context.config.ContextNamespaceHandler}
  2017-06-03 20:09:07,050 [main] DEBUG [org.springframework.core.io.support.PathMatchingResourcePatternResolver] - Looking for matching resources in directory tree [D:\J2EE work\mavenSpring\target\test-classes\com\lin\service]
  2017-06-03 20:09:07,051 [main] DEBUG [org.springframework.core.io.support.PathMatchingResourcePatternResolver] - Searching directory [D:\J2EE work\mavenSpring\target\test-classes\com\lin\service] for files matching pattern [D:/J2EE work/mavenSpring/target/test-classes/com/lin/service/**/*.class]
  2017-06-03 20:09:07,055 [main] DEBUG [org.springframework.core.io.support.PathMatchingResourcePatternResolver] - Looking for matching resources in directory tree [D:\J2EE work\mavenSpring\target\classes\com\lin\service]
  2017-06-03 20:09:07,055 [main] DEBUG [org.springframework.core.io.support.PathMatchingResourcePatternResolver] - Searching directory [D:\J2EE work\mavenSpring\target\classes\com\lin\service] for files matching pattern [D:/J2EE work/mavenSpring/target/classes/com/lin/service/**/*.class]
  2017-06-03 20:09:07,056 [main] DEBUG [org.springframework.core.io.support.PathMatchingResourcePatternResolver] - Resolved location pattern [classpath*:com/lin/service/**/*.class] to resources [file [D:\J2EE work\mavenSpring\target\test-classes\com\lin\service\UserServiceTest.class], file [D:\J2EE work\mavenSpring\target\classes\com\lin\service\UserService.class], file [D:\J2EE work\mavenSpring\target\classes\com\lin\service\UserServiceImpl.class]]
  2017-06-03 20:09:07,081 [main] DEBUG [org.springframework.context.annotation.ClassPathBeanDefinitionScanner] - Identified candidate component class: file [D:\J2EE work\mavenSpring\target\classes\com\lin\service\UserServiceImpl.class]
  2017-06-03 20:09:07,163 [main] DEBUG [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loaded 9 bean definitions from location pattern [classpath:application.xml]
  2017-06-03 20:09:07,199 [main] INFO  [org.springframework.context.support.GenericApplicationContext] - Refreshing org.springframework.context.support.GenericApplicationContext@15975490: startup date [Sat Jun 03 20:09:07 CST 2017]; root of context hierarchy
  2017-06-03 20:09:07,199 [main] DEBUG [org.springframework.context.support.GenericApplicationContext] - Bean factory for org.springframework.context.support.GenericApplicationContext@15975490: org.springframework.beans.factory.support.DefaultListableBeanFactory@543e710e: defining beans [propertyConfigurer,dataSource,org.mybatis.spring.mapper.MapperScannerConfigurer#0,sqlSessionFactory,userServiceImpl,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor]; root of factory hierarchy
  2017-06-03 20:09:07,262 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
  2017-06-03 20:09:07,262 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
  2017-06-03 20:09:07,297 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor' to allow for resolving potential circular references
  2017-06-03 20:09:07,299 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
  2017-06-03 20:09:07,390 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'org.mybatis.spring.mapper.MapperScannerConfigurer#0'
  2017-06-03 20:09:07,390 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'org.mybatis.spring.mapper.MapperScannerConfigurer#0'
  2017-06-03 20:09:07,390 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' to allow for resolving potential circular references
  2017-06-03 20:09:07,612 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Invoking afterPropertiesSet() on bean with name 'org.mybatis.spring.mapper.MapperScannerConfigurer#0'
  2017-06-03 20:09:07,612 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'org.mybatis.spring.mapper.MapperScannerConfigurer#0'
  2017-06-03 20:09:07,615 [main] DEBUG [org.springframework.core.env.StandardEnvironment] - Adding [systemProperties] PropertySource with lowest search precedence
  2017-06-03 20:09:07,615 [main] DEBUG [org.springframework.core.env.StandardEnvironment] - Adding [systemEnvironment] PropertySource with lowest search precedence
  2017-06-03 20:09:07,615 [main] DEBUG [org.springframework.core.env.StandardEnvironment] - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]
  2017-06-03 20:09:07,616 [main] DEBUG [org.springframework.core.io.support.PathMatchingResourcePatternResolver] - Looking for matching resources in directory tree [D:\J2EE work\mavenSpring\target\classes\com\lin\dao]
  2017-06-03 20:09:07,617 [main] DEBUG [org.springframework.core.io.support.PathMatchingResourcePatternResolver] - Searching directory [D:\J2EE work\mavenSpring\target\classes\com\lin\dao] for files matching pattern [D:/J2EE work/mavenSpring/target/classes/com/lin/dao/**/*.class]
  2017-06-03 20:09:07,617 [main] DEBUG [org.springframework.core.io.support.PathMatchingResourcePatternResolver] - Resolved location pattern [classpath*:com/lin/dao/**/*.class] to resources [file [D:\J2EE work\mavenSpring\target\classes\com\lin\dao\UserDao.class]]
  2017-06-03 20:09:07,617 [main] DEBUG [org.mybatis.spring.mapper.ClassPathMapperScanner] - Identified candidate component class: file [D:\J2EE work\mavenSpring\target\classes\com\lin\dao\UserDao.class]
  2017-06-03 20:09:07,618 [main] DEBUG [org.mybatis.spring.mapper.ClassPathMapperScanner] - Creating MapperFactoryBean with name 'userDao' and 'com.lin.dao.UserDao' mapperInterface
  2017-06-03 20:09:07,619 [main] DEBUG [org.mybatis.spring.mapper.ClassPathMapperScanner] - Enabling autowire by type for MapperFactoryBean with name 'userDao'.
  2017-06-03 20:09:07,621 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'propertyConfigurer'
  2017-06-03 20:09:07,621 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'propertyConfigurer'
  2017-06-03 20:09:07,622 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'propertyConfigurer' to allow for resolving potential circular references
  2017-06-03 20:09:07,638 [main] DEBUG [org.springframework.core.io.support.PathMatchingResourcePatternResolver] - Looking for matching resources in directory tree [D:\J2EE work\mavenSpring\target\classes\properties]
  2017-06-03 20:09:07,638 [main] DEBUG [org.springframework.core.io.support.PathMatchingResourcePatternResolver] - Searching directory [D:\J2EE work\mavenSpring\target\classes\properties] for files matching pattern [D:/J2EE work/mavenSpring/target/classes/properties/*.properties]
  2017-06-03 20:09:07,639 [main] DEBUG [org.springframework.core.io.support.PathMatchingResourcePatternResolver] - Resolved location pattern [classpath:properties/*.properties] to resources [file [D:\J2EE work\mavenSpring\target\classes\properties\jdbc.properties]]
  2017-06-03 20:09:07,639 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'propertyConfigurer'
  2017-06-03 20:09:07,639 [main] INFO  [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer] - Loading properties file from file [D:\J2EE work\mavenSpring\target\classes\properties\jdbc.properties]
  2017-06-03 20:09:07,703 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'
  2017-06-03 20:09:07,703 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'
  2017-06-03 20:09:07,705 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor' to allow for resolving potential circular references
  2017-06-03 20:09:07,705 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'
  2017-06-03 20:09:07,705 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'
  2017-06-03 20:09:07,705 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'
  2017-06-03 20:09:07,706 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor' to allow for resolving potential circular references
  2017-06-03 20:09:07,706 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'
  2017-06-03 20:09:07,709 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'
  2017-06-03 20:09:07,709 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'
  2017-06-03 20:09:07,769 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor' to allow for resolving potential circular references
  2017-06-03 20:09:07,770 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'
  2017-06-03 20:09:07,770 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor'
  2017-06-03 20:09:07,771 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor'
  2017-06-03 20:09:07,771 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor' to allow for resolving potential circular references
  2017-06-03 20:09:07,771 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor'
  2017-06-03 20:09:07,771 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor'
  2017-06-03 20:09:07,771 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor'
  2017-06-03 20:09:07,772 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor' to allow for resolving potential circular references
  2017-06-03 20:09:07,772 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor'
  2017-06-03 20:09:07,851 [main] DEBUG [org.springframework.context.support.GenericApplicationContext] - Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@358ee631]
  2017-06-03 20:09:07,870 [main] DEBUG [org.springframework.context.support.GenericApplicationContext] - Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@3901d134]
  2017-06-03 20:09:07,910 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@543e710e: defining beans [propertyConfigurer,dataSource,org.mybatis.spring.mapper.MapperScannerConfigurer#0,sqlSessionFactory,userServiceImpl,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor,userDao]; root of factory hierarchy
  2017-06-03 20:09:07,910 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'propertyConfigurer'
  2017-06-03 20:09:07,910 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'dataSource'
  2017-06-03 20:09:07,910 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'dataSource'
  2017-06-03 20:09:08,008 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'dataSource' to allow for resolving potential circular references
  2017-06-03 20:09:08,079 [main] INFO  [org.springframework.jdbc.datasource.DriverManagerDataSource] - Loaded JDBC driver: com.mysql.jdbc.Driver
  2017-06-03 20:09:08,080 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'dataSource'
  2017-06-03 20:09:08,080 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'org.mybatis.spring.mapper.MapperScannerConfigurer#0'
  2017-06-03 20:09:08,081 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'sqlSessionFactory'
  2017-06-03 20:09:08,081 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'sqlSessionFactory'
  2017-06-03 20:09:08,121 [main] DEBUG [org.apache.ibatis.logging.LogFactory] - Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter.
  2017-06-03 20:09:08,206 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'sqlSessionFactory' to allow for resolving potential circular references
  2017-06-03 20:09:08,215 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'dataSource'
  2017-06-03 20:09:08,216 [main] DEBUG [org.springframework.core.io.support.PathMatchingResourcePatternResolver] - Looking for matching resources in directory tree [D:\J2EE work\mavenSpring\target\classes\com\lin\mapper]
  2017-06-03 20:09:08,217 [main] DEBUG [org.springframework.core.io.support.PathMatchingResourcePatternResolver] - Searching directory [D:\J2EE work\mavenSpring\target\classes\com\lin\mapper] for files matching pattern [D:/J2EE work/mavenSpring/target/classes/com/lin/mapper/**/*.xml]
  2017-06-03 20:09:08,223 [main] DEBUG [org.springframework.core.io.support.PathMatchingResourcePatternResolver] - Resolved location pattern [classpath*:com/lin/mapper/**/*.xml] to resources [file [D:\J2EE work\mavenSpring\target\classes\com\lin\mapper\UserMapper.xml]]
  2017-06-03 20:09:08,225 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Invoking afterPropertiesSet() on bean with name 'sqlSessionFactory'
  2017-06-03 20:09:08,514 [main] DEBUG [org.mybatis.spring.SqlSessionFactoryBean] - Parsed configuration file: 'class path resource [mybatis/mybatis-config.xml]'
  2017-06-03 20:09:08,516 [main] DEBUG [org.springframework.jdbc.datasource.DriverManagerDataSource] - Creating new JDBC DriverManager Connection to [jdbc:mysql://localhost:3306/lxlbase]
  2017-06-03 20:09:09,591 [main] DEBUG [org.mybatis.spring.SqlSessionFactoryBean] - Parsed mapper file: 'file [D:\J2EE work\mavenSpring\target\classes\com\lin\mapper\UserMapper.xml]'
  2017-06-03 20:09:09,592 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'sqlSessionFactory'
  2017-06-03 20:09:09,593 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'userServiceImpl'
  2017-06-03 20:09:09,593 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'userServiceImpl'
  2017-06-03 20:09:09,595 [main] DEBUG [org.springframework.beans.factory.annotation.InjectionMetadata] - Registered injected element on class [com.lin.service.UserServiceImpl]: AutowiredFieldElement for private com.lin.dao.UserDao com.lin.service.UserServiceImpl.userDao
  2017-06-03 20:09:09,595 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'userServiceImpl' to allow for resolving potential circular references
  2017-06-03 20:09:09,597 [main] DEBUG [org.springframework.beans.factory.annotation.InjectionMetadata] - Processing injected element of bean 'userServiceImpl': AutowiredFieldElement for private com.lin.dao.UserDao com.lin.service.UserServiceImpl.userDao
  2017-06-03 20:09:09,599 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'userDao'
  2017-06-03 20:09:09,599 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'userDao'
  2017-06-03 20:09:09,600 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'userDao' to allow for resolving potential circular references
  2017-06-03 20:09:09,617 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning eagerly cached instance of singleton bean 'userDao' that is not fully initialized yet - a consequence of a circular reference
  2017-06-03 20:09:09,618 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'sqlSessionFactory'
  2017-06-03 20:09:09,618 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Autowiring by type from bean name 'userDao' via property 'sqlSessionFactory' to bean named 'sqlSessionFactory'
  2017-06-03 20:09:09,629 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Invoking afterPropertiesSet() on bean with name 'userDao'
  2017-06-03 20:09:09,629 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'userDao'
  2017-06-03 20:09:09,630 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'userDao'
  2017-06-03 20:09:09,633 [main] DEBUG [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor] - Autowiring by type from bean name 'userServiceImpl' to bean named 'userDao'
  2017-06-03 20:09:09,633 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'userServiceImpl'
  2017-06-03 20:09:09,634 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
  2017-06-03 20:09:09,634 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'
  2017-06-03 20:09:09,634 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'
  2017-06-03 20:09:09,634 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'
  2017-06-03 20:09:09,634 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor'
  2017-06-03 20:09:09,634 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor'
  2017-06-03 20:09:09,635 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'userDao'
  2017-06-03 20:09:09,649 [main] DEBUG [org.springframework.context.support.GenericApplicationContext] - Unable to locate LifecycleProcessor with name 'lifecycleProcessor': using default [org.springframework.context.support.DefaultLifecycleProcessor@11fc564b]
  2017-06-03 20:09:09,650 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'lifecycleProcessor'
  2017-06-03 20:09:09,716 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'sqlSessionFactory'
  2017-06-03 20:09:09,780 [main] DEBUG [org.springframework.core.env.PropertySourcesPropertyResolver] - Searching for key 'spring.liveBeansView.mbeanDomain' in [systemProperties]
  2017-06-03 20:09:09,780 [main] DEBUG [org.springframework.core.env.PropertySourcesPropertyResolver] - Searching for key 'spring.liveBeansView.mbeanDomain' in [systemEnvironment]
  2017-06-03 20:09:09,780 [main] DEBUG [org.springframework.core.env.PropertySourcesPropertyResolver] - Could not find key 'spring.liveBeansView.mbeanDomain' in any property source. Returning [null]
  2017-06-03 20:09:09,812 [main] DEBUG [org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate] - Storing ApplicationContext in cache under key [[MergedContextConfiguration@2f7a2457 testClass = UserServiceTest, locations = '{classpath:application.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]
  2017-06-03 20:09:09,812 [main] DEBUG [org.springframework.test.context.cache] - Spring test ApplicationContext cache statistics: [ContextCache@55740540 size = 1, hitCount = 0, missCount = 1, parentContextCount = 0]
  2017-06-03 20:09:09,816 [main] DEBUG [org.springframework.beans.factory.annotation.InjectionMetadata] - Processing injected element of bean 'com.lin.service.UserServiceTest': AutowiredFieldElement for private com.lin.service.UserService com.lin.service.UserServiceTest.userService
  2017-06-03 20:09:09,859 [main] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'userServiceImpl'
  2017-06-03 20:09:09,859 [main] DEBUG [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor] - Autowiring by type from bean name 'com.lin.service.UserServiceTest' to bean named 'userServiceImpl'
  2017-06-03 20:09:09,903 [main] DEBUG [org.mybatis.spring.SqlSessionUtils] - Creating a new SqlSession
  2017-06-03 20:09:10,128 [main] DEBUG [org.mybatis.spring.SqlSessionUtils] - SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@44a7bfbc] was not registered for synchronization because synchronization is not active
  2017-06-03 20:09:10,354 [main] DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] - Fetching JDBC Connection from DataSource
  2017-06-03 20:09:10,354 [main] DEBUG [org.springframework.jdbc.datasource.DriverManagerDataSource] - Creating new JDBC DriverManager Connection to [jdbc:mysql://localhost:3306/lxlbase]
  2017-06-03 20:09:10,434 [main] DEBUG [org.mybatis.spring.transaction.SpringManagedTransaction] - JDBC Connection [com.mysql.jdbc.JDBC4Connection@2df9b86] will not be managed by Spring
  2017-06-03 20:09:10,437 [main] DEBUG [com.lin.dao.UserDao.selectUserById] - ooo Using Connection [com.mysql.jdbc.JDBC4Connection@2df9b86]
  2017-06-03 20:09:10,459 [main] DEBUG [com.lin.dao.UserDao.selectUserById] - ==>  Preparing: SELECT * FROM t_user WHERE USER_ID = ? 
  2017-06-03 20:09:10,599 [main] DEBUG [com.lin.dao.UserDao.selectUserById] - ==> Parameters: 1(Integer)

  2017-06-03 20:09:11,615 [main] DEBUG [org.mybatis.spring.SqlSessionUtils] - Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@44a7bfbc]
  2017-06-03 20:09:11,615 [main] DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] - Returning JDBC Connection to DataSource
  2017-06-03 20:09:11,616 [main] DEBUG [com.lin.service.UserServiceTest] - 查找结果User [userId=1, userName=JACK, userPassword=1234, userEmail=JACK@.COM]
  2017-06-03 20:09:11,616 [main] DEBUG [org.springframework.test.context.support.DirtiesContextTestExecutionListener] - After test method: context
 [DefaultTestContext@7f690630 testClass = UserServiceTest, testInstance = com.lin.service.UserServiceTest@edf4efb, testMethod = selectUserByIdTest@UserServiceTest, testException = [null], mergedContextConfiguration = [MergedContextConfiguration@2f7a2457 testClass = UserServiceTest, locations = '{classpath:application.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]], class dirties context [false], class mode [null], method dirties context [false].
  2017-06-03 20:09:11,617 [main] DEBUG [org.springframework.test.context.support.DirtiesContextTestExecutionListener] - After test class: context [DefaultTestContext@7f690630 testClass = UserServiceTest, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [MergedContextConfiguration@2f7a2457 testClass = UserServiceTest, locations = '{classpath:application.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]], dirtiesContext [false].
  2017-06-03 20:09:11,668 [Thread-0] INFO  [org.springframework.context.support.GenericApplicationContext] - Closing org.springframework.context.support.GenericApplicationContext@15975490: startup date [Sat Jun 03 20:09:07 CST 2017]; root of context hierarchy
  2017-06-03 20:09:11,669 [Thread-0] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'sqlSessionFactory'
  2017-06-03 20:09:11,669 [Thread-0] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'lifecycleProcessor'
  2017-06-03 20:09:11,669 [Thread-0] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@543e710e: defining beans [propertyConfigurer,dataSource,org.mybatis.spring.mapper.MapperScannerConfigurer#0,sqlSessionFactory,userServiceImpl,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor,userDao]; root of factory hierarchy
  2017-06-03 20:09:11,670 [Thread-0] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Retrieved dependent beans for bean 'userServiceImpl': [com.lin.service.UserServiceTest]
  

结果是正确的:数据库数据如下

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值