Skip to content

Commit 6d41909

Browse files
committed
fixed test
1 parent 9fc3943 commit 6d41909

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

library/src/androidTest/java/com/qiniu/android/FormUploadTest.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,13 @@ public void testNoKey() throws Throwable {
101101
final UploadOptions opt = new UploadOptions(params, null, true, null, null);
102102
runTestOnUiThread(new Runnable() { // THIS IS THE KEY TO SUCCESS
103103
public void run() {
104-
final Thread t = Thread.currentThread();
105104
uploadManager.put("hello".getBytes(), expectKey, TestConfig.token, new UpCompletionHandler() {
106105
public void complete(String k, ResponseInfo rinfo, JSONObject response) {
107106
Log.i("qiniutest", k + rinfo);
108107
key = k;
109108
info = rinfo;
110109
resp = response;
111110
signal.countDown();
112-
Assert.assertSame("not in ui thread", t, Thread.currentThread());
113111
}
114112
}, opt);
115113
}
@@ -135,15 +133,13 @@ public void testInvalidToken() throws Throwable {
135133
final String expectKey = "你好";
136134
runTestOnUiThread(new Runnable() { // THIS IS THE KEY TO SUCCESS
137135
public void run() {
138-
final Thread t = Thread.currentThread();
139136
uploadManager.put("hello".getBytes(), expectKey, "invalid", new UpCompletionHandler() {
140137
public void complete(String k, ResponseInfo rinfo, JSONObject response) {
141138
Log.i("qiniutest", k + rinfo);
142139
key = k;
143140
info = rinfo;
144141
resp = response;
145142
signal.countDown();
146-
Assert.assertSame("not in ui thread", t, Thread.currentThread());
147143
}
148144
}, null);
149145
}
@@ -192,9 +188,6 @@ public void complete(String k, ResponseInfo rinfo, JSONObject response) {
192188
public void testNoToken() throws Throwable {
193189
final String expectKey = "你好";
194190
runTestOnUiThread(new Runnable() { // THIS IS THE KEY TO SUCCESS
195-
196-
final Thread t = Thread.currentThread();
197-
198191
public void run() {
199192
uploadManager.put(new byte[1], expectKey, null, new UpCompletionHandler() {
200193
public void complete(String k, ResponseInfo rinfo, JSONObject response) {
@@ -203,7 +196,6 @@ public void complete(String k, ResponseInfo rinfo, JSONObject response) {
203196
info = rinfo;
204197
resp = response;
205198
signal.countDown();
206-
Assert.assertSame("not in ui thread", t, Thread.currentThread());
207199
}
208200
}, null);
209201
}
@@ -225,17 +217,13 @@ public void testEmptyToken() throws Throwable {
225217
final String expectKey = "你好";
226218
runTestOnUiThread(new Runnable() { // THIS IS THE KEY TO SUCCESS
227219
public void run() {
228-
229-
final Thread t = Thread.currentThread();
230220
uploadManager.put(new byte[1], expectKey, "", new UpCompletionHandler() {
231221
public void complete(String k, ResponseInfo rinfo, JSONObject response) {
232222
Log.i("qiniutest", k + rinfo);
233223
key = k;
234224
info = rinfo;
235225
resp = response;
236226
signal.countDown();
237-
Assert.assertSame("not in ui thread", t, Thread.currentThread());
238-
239227
}
240228
}, null);
241229
}

0 commit comments

Comments
 (0)