Skip to content

Commit d4c52ea

Browse files
committed
change token
1 parent ac4c254 commit d4c52ea

File tree

10 files changed

+36
-36
lines changed

10 files changed

+36
-36
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public boolean isCancelled() {
112112
});
113113
runTestOnUiThread(new Runnable() { // THIS IS THE KEY TO SUCCESS
114114
public void run() {
115-
uploadManager.put(tempFile, expectKey, TestConfig.token_z0, new UpCompletionHandler() {
115+
uploadManager.put(tempFile, expectKey, TestConfig.commonToken, new UpCompletionHandler() {
116116
public void complete(String k, ResponseInfo rinfo, JSONObject response) {
117117
temp.expectKey = expectKey;
118118
temp.key = k;
@@ -179,7 +179,7 @@ public boolean isCancelled() {
179179
});
180180
runTestOnUiThread(new Runnable() { // THIS IS THE KEY TO SUCCESS
181181
public void run() {
182-
uploadManager.put(tempDate, expectKey, TestConfig.token_z0, new UpCompletionHandler() {
182+
uploadManager.put(tempDate, expectKey, TestConfig.commonToken, new UpCompletionHandler() {
183183
public void complete(String k, ResponseInfo rinfo, JSONObject response) {
184184
temp.expectKey = expectKey;
185185
temp.key = k;

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,23 @@ public class FormUploadTest extends InstrumentationTestCase {
3131
public void setUp() throws Exception {
3232
this.uploadManager = new UploadManager();
3333
this.bucketTokenMap = new HashMap<>();
34-
this.bucketTokenMap.put(TestConfig.bucket_z0, TestConfig.token_z0);
35-
this.bucketTokenMap.put(TestConfig.bucket_z1, TestConfig.token_z1);
36-
this.bucketTokenMap.put(TestConfig.bucket_z2, TestConfig.token_z2);
34+
// this.bucketTokenMap.put(TestConfig.bucket_z0, TestConfig.token_z0);
35+
// this.bucketTokenMap.put(TestConfig.bucket_z1, TestConfig.token_z1);
36+
// this.bucketTokenMap.put(TestConfig.bucket_z2, TestConfig.token_z2);
3737
this.bucketTokenMap.put(TestConfig.bucket_na0, TestConfig.token_na0);
3838

3939
this.bucketZoneMap = new HashMap<>();
40-
//this.bucketZoneMap.put(TestConfig.bucket_z0, FixedZone.zone0);
41-
this.bucketZoneMap.put(TestConfig.bucket_z1, FixedZone.zone1);
42-
this.bucketZoneMap.put(TestConfig.bucket_z2, FixedZone.zone2);
43-
//this.bucketZoneMap.put(TestConfig.bucket_na0, FixedZone.zoneNa0);
40+
// this.bucketZoneMap.put(TestConfig.bucket_z0, FixedZone.zone0);
41+
// this.bucketZoneMap.put(TestConfig.bucket_z1, FixedZone.zone1);
42+
// this.bucketZoneMap.put(TestConfig.bucket_z2, FixedZone.zone2);
43+
this.bucketZoneMap.put(TestConfig.bucket_na0, FixedZone.zoneNa0);
4444

4545

4646
//mock
4747
this.mockBucketZoneMap = new HashMap<>();
48-
this.mockBucketZoneMap.put(TestConfig.bucket_z0, TestConfig.mock_bucket_zone0);
49-
this.mockBucketZoneMap.put(TestConfig.bucket_z1, TestConfig.mock_bucket_zone1);
50-
this.mockBucketZoneMap.put(TestConfig.bucket_z2, TestConfig.mock_bucket_zone2);
48+
// this.mockBucketZoneMap.put(TestConfig.bucket_z0, TestConfig.mock_bucket_zone0);
49+
// this.mockBucketZoneMap.put(TestConfig.bucket_z1, TestConfig.mock_bucket_zone1);
50+
// this.mockBucketZoneMap.put(TestConfig.bucket_z2, TestConfig.mock_bucket_zone2);
5151
this.mockBucketZoneMap.put(TestConfig.bucket_na0, TestConfig.mock_bucket_zoneNa0);
5252

5353
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected void setUp() throws Exception {
2222

2323
public void testValue(){
2424

25-
assertTrue(headers.getDate("date") != null);
25+
assertTrue(headers.values("date") != null);
2626
assertTrue(headers.values("host") != null);
2727
}
2828

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected void setUp() throws Exception {
4747
@SmallTest
4848
public void testPost1() throws Throwable {
4949
httpManager.asyncPost(null,"http://www.baidu.com",
50-
"hello".getBytes(), null, UpToken.parse(TestConfig.token_z0), "hello".getBytes().length,
50+
"hello".getBytes(), null, UpToken.parse(TestConfig.commonToken), "hello".getBytes().length,
5151
null, new CompletionHandler() {
5252
@Override
5353
public void complete(ResponseInfo rinfo, JSONObject response) {
@@ -70,7 +70,7 @@ public void complete(ResponseInfo rinfo, JSONObject response) {
7070
public void testPost2() throws Throwable {
7171

7272
httpManager.asyncPost(null,"http://up.qiniu.com", "hello".getBytes(), null,
73-
UpToken.parse(TestConfig.token_z0), "hello".getBytes().length,
73+
UpToken.parse(TestConfig.commonToken), "hello".getBytes().length,
7474
null, new CompletionHandler() {
7575
@Override
7676
public void complete(ResponseInfo rinfo, JSONObject response) {
@@ -93,7 +93,7 @@ public void testPost3() throws Throwable {
9393
runTestOnUiThread(new Runnable() { // THIS IS THE KEY TO SUCCESS
9494
public void run() {
9595
httpManager.asyncPost(null,"http://httpbin.org/status/500", "hello".getBytes(),
96-
null, UpToken.parse(TestConfig.token_z0), "hello".getBytes().length,
96+
null, UpToken.parse(TestConfig.commonToken), "hello".getBytes().length,
9797
null, new CompletionHandler() {
9898
@Override
9999
public void complete(ResponseInfo rinfo, JSONObject response) {
@@ -120,7 +120,7 @@ public void testPost4() throws Throwable {
120120
public void run() {
121121
httpManager.asyncPost(null,"http://httpbin.org/status/418",
122122
"hello".getBytes(),
123-
null, UpToken.parse(TestConfig.token_z0), "hello".getBytes().length,
123+
null, UpToken.parse(TestConfig.commonToken), "hello".getBytes().length,
124124
null, new CompletionHandler() {
125125
@Override
126126
public void complete(ResponseInfo rinfo, JSONObject response) {
@@ -145,7 +145,7 @@ public void complete(ResponseInfo rinfo, JSONObject response) {
145145
public void testPostNoDomain() throws Throwable {
146146

147147
httpManager.asyncPost(null,"http://no-domain.qiniu.com", "hello".getBytes(),
148-
null, UpToken.parse(TestConfig.token_z0), "hello".getBytes().length,
148+
null, UpToken.parse(TestConfig.commonToken), "hello".getBytes().length,
149149
null, new CompletionHandler() {
150150
@Override
151151
public void complete(ResponseInfo rinfo, JSONObject response) {
@@ -195,7 +195,7 @@ public void complete(ResponseInfo rinfo, JSONObject response) {
195195
public void testPostIP() throws Throwable {
196196
StringMap x = new StringMap().put("Host", "up.qiniu.com");
197197
httpManager.asyncPost(null,"http://218.98.28.29", "hello".getBytes(),
198-
x, UpToken.parse(TestConfig.token_z0), "hello".getBytes().length,
198+
x, UpToken.parse(TestConfig.commonToken), "hello".getBytes().length,
199199
null, new CompletionHandler() {
200200
@Override
201201
public void complete(ResponseInfo rinfo, JSONObject response) {
@@ -220,7 +220,7 @@ public void testProxy() throws Throwable {
220220
ProxyConfiguration p = new ProxyConfiguration("115.238.101.32", 80);
221221
Client c = new Client(p, 10, 30, null, null);
222222
c.asyncPost(null,"http://upproxy1.qiniu.com", "hello".getBytes(),
223-
x, UpToken.parse(TestConfig.token_z0), "hello".getBytes().length,
223+
x, UpToken.parse(TestConfig.commonToken), "hello".getBytes().length,
224224
null, new CompletionHandler() {
225225
@Override
226226
public void complete(ResponseInfo rinfo, JSONObject response) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected void setUp() throws Exception {
4141
@SmallTest
4242
public void testPost1() throws Throwable {
4343
httpManager.asyncPost(null,"https://www.baidu.com/", "hello".getBytes(), null,
44-
UpToken.parse(TestConfig.token_z0), "hello".getBytes().length, null, new CompletionHandler() {
44+
UpToken.parse(TestConfig.commonToken), "hello".getBytes().length, null, new CompletionHandler() {
4545
@Override
4646
public void complete(ResponseInfo rinfo, JSONObject response) {
4747
Log.d("qiniutest", rinfo.toString());
@@ -62,7 +62,7 @@ public void complete(ResponseInfo rinfo, JSONObject response) {
6262
@SmallTest
6363
public void testPost2() throws Throwable {
6464
httpManager.asyncPost(null,"https://static-fw.qbox.me/public/v28812/add-on/ga/analytics.js",
65-
"hello".getBytes(), null, UpToken.parse(TestConfig.token_z0), "hello".getBytes().length,
65+
"hello".getBytes(), null, UpToken.parse(TestConfig.commonToken), "hello".getBytes().length,
6666
null, new CompletionHandler() {
6767
@Override
6868
public void complete(ResponseInfo rinfo, JSONObject response) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private void template(int size) throws Throwable {
9595
final UploadOptions options = getUploadOptions();
9696
runTestOnUiThread(new Runnable() { // THIS IS THE KEY TO SUCCESS
9797
public void run() {
98-
uploadManager.put(f, expectKey, TestConfig.token_z0, new UpCompletionHandler() {
98+
uploadManager.put(f, expectKey, TestConfig.commonToken, new UpCompletionHandler() {
9999
public void complete(String k, ResponseInfo rinfo, JSONObject response) {
100100
Log.i("qiniutest", k + rinfo);
101101
key = k;
@@ -138,7 +138,7 @@ private void template2(int size) throws Throwable {
138138
.build();
139139
UploadManager uploadManager2 = new UploadManager(c);
140140
final UploadOptions options = getUploadOptions();
141-
uploadManager2.put(f, expectKey, TestConfig.token_z0, new UpCompletionHandler() {
141+
uploadManager2.put(f, expectKey, TestConfig.commonToken, new UpCompletionHandler() {
142142
public void complete(String k, ResponseInfo rinfo, JSONObject response) {
143143
Log.i("qiniutest", k + rinfo);
144144
key = k;

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void testHello() throws Throwable {
3636
params.put("x:foo", "fooval");
3737
final UploadOptions opt = new UploadOptions(params, null, true, null, null);
3838
byte[] b = "hello".getBytes();
39-
info = uploadManager.syncPut(b, expectKey, TestConfig.token_z0, opt);
39+
info = uploadManager.syncPut(b, expectKey, TestConfig.commonToken, opt);
4040
resp = info.response;
4141

4242
// Assert.assertTrue(info.toString(), info.isOK());
@@ -55,7 +55,7 @@ public void test0Data() throws Throwable {
5555
params.put("x:foo", "fooval");
5656
final UploadOptions opt = new UploadOptions(params, null, true, null, null);
5757

58-
info = uploadManager.syncPut("".getBytes(), expectKey, TestConfig.token_z0, opt);
58+
info = uploadManager.syncPut("".getBytes(), expectKey, TestConfig.commonToken, opt);
5959
resp = info.response;
6060

6161
// key = resp.optString("key");
@@ -72,7 +72,7 @@ public void testNoKey() throws Throwable {
7272
Map<String, String> params = new HashMap<String, String>();
7373
params.put("x:foo", "fooval");
7474
final UploadOptions opt = new UploadOptions(params, null, true, null, null);
75-
info = uploadManager.syncPut("hello".getBytes(), expectKey, TestConfig.token_z0, opt);
75+
info = uploadManager.syncPut("hello".getBytes(), expectKey, TestConfig.commonToken, opt);
7676

7777
resp = info.response;
7878
// key = resp.optString("key");
@@ -136,7 +136,7 @@ public void testFile() throws Throwable {
136136
Map<String, String> params = new HashMap<String, String>();
137137
params.put("x:foo", "fooval");
138138
final UploadOptions opt = new UploadOptions(params, null, true, null, null);
139-
info = uploadManager.syncPut(f, expectKey, TestConfig.token_z0, opt);
139+
info = uploadManager.syncPut(f, expectKey, TestConfig.commonToken, opt);
140140

141141
resp = info.response;
142142
// key = resp.optString("key");
@@ -158,7 +158,7 @@ public void test0File() throws Throwable {
158158
Map<String, String> params = new HashMap<String, String>();
159159
params.put("x:foo", "fooval");
160160
final UploadOptions opt = new UploadOptions(params, null, true, null, null);
161-
info = uploadManager.syncPut(f, expectKey, TestConfig.token_z0, opt);
161+
info = uploadManager.syncPut(f, expectKey, TestConfig.commonToken, opt);
162162

163163
resp = info.response;
164164
Assert.assertEquals(f.toString(), 0, f.length());
@@ -171,10 +171,10 @@ public void test0File() throws Throwable {
171171

172172
@SmallTest
173173
public void test0byte() {
174-
info = uploadManager.syncPut(new byte[0], null, TestConfig.token_z0, null);
174+
info = uploadManager.syncPut(new byte[0], null, TestConfig.commonToken, null);
175175
Assert.assertEquals(info.toString(), ResponseInfo.ZeroSizeFile, info.statusCode);
176176

177-
info = uploadManager.syncPut("", null, TestConfig.token_z0, null);
177+
info = uploadManager.syncPut("", null, TestConfig.commonToken, null);
178178
Assert.assertEquals(info.toString(), ResponseInfo.ZeroSizeFile, info.statusCode);
179179
}
180180

@@ -192,7 +192,7 @@ public void testHttps() throws Throwable {
192192
.useHttps(true)
193193
.build();
194194
UploadManager uploadManager2 = new UploadManager(c);
195-
info = uploadManager2.syncPut("hello".getBytes(), expectKey, TestConfig.token_z0, opt);
195+
info = uploadManager2.syncPut("hello".getBytes(), expectKey, TestConfig.commonToken, opt);
196196

197197
resp = info.response;
198198
// key = resp.optString("key");

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public final class TestConfig {
1919
public static final String token_z2 = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:S9V-5ttyKKfzH59Ncs7wooEOpc4=:eyJzY29wZSI6InNkay16MiIsImRlYWRsaW5lIjoxNTk1MDU4MzY0fQ==";
2020
//北美上传凭证
2121
public static final String bucket_na0 = "sdk-na0";
22-
public static final String token_na0 = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:K-4seSpuZ1XivgHK_VrZVt4z5Pw=:eyJzY29wZSI6InNkay1uYTAiLCJkZWFkbGluZSI6MTU5NTA1ODM4NX0=";
22+
public static final String token_na0 = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:hNobj3oBf2OxjafAlH6przLDAOs=:eyJzY29wZSI6InNkay1uYTAiLCJkZWFkbGluZSI6MTU5NTMxNDIyN30=";
2323
public static final String ak = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW";
2424

2525

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public boolean isCancelled() {
8989
});
9090
runTestOnUiThread(new Runnable() { // THIS IS THE KEY TO SUCCESS
9191
public void run() {
92-
uploadManager.put(tempFile, expectKey, TestConfig.token_z0, new UpCompletionHandler() {
92+
uploadManager.put(tempFile, expectKey, TestConfig.commonToken, new UpCompletionHandler() {
9393
public void complete(String k, ResponseInfo rinfo, JSONObject response) {
9494
Log.i("qiniutest", k + rinfo);
9595
key = k;
@@ -125,7 +125,7 @@ public void progress(String key, double percent) {
125125

126126
runTestOnUiThread(new Runnable() { // THIS IS THE KEY TO SUCCESS
127127
public void run() {
128-
uploadManager.put(tempFile, expectKey, TestConfig.token_z0, new UpCompletionHandler() {
128+
uploadManager.put(tempFile, expectKey, TestConfig.commonToken, new UpCompletionHandler() {
129129
public void complete(String k, ResponseInfo rinfo, JSONObject response) {
130130
Log.i("qiniutest", k + rinfo);
131131
key = k;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
public class TokenTest extends AndroidTestCase {
1313
public void testRight() {
14-
UpToken t = UpToken.parse(TestConfig.token_z0);
14+
UpToken t = UpToken.parse(TestConfig.commonToken);
1515
Assert.assertNotSame(t, UpToken.NULL);
1616
}
1717

0 commit comments

Comments
 (0)