This commit is contained in:
Looly 2020-03-13 17:47:57 +08:00
parent cefe1311ad
commit aaee713fad
7 changed files with 104 additions and 104 deletions

View File

@ -7,6 +7,7 @@
### 新特性
* 【http 】 UserAgentUtil增加识别ios和android等issue#781@Github
* 【core 】 支持新领车牌issue#I1BJHE@Gitee
### Bug修复
* 【core 】 修复PageUtil第一页语义不明确的问题issue#782@Github

View File

@ -61,6 +61,8 @@ public class PatternPool {
public final static Pattern PLATE_NUMBER = Pattern.compile(
//https://gitee.com/loolly/hutool/issues/I1B77H?from=project-issue
"^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[ABCDEFGHJK])|([ABCDEFGHJK]([A-HJ-NP-Z0-9])[0-9]{4})))|" +
//https://gitee.com/loolly/hutool/issues/I1BJHE?from=project-issue
"([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领]\\d{3}\\d{1,3}[领])|" +
"([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$");
// -------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -134,5 +134,6 @@ public class ValidatorTest {
@Test
public void isPlateNumberTest(){
Assert.assertTrue(Validator.isPlateNumber("粤BA03205"));
Assert.assertTrue(Validator.isPlateNumber("闽20401领"));
}
}

View File

@ -12,11 +12,11 @@ public class PageUtilTest {
@Test
public void transToStartEndTest(){
int[] startEnd1 = PageUtil.transToStartEnd(1, 10);
int[] startEnd1 = PageUtil.transToStartEnd(0, 10);
Assert.assertEquals(0, startEnd1[0]);
Assert.assertEquals(10, startEnd1[1]);
int[] startEnd2 = PageUtil.transToStartEnd(2, 10);
int[] startEnd2 = PageUtil.transToStartEnd(1, 10);
Assert.assertEquals(10, startEnd2[0]);
Assert.assertEquals(20, startEnd2[1]);
}

View File

@ -1,19 +1,14 @@
package cn.hutool.db;
import java.sql.SQLException;
import cn.hutool.core.lang.Console;
import cn.hutool.db.sql.Query;
import cn.hutool.db.sql.SqlBuilder;
import cn.hutool.db.sql.SqlUtil;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import cn.hutool.core.lang.Console;
import cn.hutool.db.Db;
import cn.hutool.db.Entity;
import cn.hutool.db.Page;
import cn.hutool.db.PageResult;
import cn.hutool.db.sql.Query;
import cn.hutool.db.sql.SqlBuilder;
import cn.hutool.db.sql.SqlUtil;
import java.sql.SQLException;
/**
* Oracle操作单元测试
@ -25,7 +20,7 @@ public class OracleTest {
@Test
public void oraclePageSqlTest() {
Page page = new Page(1, 10);
Page page = new Page(0, 10);
Entity where = Entity.create("PMCPERFORMANCEINFO").set("yearPI", "2017");
final Query query = new Query(SqlUtil.buildConditions(where), where.getTableName());
query.setPage(page);

View File

@ -49,11 +49,11 @@ public class Platform extends UserAgentInfo {
* 支持的移动平台类型
*/
public static final List<Platform> mobilePlatforms = CollUtil.newArrayList(//
WINDOWS_PHONE, //
IPAD, //
IPOD, //
IPHONE, //
ANDROID, //
WINDOWS_PHONE, //
GOOGLE_TV, //
new Platform("htcFlyer", "htc_flyer"), //
new Platform("Symbian", "symbian(os)?"), //

View File

@ -110,6 +110,7 @@ public class UserAgentUtilTest {
Assert.assertEquals("Windows", ua.getPlatform().toString());
Assert.assertFalse(ua.isMobile());
}
@Test
public void parseEdgeOnLumia950XLTest() {
String uaStr = "Mozilla/5.0 (Windows Phone 10.0; Android 6.0.1; Microsoft; Lumia 950XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Mobile Safari/537.36 Edge/15.14900";