Kaynağa Gözat

绿了一大片,睡觉.

聂秋秋 7 yıl önce
ebeveyn
işleme
5dc98f09d4

+ 1 - 1
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/toolkit/TableInfoHelper.java

@@ -85,7 +85,7 @@ public class TableInfoHelper {
         }
         }
         if (null == tableInfo) {
         if (null == tableInfo) {
             //找不到了,我也很绝望呀
             //找不到了,我也很绝望呀
-            logger.warn(ClassUtils.getUserClass(clazz).getName() + "Not Found TableInfoCache.");
+            logger.warn(ClassUtils.getUserClass(clazz).getName() + " Not Found TableInfoCache.");
         } else {
         } else {
             TABLE_INFO_CACHE.put(ClassUtils.getUserClass(clazz).getName(), tableInfo);
             TABLE_INFO_CACHE.put(ClassUtils.getUserClass(clazz).getName(), tableInfo);
         }
         }

+ 12 - 9
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/h2/ActiveRecordTest.java

@@ -7,8 +7,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.test.h2.entity.persistent.H2Student;
 import com.baomidou.mybatisplus.test.h2.entity.persistent.H2Student;
 import com.baomidou.mybatisplus.test.h2.service.IH2StudentService;
 import com.baomidou.mybatisplus.test.h2.service.IH2StudentService;
 import org.junit.Assert;
 import org.junit.Assert;
+import org.junit.FixMethodOrder;
 import org.junit.Test;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runner.RunWith;
+import org.junit.runners.MethodSorters;
 import org.mockito.internal.matchers.GreaterThan;
 import org.mockito.internal.matchers.GreaterThan;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
@@ -23,6 +25,7 @@ import java.util.List;
  *  ActiveRecord 测试
  *  ActiveRecord 测试
  * @author nieqiurong 2018/7/27.
  * @author nieqiurong 2018/7/27.
  */
  */
+@FixMethodOrder(MethodSorters.JVM)
 @RunWith(SpringJUnit4ClassRunner.class)
 @RunWith(SpringJUnit4ClassRunner.class)
 @ContextConfiguration(locations = {"classpath:h2/spring-test-h2.xml"})
 @ContextConfiguration(locations = {"classpath:h2/spring-test-h2.xml"})
 public class ActiveRecordTest {
 public class ActiveRecordTest {
@@ -56,15 +59,6 @@ public class ActiveRecordTest {
         Assert.assertNotNull(student.selectById(1L));
         Assert.assertNotNull(student.selectById(1L));
     }
     }
 
 
-    @Test
-    public void testDelete(){
-        H2Student student = new H2Student();
-        student.setId(2L);
-        Assert.assertTrue(student.deleteById());
-        Assert.assertTrue(student.deleteById(12L));
-        Assert.assertTrue(student.delete(new QueryWrapper<>().gt("id",10)));
-    }
-
     @Test
     @Test
     public void testSelectList(){
     public void testSelectList(){
         H2Student student = new H2Student();
         H2Student student = new H2Student();
@@ -123,4 +117,13 @@ public class ActiveRecordTest {
             Assert.assertTrue(CollectionUtils.isEmpty(students));
             Assert.assertTrue(CollectionUtils.isEmpty(students));
         }
         }
     }
     }
+    
+    @Test
+    public void testDelete(){
+        H2Student student = new H2Student();
+        student.setId(2L);
+        Assert.assertTrue(student.deleteById());
+        Assert.assertTrue(student.deleteById(12L));
+        Assert.assertTrue(student.delete(new QueryWrapper<>().gt("id",10)));
+    }
 }
 }

+ 0 - 5
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/h2/config/MybatisPlusConfig.java

@@ -72,9 +72,4 @@ public class MybatisPlusConfig {
             .setIdType(IdType.ID_WORKER));
             .setIdType(IdType.ID_WORKER));
         return conf;
         return conf;
     }
     }
-
-    @Bean
-    public SqlSessionTemplate sqlSessionTemplate(SqlSessionFactory sqlSessionFactory){
-        return new SqlSessionTemplate(sqlSessionFactory, ExecutorType.BATCH);
-    }
 }
 }