-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #475 from YangSen-qn/http3
Http3
- Loading branch information
Showing
25 changed files
with
694 additions
and
184 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 3 additions & 9 deletions
12
library/src/androidTest/java/com/qiniu/android/BaseTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
library/src/androidTest/java/com/qiniu/android/serverRegion/HttpServerManagerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.qiniu.android.serverRegion; | ||
|
||
import com.qiniu.android.BaseTest; | ||
import com.qiniu.android.http.serverRegion.HttpServerManager; | ||
|
||
public class HttpServerManagerTest extends BaseTest { | ||
|
||
public void testServer() { | ||
String host = "up.qiniu.com"; | ||
String ip = "192.168.1.1"; | ||
int duration = 10; | ||
HttpServerManager manager = HttpServerManager.getInstance(); | ||
assertFalse("null host and ip add success", manager.addHttp3Server(null, null, duration)); | ||
assertFalse("null host add success", manager.addHttp3Server(null, ip, duration)); | ||
assertFalse("null ip add success", manager.addHttp3Server(host, null, duration)); | ||
assertFalse("empty host and ip add success", manager.addHttp3Server("", "", duration)); | ||
assertFalse("empty host add success", manager.addHttp3Server("", ip, duration)); | ||
assertFalse("empty ip add success", manager.addHttp3Server(host, "", duration)); | ||
assertFalse("liveDuration < 0 add success", manager.addHttp3Server(host, ip, -1)); | ||
|
||
manager.addHttp3Server(host, ip, duration); | ||
assertTrue("host ip should support", manager.isServerSupportHttp3(host, ip)); | ||
|
||
assertFalse("null host and ip should not support", manager.isServerSupportHttp3(null, null)); | ||
assertFalse("null host should not support", manager.isServerSupportHttp3(null, ip)); | ||
assertFalse("null ip should not support", manager.isServerSupportHttp3(host, null)); | ||
|
||
assertFalse("empty host and ip should not support", manager.isServerSupportHttp3("", "")); | ||
assertFalse("empty host should not support", manager.isServerSupportHttp3("", ip)); | ||
assertFalse("empty ip should not support", manager.isServerSupportHttp3(host, "ip")); | ||
|
||
assertFalse("no exist host and ip should not support", manager.isServerSupportHttp3("host", "ip")); | ||
assertFalse("no exist hos should not support", manager.isServerSupportHttp3("host", ip)); | ||
assertFalse("no exist ip should not support", manager.isServerSupportHttp3(host, "ip")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.