mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix test
This commit is contained in:
parent
cefe1311ad
commit
aaee713fad
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
### 新特性
|
### 新特性
|
||||||
* 【http 】 UserAgentUtil增加识别ios和android等(issue#781@Github)
|
* 【http 】 UserAgentUtil增加识别ios和android等(issue#781@Github)
|
||||||
|
* 【core 】 支持新领车牌(issue#I1BJHE@Gitee)
|
||||||
|
|
||||||
### Bug修复
|
### Bug修复
|
||||||
* 【core 】 修复PageUtil第一页语义不明确的问题(issue#782@Github)
|
* 【core 】 修复PageUtil第一页语义不明确的问题(issue#782@Github)
|
||||||
|
@ -61,6 +61,8 @@ public class PatternPool {
|
|||||||
public final static Pattern PLATE_NUMBER = Pattern.compile(
|
public final static Pattern PLATE_NUMBER = Pattern.compile(
|
||||||
//https://gitee.com/loolly/hutool/issues/I1B77H?from=project-issue
|
//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})))|" +
|
"^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][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挂学警港澳使领]))$");
|
"([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$");
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -134,5 +134,6 @@ public class ValidatorTest {
|
|||||||
@Test
|
@Test
|
||||||
public void isPlateNumberTest(){
|
public void isPlateNumberTest(){
|
||||||
Assert.assertTrue(Validator.isPlateNumber("粤BA03205"));
|
Assert.assertTrue(Validator.isPlateNumber("粤BA03205"));
|
||||||
|
Assert.assertTrue(Validator.isPlateNumber("闽20401领"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,11 +12,11 @@ public class PageUtilTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void transToStartEndTest(){
|
public void transToStartEndTest(){
|
||||||
int[] startEnd1 = PageUtil.transToStartEnd(1, 10);
|
int[] startEnd1 = PageUtil.transToStartEnd(0, 10);
|
||||||
Assert.assertEquals(0, startEnd1[0]);
|
Assert.assertEquals(0, startEnd1[0]);
|
||||||
Assert.assertEquals(10, startEnd1[1]);
|
Assert.assertEquals(10, startEnd1[1]);
|
||||||
|
|
||||||
int[] startEnd2 = PageUtil.transToStartEnd(2, 10);
|
int[] startEnd2 = PageUtil.transToStartEnd(1, 10);
|
||||||
Assert.assertEquals(10, startEnd2[0]);
|
Assert.assertEquals(10, startEnd2[0]);
|
||||||
Assert.assertEquals(20, startEnd2[1]);
|
Assert.assertEquals(20, startEnd2[1]);
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,14 @@
|
|||||||
package cn.hutool.db;
|
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.Assert;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import cn.hutool.core.lang.Console;
|
import java.sql.SQLException;
|
||||||
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;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Oracle操作单元测试
|
* Oracle操作单元测试
|
||||||
@ -25,7 +20,7 @@ public class OracleTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void oraclePageSqlTest() {
|
public void oraclePageSqlTest() {
|
||||||
Page page = new Page(1, 10);
|
Page page = new Page(0, 10);
|
||||||
Entity where = Entity.create("PMCPERFORMANCEINFO").set("yearPI", "2017");
|
Entity where = Entity.create("PMCPERFORMANCEINFO").set("yearPI", "2017");
|
||||||
final Query query = new Query(SqlUtil.buildConditions(where), where.getTableName());
|
final Query query = new Query(SqlUtil.buildConditions(where), where.getTableName());
|
||||||
query.setPage(page);
|
query.setPage(page);
|
||||||
|
@ -49,11 +49,11 @@ public class Platform extends UserAgentInfo {
|
|||||||
* 支持的移动平台类型
|
* 支持的移动平台类型
|
||||||
*/
|
*/
|
||||||
public static final List<Platform> mobilePlatforms = CollUtil.newArrayList(//
|
public static final List<Platform> mobilePlatforms = CollUtil.newArrayList(//
|
||||||
|
WINDOWS_PHONE, //
|
||||||
IPAD, //
|
IPAD, //
|
||||||
IPOD, //
|
IPOD, //
|
||||||
IPHONE, //
|
IPHONE, //
|
||||||
ANDROID, //
|
ANDROID, //
|
||||||
WINDOWS_PHONE, //
|
|
||||||
GOOGLE_TV, //
|
GOOGLE_TV, //
|
||||||
new Platform("htcFlyer", "htc_flyer"), //
|
new Platform("htcFlyer", "htc_flyer"), //
|
||||||
new Platform("Symbian", "symbian(os)?"), //
|
new Platform("Symbian", "symbian(os)?"), //
|
||||||
|
@ -110,6 +110,7 @@ public class UserAgentUtilTest {
|
|||||||
Assert.assertEquals("Windows", ua.getPlatform().toString());
|
Assert.assertEquals("Windows", ua.getPlatform().toString());
|
||||||
Assert.assertFalse(ua.isMobile());
|
Assert.assertFalse(ua.isMobile());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void parseEdgeOnLumia950XLTest() {
|
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";
|
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";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user