Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ android:
- tools

# The BuildTools version used by your project
- build-tools-22.0.1
- build-tools-23.0.1

# The SDK version used to compile your project
- android-22
- android-23

# Specify at least one system image
# if you need to run emulator(s) during your tests
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#Changelog

## 7.0.8 (2015-10-09)

### 调整
* android-async-http 最低版本要求 1.4.9, 为了兼容 Android 6.0 感谢 Haoxiqiang
* 升级SDK环境
* 默认http port 为80
* 首选dns server 改为 119.29.29.29

## 7.0.7.1 (2015-08-05)

### 修正
Expand Down
8 changes: 4 additions & 4 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ String version = versionName()
int code = versionNameToCode(version)

android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
compileSdkVersion 23
buildToolsVersion '23.0.1'
defaultConfig {
//applicationId "com.qiniu.android"
minSdkVersion 8
targetSdkVersion 22
minSdkVersion 9
targetSdkVersion 23
versionCode code
versionName version
}
Expand Down
13 changes: 9 additions & 4 deletions library/library.iml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
Expand All @@ -65,6 +65,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/docs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
Expand All @@ -84,13 +85,17 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/libs" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/poms" />
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
<excludeFolder url="file://$MODULE_DIR$/build/test-results" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="android-async-http-1.4.8" level="project" />
<orderEntry type="library" exported="" name="happy-dns-0.2.1" level="project" />
<orderEntry type="library" exported="" name="httpclient-4.3.6" level="project" />
<orderEntry type="library" exported="" name="android-async-http-1.4.9" level="project" />
</component>
</module>
36 changes: 9 additions & 27 deletions library/src/androidTest/java/com/qiniu/android/CancelTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class CancelTest extends InstrumentationTestCase {
private volatile boolean failed;
private volatile UploadManager uploadManager;
private volatile String key;
private volatile ResponseInfo info;
private volatile ResponseInfo info = null;
private volatile JSONObject resp;
private volatile UploadOptions options;

Expand Down Expand Up @@ -133,22 +133,13 @@ public void complete(String k, ResponseInfo rinfo, JSONObject response) {

try {
signal.await(570, TimeUnit.SECONDS); // wait for callback
Assert.assertNotNull("timeout", info);
} catch (InterruptedException e) {
e.printStackTrace();
}
// 尝试获取info信息。
// key == null : 没进入 complete ? 什么导致的?
if (!expectKey.equals(key)) {
//此处通不过, travis 会打印信息
Assert.assertEquals("", info);
}
if (info == null || !info.isCancelled()) {
//此处通不过, travis 会打印信息
Assert.assertEquals("", info);
}
Assert.assertEquals(expectKey, key);
Assert.assertFalse(info.isOK());
Assert.assertTrue(info.isCancelled());

Assert.assertEquals(info.toString(), expectKey, key);
Assert.assertTrue(info.toString(), info.isCancelled());
Assert.assertNull(resp);

TempFile.remove(tempFile);
Expand Down Expand Up @@ -206,22 +197,13 @@ public void complete(String k, ResponseInfo rinfo, JSONObject response) {

try {
signal.await(570, TimeUnit.SECONDS); // wait for callback
Assert.assertNotNull("timeout", info);
} catch (InterruptedException e) {
e.printStackTrace();
}
// 尝试获取info信息。
// key == null : 没进入 complete ? 什么导致的?
if (!expectKey.equals(key)) {
//此处通不过, travis 会打印信息
Assert.assertEquals("", info);
}
if (info == null || !info.isCancelled()) {
//此处通不过, travis 会打印信息
Assert.assertEquals("", info);
}
Assert.assertEquals(expectKey, key);
Assert.assertFalse(info.isOK());
Assert.assertTrue(info.isCancelled());

Assert.assertEquals(info.toString(), expectKey, key);
Assert.assertTrue(info.toString(), info.isCancelled());
Assert.assertNull(resp);
}

Expand Down
112 changes: 37 additions & 75 deletions library/src/androidTest/java/com/qiniu/android/FormUploadTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,12 @@ public void complete(String k, ResponseInfo rinfo, JSONObject response) {

try {
signal.await(120, TimeUnit.SECONDS); // wait for callback
Assert.assertNotNull("timeout", info);
} catch (InterruptedException e) {
e.printStackTrace();
}
// 尝试获取info信息。
// key == null : 没进入 complete ? 什么导致的?
if (!expectKey.equals(key)) {
//此处通不过, travis 会打印信息
Assert.assertEquals("", info);
}
if (info == null || !info.isOK()) {
//此处通不过, travis 会打印信息
Assert.assertEquals("", info);
}
Assert.assertEquals(expectKey, key);
Assert.assertTrue(info.isOK());
Assert.assertEquals(info.toString(), expectKey, key);
Assert.assertTrue(info.toString(), info.isOK());
Assert.assertNotNull(info.reqId);
Assert.assertNotNull(resp);
Assert.assertEquals("/", info.path);
Expand Down Expand Up @@ -95,17 +86,14 @@ public void complete(String k, ResponseInfo rinfo, JSONObject response) {

try {
signal.await(120, TimeUnit.SECONDS); // wait for callback
Assert.assertNotNull("timeout", info);
} catch (InterruptedException e) {
e.printStackTrace();
}

// 尝试获取info信息。
if (info == null || !info.isOK()) {
//此处通不过, travis 会打印信息
Assert.assertEquals("", info);
}
Assert.assertEquals(expectKey, key);
Assert.assertTrue(info.isOK());
Assert.assertEquals(info.toString(), expectKey, key);
Assert.assertTrue(info.toString(), info.isOK());

Assert.assertNotNull(info.reqId);
Assert.assertEquals("/", info.path);
Assert.assertNotNull(resp);
Expand All @@ -131,11 +119,12 @@ public void complete(String k, ResponseInfo rinfo, JSONObject response) {

try {
signal.await(120, TimeUnit.SECONDS); // wait for callback
Assert.assertNotNull("timeout", info);
} catch (InterruptedException e) {
e.printStackTrace();
}
Assert.assertEquals(expectKey, key);
Assert.assertEquals(ResponseInfo.InvalidToken, info.statusCode);
Assert.assertEquals(info.toString(), expectKey, key);
Assert.assertEquals(info.toString(), ResponseInfo.InvalidToken, info.statusCode);
Assert.assertNotNull(info.reqId);
Assert.assertNull(resp);
}
Expand All @@ -157,11 +146,13 @@ public void complete(String k, ResponseInfo rinfo, JSONObject response) {

try {
signal.await(120, TimeUnit.SECONDS); // wait for callback
assertNotNull("timeout", info);
} catch (InterruptedException e) {
e.printStackTrace();
}
Assert.assertEquals(expectKey, key);
Assert.assertEquals(ResponseInfo.InvalidArgument, info.statusCode);
Assert.assertEquals(info.toString(), expectKey, key);
Assert.assertEquals(info.toString(), ResponseInfo.InvalidArgument,
info.statusCode);
Assert.assertNull(resp);
}

Expand All @@ -184,11 +175,12 @@ public void complete(String k, ResponseInfo rinfo, JSONObject response) {

try {
signal.await(120, TimeUnit.SECONDS); // wait for callback
Assert.assertNotNull("timeout", info);
} catch (InterruptedException e) {
e.printStackTrace();
}
Assert.assertEquals(expectKey, key);
Assert.assertEquals(ResponseInfo.InvalidArgument, info.statusCode);
Assert.assertEquals(info.toString(), expectKey, key);
Assert.assertEquals(info.toString(), ResponseInfo.InvalidArgument, info.statusCode);
Assert.assertNull(resp);
}

Expand All @@ -211,11 +203,13 @@ public void complete(String k, ResponseInfo rinfo, JSONObject response) {

try {
signal.await(120, TimeUnit.SECONDS); // wait for callback
Assert.assertNotNull("timeout", info);
} catch (InterruptedException e) {
e.printStackTrace();
}
Assert.assertEquals(expectKey, key);
Assert.assertEquals(ResponseInfo.InvalidArgument, info.statusCode);
Assert.assertEquals(info.toString(), expectKey, key);
Assert.assertEquals(info.toString(), ResponseInfo.InvalidArgument,
info.statusCode);
Assert.assertNull(resp);
}

Expand All @@ -238,21 +232,13 @@ public void complete(String k, ResponseInfo rinfo, JSONObject response) {

try {
signal.await(130, TimeUnit.SECONDS); // wait for callback
Assert.assertNotNull("timeout", info);
} catch (InterruptedException e) {
e.printStackTrace();
}
// 尝试获取info信息。
// key == null : 没进入 complete ? 什么导致的?
if (!expectKey.equals(key)) {
//此处通不过, travis 会打印信息
Assert.assertEquals("", info);
}
if (info == null || !info.isOK()) {
//此处通不过, travis 会打印信息
Assert.assertEquals("", info);
}
Assert.assertEquals(expectKey, key);
Assert.assertTrue(info.isOK());

Assert.assertEquals(info.toString(), expectKey, key);
Assert.assertTrue(info.toString(), info.isOK());
Assert.assertNotNull(info.reqId);
Assert.assertNotNull(resp);
TempFile.remove(f);
Expand Down Expand Up @@ -306,21 +292,13 @@ public void complete(String k, ResponseInfo rinfo, JSONObject response) {

try {
signal.await(120, TimeUnit.SECONDS); // wait for callback
Assert.assertNotNull("timeout", info);
} catch (InterruptedException e) {
e.printStackTrace();
}
// 尝试获取info信息。
// key == null : 没进入 complete ? 什么导致的?
if (!expectKey.equals(key)) {
//此处通不过, travis 会打印信息
Assert.assertEquals("", info);
}
if (info == null || !info.isOK()) {
//此处通不过, travis 会打印信息
Assert.assertEquals("", info);
}
Assert.assertEquals(expectKey, key);
Assert.assertTrue(info.isOK());

Assert.assertEquals(info.toString(), expectKey, key);
Assert.assertTrue(info.toString(), info.isOK());
Assert.assertNotNull(info.reqId);
Assert.assertNotNull(resp);
}
Expand Down Expand Up @@ -350,21 +328,13 @@ public void complete(String k, ResponseInfo rinfo, JSONObject response) {

try {
signal.await(120, TimeUnit.SECONDS); // wait for callback
Assert.assertNotNull("timeout", info);
} catch (InterruptedException e) {
e.printStackTrace();
}
// 尝试获取info信息。
// key == null : 没进入 complete ? 什么导致的?
if (!expectKey.equals(key)) {
//此处通不过, travis 会打印信息
Assert.assertEquals("", info);
}
if (info == null || !info.isOK()) {
//此处通不过, travis 会打印信息
Assert.assertEquals("", info);
}
Assert.assertEquals(expectKey, key);
Assert.assertTrue(info.isOK());

Assert.assertEquals(info.toString(), expectKey, key);
Assert.assertTrue(info.toString(), info.isOK());
Assert.assertNotNull(info.reqId);
Assert.assertNotNull(resp);
}
Expand Down Expand Up @@ -393,21 +363,13 @@ public void complete(String k, ResponseInfo rinfo, JSONObject response) {

try {
signal.await(120, TimeUnit.SECONDS); // wait for callback
Assert.assertNotNull("timeout", info);
} catch (InterruptedException e) {
e.printStackTrace();
}
// 尝试获取info信息。
// key == null : 没进入 complete ? 什么导致的?
if (!expectKey.equals(key)) {
//此处通不过, travis 会打印信息
Assert.assertEquals("", info);
}
if (info == null || !info.isOK()) {
//此处通不过, travis 会打印信息
Assert.assertEquals("", info);
}
Assert.assertEquals(expectKey, key);
Assert.assertTrue(info.isOK());

Assert.assertEquals(info.toString(), expectKey, key);
Assert.assertTrue(info.toString(), info.isOK());
Assert.assertNotNull(info.reqId);
Assert.assertNotNull(resp);
}
Expand Down
Loading