OAuthToken.test.js 226.6 KB
Newer Older
J
jiyong_sd 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the 'License');
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an 'AS IS' BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import account from '@ohos.account.appAccount'
import resmgr from '@ohos.resourceManager'
import featureAbility from '@ohos.ability.featureAbility'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'


const TIMEOUT = 1000;
const EACHTIMEOUT = 500;
const LENGTHLIMIT = 512;
const TOKENLENGTHLIMIT = 1024;
const AUTHTYPELENGTHLIMIT = 1024;
const OWNERLENGTHLIMIT = 1024;

const OWNERSELF = "com.example.actsaccounttest";
export default function ActsAccountOAuthToken() {
    describe('ActsAccountOAuthToken', function () {
        function sleep(delay) {
            return new Promise((resolve, reject) => {
                setTimeout(() => {
                    resolve()
                }, delay)
            }).then(() => {
                console.info(`sleep #{time} over ...`)
            })
        }

        beforeAll(async function (done) {
            console.debug("====>beforeAll start====");
            await sleep(TIMEOUT);
            console.debug("====>beforeAll end====");
            done();
        });

        beforeEach(async function (done) {
            console.debug("====>beforeAll enter====");
            await sleep(EACHTIMEOUT);
            done();
        });

        /*
            * @tc.number    : testGetEntriesString101
            * @tc.name      : Use getEntries get the value by mixing the string key
            * @tc.desc      : Mixed strings value can be obtained correctly
            * @tc.size      : MediumTest
            * @tc.type      : Function
            * @tc.level     : Level 1
        */


        it('ActsAccountOAuthToken_9100', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_9100 start====");
            var appAccountManager = account.createAppAccountManager();
            appAccountManager.addAccount("account_tokenTest_name",(err,)=>{
                console.debug("====>ActsAccountOAuthToken_9100 addAccount err:" + JSON.stringify(err));
70
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
71 72
                appAccountManager.setOAuthToken("account_tokenTest_name","authType1","test_token1",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_9100 setOAuthToken err:" + JSON.stringify(err));
73
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
74 75
                    appAccountManager.setOAuthToken("account_tokenTest_name","authType1","test_token2",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_9100 setOAuthToken err:" + JSON.stringify(err));
76
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
77 78
                        appAccountManager.setOAuthTokenVisibility("account_tokenTest_name","authType1","other_app_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_9100 setOAuthTokenVisibility err:" + JSON.stringify(err));
79
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
80 81
                            appAccountManager.setOAuthToken("account_tokenTest_name","authType2","test_token2",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_9100 setOAuthToken err:" + JSON.stringify(err));
82
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
83 84 85
                                appAccountManager.getAllOAuthTokens("account_tokenTest_name", OWNERSELF,(err,ArrayData)=>{
                                    console.debug("====>ActsAccountOAuthToken_9100 getAllOAuthTokens err:" + JSON.stringify(err));
                                    console.debug("====>ActsAccountOAuthToken_9100 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData));
86
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
87 88 89
                                    expect(ArrayData.length).assertEqual(2);
                                    appAccountManager.deleteOAuthToken("account_tokenTest_name",OWNERSELF,"authType1","test_token2",(err)=>{
                                        console.debug("====>ActsAccountOAuthToken_9100 deleteOAuthToken err:" + JSON.stringify(err));
90
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
91 92 93
                                        appAccountManager.getAllOAuthTokens("account_tokenTest_name", OWNERSELF,(err,ArrayData)=>{
                                            console.debug("====>ActsAccountOAuthToken_9100 getAllOAuthTokens err:" + JSON.stringify(err));
                                            console.debug("====>ActsAccountOAuthToken_9100 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData));
94
                                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
95 96 97
                                            expect(ArrayData.length).assertEqual(2);
                                            appAccountManager.deleteAccount("account_tokenTest_name",(err)=>{
                                                console.debug("====>ActsAccountOAuthToken_9100 deleteAccount err:" + JSON.stringify(err));
98
                                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
                                                console.debug("====>ActsAccountOAuthToken_9100 end====");
                                                done();
                                                appAccountManager.getOAuthToken("account_tokenTest_name",OWNERSELF,"authType",(err,data)=>{
                                                    console.debug("====>ActsAccountOAuthToken_9100 getOAuthToken err:" + JSON.stringify(err));
                                                    console.debug("====>ActsAccountOAuthToken_9100 getOAuthToken data:" + data);
                                                    expect(err.code!=0).assertEqual(true);
                                                    console.debug("====>ActsAccountOAuthToken_9100 end====");
                                                    done();
                                                });
                                            });    
                                        }); 
                                    });   
                                });  
                            }); 
                        });
                    });
                });
            });
        });


        it('ActsAccountOAuthToken_9000', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_9000 start====");
            var appAccountManager = account.createAppAccountManager();
            appAccountManager.addAccount("account_tokenTest_name",(err,)=>{
                console.debug("====>ActsAccountOAuthToken_9000 addAccount err:" + JSON.stringify(err));
125
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
126 127
                appAccountManager.setOAuthToken("account_tokenTest_name","authType","test_token",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_9000 setOAuthToken err:" + JSON.stringify(err));
128
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
129 130 131
                    appAccountManager.getOAuthToken("account_tokenTest_name",OWNERSELF,"authType",(err,data)=>{
                        console.debug("====>ActsAccountOAuthToken_9000 getOAuthToken err:" + JSON.stringify(err));
                        console.debug("====>ActsAccountOAuthToken_9000 getOAuthToken data:" + data);
132
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
133 134 135
                        expect(data).assertEqual("test_token");
                        appAccountManager.setOAuthTokenVisibility("account_tokenTest_name","authType","other_app_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_9000 setOAuthTokenVisibility err:" + JSON.stringify(err));
136
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
137 138
                            appAccountManager.getOAuthList("account_tokenTest_name","authType",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_9000 getOAuthList err:" + JSON.stringify(err));
139
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
140 141 142 143 144
                                console.debug("====>ActsAccountOAuthToken_9000 getOAuthList dataArray:" + JSON.stringify(dataArray));
                                expect(dataArray.length).assertEqual(1);
                                expect(dataArray[0]).assertEqual("other_app_bundleName");
                                appAccountManager.deleteOAuthToken("account_tokenTest_name",OWNERSELF,"authType","test_token",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_9000 deleteOAuthToken err:" + JSON.stringify(err));
145
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
146 147 148
                                    appAccountManager.getAllOAuthTokens("account_tokenTest_name", OWNERSELF,(err,ArrayData)=>{
                                        console.debug("====>ActsAccountOAuthToken_9000 getAllOAuthTokens err:" + JSON.stringify(err));
                                        console.debug("====>ActsAccountOAuthToken_9000 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData));
149
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
150 151 152 153 154
                                        expect(ArrayData.length).assertEqual(1);
                                        expect(ArrayData[0].authType).assertEqual("authType");
                                        expect(ArrayData[0].token).assertEqual("");
                                        appAccountManager.setOAuthTokenVisibility("account_tokenTest_name","authType",OWNERSELF,false,(err)=>{
                                            console.debug("====>ActsAccountOAuthToken_9000 setOAuthTokenVisibility err:" + JSON.stringify(err));
155
                                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
156 157 158 159
                                            appAccountManager.getOAuthToken("account_tokenTest_name",OWNERSELF,"authType",(err,data)=>{
                                                console.debug("====>ActsAccountOAuthToken_9000 getOAuthToken err:" + JSON.stringify(err));
                                                console.debug("====>ActsAccountOAuthToken_9000 getOAuthToken data:" + data);
                                                expect(err.code!=0).assertEqual(true);
160
                                                expect(data).assertEqual(null);
J
jiyong_sd 已提交
161 162
                                                appAccountManager.deleteAccount("account_tokenTest_name",(err)=>{
                                                    console.debug("====>ActsAccountOAuthToken_9000 deleteAccount err:" + JSON.stringify(err));
163
                                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
                                                    console.debug("====>ActsAccountOAuthToken_9000 end====");
                                                    done();
                                                });
                                            });    
                                        }); 
                                    });   
                                });  
                            }); 
                        });
                    });
                });
            });
        });



        it('ActsAccountOAuthToken_7100', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_7100 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_7100 addAccount start====");
            appAccountManager.addAccount("account_tokenTest_name",(err)=>{
                console.debug("====>ActsAccountOAuthToken_7100 addAccount err:" + JSON.stringify(err));
186
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
187 188
                appAccountManager.setOAuthToken("account_tokenTest_name","authType1","test_token1",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_7100 setOAuthToken err:" + JSON.stringify(err));
189
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
190 191
                    appAccountManager.setOAuthToken("account_tokenTest_name","authType1","test_token2",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_7100 setOAuthToken err:" + JSON.stringify(err));
192
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
193 194
                        appAccountManager.setOAuthToken("account_tokenTest_name","authType2","test_token2",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_7100 setOAuthToken err:" + JSON.stringify(err));
195
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
196 197 198
                            appAccountManager.getAllOAuthTokens("account_tokenTest_name", OWNERSELF,(err,ArrayData)=>{
                                console.debug("====>ActsAccountOAuthToken_7100 getAllOAuthTokens err:" + JSON.stringify(err));
                                console.debug("====>ActsAccountOAuthToken_7100 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData));
199
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
200 201 202 203 204 205 206
                                expect(ArrayData.length).assertEqual(2);
                                expect(ArrayData[0].authType).assertEqual("authType1");
                                expect(ArrayData[0].token).assertEqual("test_token2");
                                expect(ArrayData[1].authType).assertEqual("authType2");
                                expect(ArrayData[1].token).assertEqual("test_token2");
                                appAccountManager.deleteOAuthToken("account_tokenTest_name",OWNERSELF,"authType1","test_token2",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_7100 deleteOAuthToken err:" + JSON.stringify(err));
207
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
208 209 210
                                    appAccountManager.getAllOAuthTokens("account_tokenTest_name", OWNERSELF,(err,ArrayData)=>{
                                        console.debug("====>ActsAccountOAuthToken_7100 getAllOAuthTokens err:" + JSON.stringify(err));
                                        console.debug("====>ActsAccountOAuthToken_7100 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData));
211
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
212 213 214 215 216
                                        expect(ArrayData.length).assertEqual(1);
                                        expect(ArrayData[0].authType).assertEqual("authType2");
                                        expect(ArrayData[0].token).assertEqual("test_token2");
                                        appAccountManager.deleteAccount("account_tokenTest_name",(err)=>{
                                            console.debug("====>ActsAccountOAuthToken_7100 deleteAccount err:" + JSON.stringify(err));
217
                                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
218 219 220 221
                                            appAccountManager.getOAuthToken("account_tokenTest_name",OWNERSELF,"authType",(err,data)=>{
                                                console.debug("====>ActsAccountOAuthToken_7100 getOAuthToken err:" + JSON.stringify(err));
                                                console.debug("====>ActsAccountOAuthToken_7100 getOAuthToken data:" + data);
                                                expect(err.code!=0).assertEqual(true);
222
                                                expect(data).assertEqual(null);
J
jiyong_sd 已提交
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
                                                console.debug("====>ActsAccountOAuthToken_7100 end====");
                                                done();
                                            });
                                        });
                                    });    
                                }); 
                            });
                        });
                    });
                });
            });
        });


        it('ActsAccountOAuthToken_7200', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_7200 start====");
            var appAccountManager = account.createAppAccountManager();
            appAccountManager.addAccount("account_tokenTest_name",(err,)=>{
                console.debug("====>ActsAccountOAuthToken_7200 addAccount err:" + JSON.stringify(err));
242
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
243 244
                appAccountManager.setOAuthToken("account_tokenTest_name","authType","test_token",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_7200 setOAuthToken err:" + JSON.stringify(err));
245
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
246 247 248
                    appAccountManager.getOAuthToken("account_tokenTest_name",OWNERSELF,"authType",(err,data)=>{
                        console.debug("====>ActsAccountOAuthToken_7200 getOAuthToken err:" + JSON.stringify(err));
                        console.debug("====>ActsAccountOAuthToken_7200 getOAuthToken data:" + data);
249
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
250 251 252
                        expect(data).assertEqual("test_token");
                        appAccountManager.getOAuthList("account_tokenTest_name","authType",(err,dataArray)=>{
                            console.debug("====>ActsAccountOAuthToken_7200 getOAuthList err:" + JSON.stringify(err));
253
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
254 255 256 257
                            console.debug("====>ActsAccountOAuthToken_7200 getOAuthList dataArray:" + JSON.stringify(dataArray));
                            expect(dataArray.length).assertEqual(0);
                            appAccountManager.deleteAccount("account_tokenTest_name",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_7200 deleteAccount err:" + JSON.stringify(err));
258
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273
                                console.debug("====>ActsAccountOAuthToken_7200 end====");
                                done();
                            });
                        });    
                    });
                });
            });
        });

        it('ActsAccountOAuthToken_7300', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_7300 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_7300 addAccount start====");
            appAccountManager.addAccount("account_tokenTest_name",(err)=>{
                console.debug("====>ActsAccountOAuthToken_7300 addAccount err:" + JSON.stringify(err));
274
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
275 276
                appAccountManager.setOAuthToken("account_tokenTest_name","authType","test_token",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_7300 setOAuthToken err:" + JSON.stringify(err));
277
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
278 279 280
                    appAccountManager.getOAuthToken("account_tokenTest_name",OWNERSELF,"authType",(err,data)=>{
                        console.debug("====>ActsAccountOAuthToken_7300 getOAuthToken err:" + JSON.stringify(err));
                        console.debug("====>ActsAccountOAuthToken_7300 getOAuthToken data:" + data);
281
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
282 283 284 285
                        expect(data).assertEqual("test_token");
                        appAccountManager.checkOAuthTokenVisibility("account_tokenTest_name","authType",OWNERSELF,(err,stateBack)=>{
                            console.debug("====>ActsAccountOAuthToken_7300 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_7300 checkOAuthTokenVisibility stateBack:" + stateBack);
286
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
287 288 289
                            expect(stateBack).assertEqual(true);
                            appAccountManager.setOAuthTokenVisibility("account_tokenTest_name","authType",OWNERSELF,false,(err)=>{
                                console.debug("====>ActsAccountOAuthToken_7300 setOAuthTokenVisibility err:" + JSON.stringify(err));
290
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
291 292 293
                                appAccountManager.checkOAuthTokenVisibility("account_tokenTest_name","authType",OWNERSELF,(err,stateBack)=>{
                                    console.debug("====>ActsAccountOAuthToken_7300 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                                    console.debug("====>ActsAccountOAuthToken_7300 checkOAuthTokenVisibility stateBack:" + stateBack);
294
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
295 296 297
                                    expect(stateBack).assertEqual(true);
                                    appAccountManager.deleteOAuthToken("account_tokenTest_name",OWNERSELF,"authType","test_token",(err)=>{
                                        console.debug("====>ActsAccountOAuthToken_7300 deleteOAuthToken err:" + JSON.stringify(err));
298
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
299 300
                                        appAccountManager.deleteAccount("account_tokenTest_name",(err)=>{
                                            console.debug("====>ActsAccountOAuthToken_7300 deleteAccount err:" + JSON.stringify(err));
301
                                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323
                                            console.debug("====>ActsAccountOAuthToken_7300 end====");
                                            done();
                                        });
                                    });
                                });
                            });
                        });
                    });
                });
            });
        });

        it('ActsAccountOAuthToken_7400', 0, async function (done) {
            var limitAuthType = '';
            for(var i = 0;i < AUTHTYPELENGTHLIMIT + 1; i++){
                limitAuthType += 'c';
            }
            console.debug("====>ActsAccountOAuthToken_7400 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_7400 addAccount start====");
            appAccountManager.addAccount("account_callback_authType_limit",(err)=>{
                console.debug("====>ActsAccountOAuthToken_7400 addAccount err:" + JSON.stringify(err));
324
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
325 326
                appAccountManager.setOAuthToken("account_callback_authType_limit","authType","callback_authType_limit_token",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_7400 setOAuthToken err:" + JSON.stringify(err));
327
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
328 329 330 331 332
                    appAccountManager.deleteOAuthToken("account_callback_authType_limit",OWNERSELF,limitAuthType,"callback_authType_limit_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_7400 getOAuthToken err:" + JSON.stringify(err));
                        expect(err.code!=0).assertEqual(true);
                        appAccountManager.deleteAccount("account_callback_authType_limit",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_7400 deleteAccount err:" + JSON.stringify(err));
333
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377
                            console.debug("====>ActsAccountOAuthToken_7400 end====");
                            done();
                        });
                    });
                });
            });
        });


        it('ActsAccountOAuthToken_7500', 0, async function (done) {
            var limitAuthType = '';
            for(var i = 0;i < AUTHTYPELENGTHLIMIT + 1; i++){
                limitAuthType += 'c';
            }
            console.debug("====>ActsAccountOAuthToken_7500 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_7500 addAccount start====");
            await appAccountManager.addAccount("account_promise_authType_limit");
            console.debug("====>ActsAccountOAuthToken_7500 getOAuthToken start====");
            try{
                await appAccountManager.deleteOAuthToken("account_promise_authType_limit",OWNERSELF,limitAuthType,"promise_authType_limit_token");
            }
            catch(err){
                console.debug("====>ActsAccountOAuthToken_7500 getOAuthToken err:" + JSON.stringify(err));
                expect(err.code!=0).assertEqual(true);
                console.debug("====>ActsAccountOAuthToken_7500 deleteAccount start====");
                await appAccountManager.deleteAccount("account_promise_authType_limit");
                console.debug("====>ActsAccountOAuthToken_7500 end====");
                done();
            }
        });



        it('ActsAccountOAuthToken_7600', 0, async function (done) {
            var limitAuthType = '';
            for(var i = 0;i < AUTHTYPELENGTHLIMIT; i++){
                limitAuthType += 'c';
            }
            console.debug("====>ActsAccountOAuthToken_7600 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_7600 addAccount start====");
            appAccountManager.addAccount("account_callback_authType_limit",(err)=>{
                console.debug("====>ActsAccountOAuthToken_7600 addAccount err:" + JSON.stringify(err));
378
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
379 380
                appAccountManager.setOAuthToken("account_callback_authType_limit",limitAuthType,"callback_authType_limit_token",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_7600 setOAuthToken err:" + JSON.stringify(err));
381
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
382 383
                    appAccountManager.deleteOAuthToken("account_callback_authType_limit",OWNERSELF,limitAuthType,"callback_authType_limit_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_7600 getOAuthToken err:" + JSON.stringify(err));
384
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
385 386
                        appAccountManager.deleteAccount("account_callback_authType_limit",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_7600 deleteAccount err:" + JSON.stringify(err));
387
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423
                            console.debug("====>ActsAccountOAuthToken_7600 end====");
                            done();
                        });
                    });
                });
            });
        });

        it('ActsAccountOAuthToken_7700', 0, async function (done) {
            var limitAuthType = '';
            for(var i = 0;i < AUTHTYPELENGTHLIMIT; i++){
                limitAuthType += 'c';
            }
            console.debug("====>ActsAccountOAuthToken_7700 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_7700 addAccount start====");
            await appAccountManager.addAccount("account_promise_authType_limit")
            console.debug("====>ActsAccountOAuthToken_7700 setOAuthToken start====");
            await appAccountManager.setOAuthToken("account_promise_authType_limit",limitAuthType,"promise_authType_limit_token");
            console.debug("====>ActsAccountOAuthToken_7700 deleteOAuthToken start====");
            await appAccountManager.deleteOAuthToken("account_promise_authType_limit",OWNERSELF,limitAuthType,"promise_authType_limit_token")
            console.debug("====>ActsAccountOAuthToken_7700 deleteAccount start====");
            await appAccountManager.deleteAccount("account_promise_authType_limit")
            console.debug("====>ActsAccountOAuthToken_7700 end====");
            done();

        });


        
        it('ActsAccountOAuthToken_7800', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_7800 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_7800 addAccount start====");
            appAccountManager.addAccount("account_callback_empty_authType",(err)=>{
                console.debug("====>ActsAccountOAuthToken_7800 addAccount err:" + JSON.stringify(err));
424
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
425 426
                appAccountManager.setOAuthToken("account_callback_empty_authType","authType","callback_empty_authType_token",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_7800 setOAuthToken err:" + JSON.stringify(err));
427
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
428 429
                    appAccountManager.deleteOAuthToken("account_callback_empty_authType",OWNERSELF,"","callback_empty_authType_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_7800 deleteOAuthToken err:" + JSON.stringify(err));
430
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
431 432 433
                        appAccountManager.getOAuthToken("account_callback_empty_authType",OWNERSELF,"authType",(err,data)=>{
                            console.debug("====>ActsAccountOAuthToken_7800 getOAuthToken err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_7800 getOAuthToken data:" + data);
434
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
435 436 437
                            expect(data).assertEqual("callback_empty_authType_token");
                            appAccountManager.deleteAccount("account_callback_empty_authType",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_7800 deleteAccount err:" + JSON.stringify(err));
438
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473
                                console.debug("====>ActsAccountOAuthToken_7800 end====");
                                done();
                            });
                        });
                    });
                });
            });
        });

        it('ActsAccountOAuthToken_7900', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_7900 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_7900 addAccount start====");
            await appAccountManager.addAccount("account_promise_empty_authType");
            console.debug("====>ActsAccountOAuthToken_7900 setOAuthToken start====");
            await appAccountManager.setOAuthToken("account_promise_empty_authType","authType","promise_empty_authType_token");
            console.debug("====>ActsAccountOAuthToken_7900 deleteOAuthToken start====");
            await appAccountManager.deleteOAuthToken("account_promise_empty_authType",OWNERSELF,"","promise_empty_authType_token");
            console.debug("====>ActsAccountOAuthToken_7900 getOAuthToken start====");
            var data = await appAccountManager.getOAuthToken("account_promise_empty_authType",OWNERSELF,"authType");
            expect(data).assertEqual("promise_empty_authType_token");
            console.debug("====>ActsAccountOAuthToken_7900 deleteAccount start====");
            await appAccountManager.deleteAccount("account_promise_empty_authType");
            console.debug("====>ActsAccountOAuthToken_7900 end====");
            done();

        });


        it('ActsAccountOAuthToken_8000', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_8000 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_8000 addAccount start====");
            appAccountManager.addAccount("account_callback_setSameAuthType",(err)=>{
                console.debug("====>ActsAccountOAuthToken_8000 addAccount err:" + JSON.stringify(err));
474
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
475 476
                appAccountManager.setOAuthToken("account_callback_setSameAuthType","authType","callback_setSameAuthType_token1",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_8000 setOAuthToken err:" + JSON.stringify(err));
477
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
478 479
                    appAccountManager.setOAuthToken("account_callback_setSameAuthType","authType","callback_setSameAuthType_token2",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_8000 setOAuthToken err:" + JSON.stringify(err));
480
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
481 482 483
                        appAccountManager.getOAuthToken("account_callback_setSameAuthType",OWNERSELF,"authType",(err,data)=>{
                            console.debug("====>ActsAccountOAuthToken_8000 getOAuthToken err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_8000 getOAuthToken data:" + data);
484
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
485 486 487
                            expect(data).assertEqual("callback_setSameAuthType_token2");
                            appAccountManager.deleteOAuthToken("account_callback_setSameAuthType",OWNERSELF,"authType","callback_setSameAuthType_token1",(err,data)=>{
                                console.debug("====>ActsAccountOAuthToken_8000 deleteOAuthToken err:" + JSON.stringify(err));
488
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
489 490
                                appAccountManager.deleteAccount("account_callback_setSameAuthType",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_8000 deleteAccount err:" + JSON.stringify(err));
491
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
492 493 494 495 496 497 498 499 500 501 502 503 504 505
                                    console.debug("====>ActsAccountOAuthToken_8000 end====");
                                    done();
                                }); 
                            }); 
                        });
                    });
                });
            });
        });





1
15829070344 已提交
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534
    it('ActsAccountOAuthToken_8100', 0, async function (done) {
        var limitName = '';
        for(var i = 0;i < LENGTHLIMIT + 1; i++){
            limitName += 'c';
        }
        console.debug("====>ActsAccountOAuthToken_8100 start====");
        var appAccountManager = account.createAppAccountManager();
        console.debug("====>ActsAccountOAuthToken_8100 getAllOAuthTokens start====");
        appAccountManager.getAllOAuthTokens(limitName, OWNERSELF).then((ArrayData)=>{
            console.debug("====>ActsAccountOAuthToken_8100 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData));           
            expect(ArrayData.length).assertEqual(0);
            console.debug("====>ActsAccountOAuthToken_8100 ====");
            done();
        }).catch((err)=>{
            expect(err.code!=0).assertEqual(true);
            done();
        })
    });
    
    it('ActsAccountOAuthToken_8200', 0, async function (done) {
        console.debug("====>ActsAccountOAuthToken_8200 start====");
        var appAccountManager = account.createAppAccountManager();
        console.debug("====>ActsAccountOAuthToken_8200 getAllOAuthTokens start====");
        appAccountManager.getAllOAuthTokens("", OWNERSELF,(err,ArrayData)=>{
            console.debug("====>ActsAccountOAuthToken_8200 getAllOAuthTokens err:" + JSON.stringify(err));
            console.debug("====>ActsAccountOAuthToken_8200 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData));
            expect(err.code!=0).assertEqual(true);
            console.debug("====>ActsAccountOAuthToken_8200 ====");
            done();
J
jiyong_sd 已提交
535
        });
1
15829070344 已提交
536
    });
J
jiyong_sd 已提交
537 538 539 540 541 542 543 544 545

        it('ActsAccountOAuthToken_8300', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_8300 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_8300 getAllOAuthTokens start====");
            appAccountManager.getAllOAuthTokens("acount_no_setToken", OWNERSELF,(err,ArrayData)=>{
                console.debug("====>ActsAccountOAuthToken_8300 getAllOAuthTokens err:" + JSON.stringify(err));
                console.debug("====>ActsAccountOAuthToken_8300 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData));
                expect(err.code!=0).assertEqual(true);
546
                expect(ArrayData).assertEqual(null);
J
jiyong_sd 已提交
547 548 549 550 551 552 553 554 555 556 557 558 559
                console.debug("====>ActsAccountOAuthToken_8300 end====");
                done();
            });
        });



        it('ActsAccountOAuthToken_8400', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_8400 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_8400 addAccount start====");
            appAccountManager.addAccount("acount_no_setToken",(err)=>{
                console.debug("====>ActsAccountOAuthToken_8400 addAccount err:" + JSON.stringify(err));
560
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
561 562 563
                appAccountManager.getAllOAuthTokens("acount_no_setToken", OWNERSELF,(err,ArrayData)=>{
                    console.debug("====>ActsAccountOAuthToken_8400 getAllOAuthTokens err:" + JSON.stringify(err));
                    console.debug("====>ActsAccountOAuthToken_8400 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData));
564
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
565 566 567
                    expect(ArrayData.length).assertEqual(0);
                    appAccountManager.deleteAccount("acount_no_setToken",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_8400 deleteAccount err:" + JSON.stringify(err));
568
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587
                        console.debug("====>ActsAccountOAuthToken_8400 end====");
                        done();
                    });
                });
            });
        });



        it('ActsAccountOAuthToken_8500', 0, async function (done) {
            var limitName = '';
            for(var i = 0;i < LENGTHLIMIT; i++){
                limitName += 'c';
            }
            console.debug("====>ActsAccountOAuthToken_8500 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_8500 addAccount start====");
            appAccountManager.addAccount(limitName,(err)=>{
                console.debug("====>ActsAccountOAuthToken_8500 addAccount err:" + JSON.stringify(err));
588
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
589 590
                appAccountManager.setOAuthToken(limitName,"authType","test_token",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_8500 setOAuthToken err:" + JSON.stringify(err));
591
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
592 593 594
                    appAccountManager.getAllOAuthTokens(limitName, OWNERSELF,(err,ArrayData)=>{
                        console.debug("====>ActsAccountOAuthToken_8500 getAllOAuthTokens err:" + JSON.stringify(err));
                        console.debug("====>ActsAccountOAuthToken_8500 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData));
595
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
596 597 598 599 600
                        expect(ArrayData.length).assertEqual(1);
                        expect(ArrayData[0].authType).assertEqual("authType");
                        expect(ArrayData[0].token).assertEqual("test_token");
                        appAccountManager.deleteAccount(limitName,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_8500 deleteAccount err:" + JSON.stringify(err));
601
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620
                            console.debug("====>ActsAccountOAuthToken_8500 end====");
                            done();
                        });
                    });
                });
            });
        });


        it('ActsAccountOAuthToken_8600', 0, async function (done) {
            var limitOwner = '';
            for(var i = 0;i < OWNERLENGTHLIMIT + 1; i++){
                limitOwner += 'c';
            }
            console.debug("====>ActsAccountOAuthToken_8600 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_8600 addAccount start====");
            appAccountManager.addAccount("account_callback_getAllOAuthTokens_test",(err)=>{
                console.debug("====>ActsAccountOAuthToken_8600 addAccount err:" + JSON.stringify(err));
621
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
622 623 624 625
                appAccountManager.getAllOAuthTokens("account_callback_getAllOAuthTokens_test",limitOwner,(err,ArrayData)=>{
                    console.debug("====>ActsAccountOAuthToken_8600 getAllOAuthTokens err:" + JSON.stringify(err));
                    console.debug("====>ActsAccountOAuthToken_8600 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData));
                    expect(err.code!=0).assertEqual(true);
626
                    expect(ArrayData).assertEqual(null);
J
jiyong_sd 已提交
627 628
                    appAccountManager.deleteAccount("account_callback_getAllOAuthTokens_test",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_8600 deleteAccount err:" + JSON.stringify(err));
629
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
630 631 632 633 634 635 636 637 638 639 640 641 642 643
                        console.debug("====>ActsAccountOAuthToken_8600 end====");
                        done();
                    });
                });
            });
        });
        

        it('ActsAccountOAuthToken_8700', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_8700 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_8700 addAccount start====");
            appAccountManager.addAccount("account_callback_getAllOAuthTokens_test",(err)=>{
                console.debug("====>ActsAccountOAuthToken_8700 addAccount err:" + JSON.stringify(err));
644
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
645 646 647 648
                appAccountManager.getAllOAuthTokens("account_callback_getAllOAuthTokens_test","",(err,ArrayData)=>{
                    console.debug("====>ActsAccountOAuthToken_8700 getAllOAuthTokens err:" + JSON.stringify(err));
                    console.debug("====>ActsAccountOAuthToken_8700 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData));
                    expect(err.code!=0).assertEqual(true);
649
                    expect(ArrayData).assertEqual(null);
J
jiyong_sd 已提交
650 651
                    appAccountManager.deleteAccount("account_callback_getAllOAuthTokens_test",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_8700 deleteAccount err:" + JSON.stringify(err));
652
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
653 654 655 656 657 658 659 660 661 662 663 664 665 666
                        console.debug("====>ActsAccountOAuthToken_8700 end====");
                        done();
                    });
                });
            });
        });

        
        it('ActsAccountOAuthToken_8800', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_8800 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_8800 addAccount start====");
            appAccountManager.addAccount("account_callback_getAllOAuthTokens_test",(err)=>{
                console.debug("====>ActsAccountOAuthToken_8800 addAccount err:" + JSON.stringify(err));
667
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
668 669 670 671
                appAccountManager.getAllOAuthTokens("account_callback_getAllOAuthTokens_test","invalid_owner",(err,ArrayData)=>{
                    console.debug("====>ActsAccountOAuthToken_8800 getAllOAuthTokens err:" + JSON.stringify(err));
                    console.debug("====>ActsAccountOAuthToken_8800 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData));
                    expect(err.code!=0).assertEqual(true);
672
                    expect(ArrayData).assertEqual(null);
J
jiyong_sd 已提交
673 674
                    appAccountManager.deleteAccount("account_callback_getAllOAuthTokens_test",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_8800 deleteAccount err:" + JSON.stringify(err));
675
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
676 677 678 679 680 681 682 683 684 685 686 687 688
                        console.debug("====>ActsAccountOAuthToken_8800 end====");
                        done();
                    });
                });
            });
        });

        it('ActsAccountOAuthToken_8900', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_8900 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_8900 addAccount start====");
            appAccountManager.addAccount("account_callback_getAllOAuthTokens_test",(err)=>{
                console.debug("====>ActsAccountOAuthToken_8900 addAccount err:" + JSON.stringify(err));
689
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
690 691 692 693
                appAccountManager.getAllOAuthTokens("account_callback_getAllOAuthTokens_test"," ",(err,ArrayData)=>{
                    console.debug("====>ActsAccountOAuthToken_8900 getAllOAuthTokens err:" + JSON.stringify(err));
                    console.debug("====>ActsAccountOAuthToken_8900 getAllOAuthTokens ArrayData:" + JSON.stringify(ArrayData));
                    expect(err.code!=0).assertEqual(true);
694
                    expect(ArrayData).assertEqual(null);
J
jiyong_sd 已提交
695 696
                    appAccountManager.deleteAccount("account_callback_getAllOAuthTokens_test",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_8900 deleteAccount err:" + JSON.stringify(err));
697
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713
                        console.debug("====>ActsAccountOAuthToken_8900 end====");
                        done();
                    });
                });
            });
        });




        it('ActsAccountOAuthToken_0100', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_0100 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_0100 addAccount start====");
            appAccountManager.addAccount("account_callback_normal",(err)=>{
                console.debug("====>ActsAccountOAuthToken_0100 addAccount err:" + JSON.stringify(err));
714
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
715 716
                appAccountManager.setOAuthToken("account_callback_normal","authType","callback_normal_token",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_0100 setOAuthToken err:" + JSON.stringify(err));
717
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
718 719 720
                    appAccountManager.getOAuthToken("account_callback_normal",OWNERSELF,"authType",(err,data)=>{
                        console.debug("====>ActsAccountOAuthToken_0100 getOAuthToken err:" + JSON.stringify(err));
                        console.debug("====>ActsAccountOAuthToken_0100 getOAuthToken data:" + data);
721
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
722 723 724 725
                        expect(data).assertEqual("callback_normal_token");
                        appAccountManager.checkOAuthTokenVisibility("account_callback_normal","authType",OWNERSELF,(err,stateBack)=>{
                            console.debug("====>ActsAccountOAuthToken_0100 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_0100 checkOAuthTokenVisibility stateBack:" + stateBack);
726
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
727 728 729
                            expect(stateBack).assertEqual(true);
                            appAccountManager.deleteOAuthToken("account_callback_normal",OWNERSELF,"authType","callback_normal_token",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_0100 deleteOAuthToken err:" + JSON.stringify(err));
730
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
731 732
                                appAccountManager.deleteAccount("account_callback_normal",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_0100 deleteAccount err:" + JSON.stringify(err));
733
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776
                                    console.debug("====>ActsAccountOAuthToken_0100 end====");
                                    done();
                                });
                            });
                        });
                    });
                });
            });
        });


        it('ActsAccountOAuthToken_0200', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_0200 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_0200 addAccount start====");
            await appAccountManager.addAccount("account_promise_normal");
            console.debug("====>ActsAccountOAuthToken_0200 setOAuthToken start====");
            await appAccountManager.setOAuthToken("account_promise_normal","authType","promise_normal_token");
            console.debug("====>ActsAccountOAuthToken_0200 getOAuthToken start====");
            var data1 = await appAccountManager.getOAuthToken("account_promise_normal",OWNERSELF,"authType");
            console.debug("====>getOAuthToken ActsAccountOAuthToken_0200 data:" + data1);
            expect(data1).assertEqual("promise_normal_token");
            console.debug("====>ActsAccountOAuthToken_0200 checkOAuthTokenVisibility start====");
            var state = await appAccountManager.checkOAuthTokenVisibility("account_promise_normal","authType",OWNERSELF);
            console.debug("====>checkOAuthTokenVisibility ActsAccountOAuthToken_0200 state:" + state);
            expect(state).assertEqual(true);
            console.debug("====>ActsAccountOAuthToken_0200 deleteOAuthToken start====");
            await appAccountManager.deleteOAuthToken("account_promise_normal",OWNERSELF,"authType","promise_normal_token");
            console.debug("====>ActsAccountOAuthToken_0200 deleteAccount start====");
            await appAccountManager.deleteAccount("account_promise_normal");
            console.debug("====>ActsAccountOAuthToken_0200 end====");
            done();
        });




        it('ActsAccountOAuthToken_0300', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_0300 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_0300 getOAuthToken start====");
            appAccountManager.addAccount("account_callback_noSetToken",(err)=>{
                console.debug("====>ActsAccountOAuthToken_0300 addAccount err:" + JSON.stringify(err));
777
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
778 779 780 781
                appAccountManager.getOAuthToken("account_callback_noSetToken",OWNERSELF,"authType",(err,data)=>{
                    console.debug("====>ActsAccountOAuthToken_0300 getOAuthToken err:" + JSON.stringify(err));
                    console.debug("====>ActsAccountOAuthToken_0300 getOAuthToken data:" + data);
                    expect(err.code!=0).assertEqual(true);
782
                    expect(data).assertEqual(null);
J
jiyong_sd 已提交
783 784
                    appAccountManager.deleteAccount("account_callback_noSetToken",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_0300 deleteAccount err:" + JSON.stringify(err));
785
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820
                        console.debug("====>ActsAccountOAuthToken_0300 end====");
                        done();
                    });
                });
            });
        });

        it('ActsAccountOAuthToken_0400', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_0400 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_0400 addAccount start====");
            await appAccountManager.addAccount("account_promise_noSetToken");
            console.debug("====>ActsAccountOAuthToken_0400 getOAuthToken start====");
            try{
                await appAccountManager.getOAuthToken("account_promise_noSetToken",OWNERSELF,"authType");
            }
            catch(err){
                console.debug("====>ActsAccountOAuthToken_0400 getOAuthToken err:" + JSON.stringify(err));
                expect(err.code!=0).assertEqual(true);
                console.debug("====>ActsAccountOAuthToken_0400 deleteAccount start====");
                await appAccountManager.deleteAccount("account_promise_noSetToken");
                console.debug("====>ActsAccountOAuthToken_0400 end====");
                done();
            }
        });


        it('ActsAccountOAuthToken_0500', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_0500 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_0500 getOAuthToken start====");
            appAccountManager.getOAuthToken("noAdd_account_callback",OWNERSELF,"authType",(err,data)=>{
                console.debug("====>ActsAccountOAuthToken_0500 getOAuthToken err:" + JSON.stringify(err));
                console.debug("====>ActsAccountOAuthToken_0500 getOAuthToken data:" + data);
                expect(err.code!=0).assertEqual(true);
821
                expect(data).assertEqual(null);
J
jiyong_sd 已提交
822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847
                done();
            });
        });

        it('ActsAccountOAuthToken_0600', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_0600 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_0600 getOAuthToken start====");
            try{
                await appAccountManager.getOAuthToken("noAdd_account_promise",OWNERSELF,"authType");
            }
            catch(err){
                console.debug("====>ActsAccountOAuthToken_0600 getOAuthToken err:" + JSON.stringify(err));
                expect(err.code!=0).assertEqual(true);
                console.debug("====>ActsAccountOAuthToken_0600 end====");
                done();
            }
        });


        it('ActsAccountOAuthToken_0700', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_0700 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_0700 addAccount start====");
            appAccountManager.addAccount("account_callback_setSameAuthType",(err)=>{
                console.debug("====>ActsAccountOAuthToken_0700 addAccount err:" + JSON.stringify(err));
848
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
849 850
                appAccountManager.setOAuthToken("account_callback_setSameAuthType","authType","callback_setSameAuthType_token",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_0700 setOAuthToken err:" + JSON.stringify(err));
851
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
852 853
                    appAccountManager.setOAuthToken("account_callback_setSameAuthType","authType","callback_setSameAuthType_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_0700 setOAuthToken err:" + JSON.stringify(err));
854
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
855 856 857
                        appAccountManager.getOAuthToken("account_callback_setSameAuthType",OWNERSELF,"authType",(err,data)=>{
                            console.debug("====>ActsAccountOAuthToken_0700 getOAuthToken err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_0700 getOAuthToken data:" + data);
858
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
859 860 861
                            expect(data).assertEqual("callback_setSameAuthType_token");
                            appAccountManager.setOAuthToken("account_callback_setSameAuthType","authType","callback_setSameAuthType_DiffToken",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_0700 setOAuthToken err:" + JSON.stringify(err));
862
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
863 864 865
                                appAccountManager.getOAuthToken("account_callback_setSameAuthType",OWNERSELF,"authType",(err,data)=>{
                                    console.debug("====>ActsAccountOAuthToken_0700 getOAuthToken err:" + JSON.stringify(err));
                                    console.debug("====>ActsAccountOAuthToken_0700 getOAuthToken data:" + data);
866
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
867 868 869
                                    expect(data).assertEqual("callback_setSameAuthType_DiffToken");
                                    appAccountManager.deleteAccount("account_callback_setSameAuthType",(err)=>{
                                        console.debug("====>ActsAccountOAuthToken_0700 deleteAccount err:" + JSON.stringify(err));
870
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914
                                        console.debug("====>ActsAccountOAuthToken_0700 end====");
                                        done();
                                    });
                                });
                            });   
                        });
                    });
                });
            });
        });




        it('ActsAccountOAuthToken_0800', 0, async function (done) {
            console.debug("====>ActsAccountOAuthToken_0800 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_0800 addAccount start====");
            await appAccountManager.addAccount("account_promise_setSameAuthType");
            console.debug("====>ActsAccountOAuthToken_0800 setOAuthToken start====");
            await appAccountManager.setOAuthToken("account_promise_setSameAuthType","authType","promise_setSameAuthType_token");
            console.debug("====>ActsAccountOAuthToken_0800 repeat setOAuthToken start====");
            await appAccountManager.setOAuthToken("account_promise_setSameAuthType","authType","promise_setSameAuthType_token");
            var data1 = await appAccountManager.getOAuthToken("account_promise_setSameAuthType",OWNERSELF,"authType");
            console.debug("====>getOAuthToken ActsAccountOAuthToken_0800 data:" + data1);
            expect(data1).assertEqual("promise_setSameAuthType_token");
            console.debug("====>ActsAccountOAuthToken_0800 repeat set diffToken setOAuthToken start====");
            await appAccountManager.setOAuthToken("account_promise_setSameAuthType","authType","promise_setSameAuthType_DiffToken");
            var data2 = await appAccountManager.getOAuthToken("account_promise_setSameAuthType",OWNERSELF,"authType");
            console.debug("====>getOAuthToken ActsAccountOAuthToken_0800 data:" + data2);
            expect(data2).assertEqual("promise_setSameAuthType_DiffToken");
            console.debug("====>ActsAccountOAuthToken_0800 deleteAccount start====");
            await appAccountManager.deleteAccount("account_promise_setSameAuthType");
            console.debug("====>ActsAccountOAuthToken_0800 end====");
            done();
        });



        it('ActsAccountOAuthToken_0900', 0, async function(done) {
            console.debug("====>ActsAccountOAuthToken_0900 start====");
            var appAccountManager = account.createAppAccountManager();
            appAccountManager.addAccount("account_callback_setDiff", (err)=>{
                console.debug("====>addAccount ActsAccountOAuthToken_0900 err:" + JSON.stringify(err));
915
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
916 917
                appAccountManager.setOAuthToken("account_callback_setDiff","authType1","callback_setDiff_token1",(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_0900 err:" + JSON.stringify(err));
918
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
919 920
                    appAccountManager.setOAuthToken("account_callback_setDiff","authType2","callback_setDiff_token2",(err)=>{
                        console.debug("====>getOAuthToken ActsAccountOAuthToken_0900 err:" + JSON.stringify(err));
921
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
922 923 924
                        appAccountManager.getOAuthToken("account_callback_setDiff",OWNERSELF,"authType1", (err, data)=>{
                            console.debug("====>getOAuthToken ActsAccountOAuthToken_0900 err:" + JSON.stringify(err));
                            console.debug("====>getOAuthToken ActsAccountOAuthToken_0900 data:" + data);
925
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
926 927 928 929
                            expect(data).assertEqual("callback_setDiff_token1");
                            appAccountManager.getOAuthToken("account_callback_setDiff",OWNERSELF,"authType2", (err, data)=>{
                                console.debug("====>getOAuthToken ActsAccountOAuthToken_0900 err:" + JSON.stringify(err));
                                console.debug("====>getOAuthToken ActsAccountOAuthToken_0900 data:" + data);
930
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
931 932 933
                                expect(data).assertEqual("callback_setDiff_token2");
                                appAccountManager.deleteAccount("account_callback_setDiff", (err)=>{
                                    console.debug("====>deleteAccount ActsAccountOAuthToken_0900 err:" + JSON.stringify(err));
934
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982
                                    console.debug("====>ActsAccountOAuthToken_0900 end====");
                                    done();
                                });   
                            });    
                        });
                    });
                });    
            });
        });



        it('ActsAccountOAuthToken_1000', 0, async function(done) {
            console.debug("====>ActsAccountOAuthToken_1000 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_1000 addAccount start====");
            await appAccountManager.addAccount("account_promise_setDiff");
            console.debug("====>setOAuthToken ActsAccountOAuthToken_1000 start====");
            await appAccountManager.setOAuthToken("account_promise_setDiff","aythType1","promise_setDiff_token1");
            console.debug("====>setOAuthToken ActsAccountOAuthToken_1000 start====");
            await appAccountManager.setOAuthToken("account_promise_setDiff","aythType2","promise_setDiff_token2");

            console.debug("====>getOAuthToken ActsAccountOAuthToken_1000 start====");
            var data1 = await appAccountManager.getOAuthToken("account_promise_setDiff",OWNERSELF,"aythType1");
            console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1000 data:" + data1);
            expect(data1).assertEqual("promise_setDiff_token1");
            console.debug("====>getOAuthToken ActsAccountOAuthToken_1000 start====");
            var data2 = await appAccountManager.getOAuthToken("account_promise_setDiff",OWNERSELF,"aythType2");
            console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1000 data:" + data2);
            expect(data2).assertEqual("promise_setDiff_token2");

            console.debug("====>deleteOAuthToken ActsAccountOAuthToken_1000 start====");
            await appAccountManager.deleteOAuthToken("account_promise_setDiff",OWNERSELF,"aythType1","promise_setDiff_token1");
            console.debug("====>deleteOAuthToken ActsAccountOAuthToken_1000 start====");
            await appAccountManager.deleteOAuthToken("account_promise_setDiff",OWNERSELF,"aythType2","promise_setDiff_token2");
            console.debug("====>ActsAccountOAuthToken_1000 deleteAccount start====");
            await appAccountManager.deleteAccount("account_promise_setDiff");
            console.debug("====>ActsAccountOAuthToken_1000 end====");
            done();
        });



        it('ActsAccountOAuthToken_1100', 0, async function(done) {
            console.debug("====>ActsAccountOAuthToken_1100 start====");
            var appAccountManager = account.createAppAccountManager();
            appAccountManager.addAccount("account_callback_setDeleteGet", (err)=>{
                console.debug("====>addAccount ActsAccountOAuthToken_1100 err:" + JSON.stringify(err));
983
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
984 985
                appAccountManager.setOAuthToken("account_callback_setDeleteGet","old_authType","callback_setDeleteGet_token",(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_1100 err:" + JSON.stringify(err));
986
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
987 988
                    appAccountManager.setOAuthToken("account_callback_setDeleteGet","new_authType","callback_setDeleteGet_token",(err)=>{
                        console.debug("====>getOAuthToken ActsAccountOAuthToken_1100 err:" + JSON.stringify(err));
989
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
990 991 992
                        appAccountManager.getOAuthToken("account_callback_setDeleteGet",OWNERSELF,"old_authType", (err, data)=>{
                            console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1100 err:" + JSON.stringify(err));
                            console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1100 data:" + data);
993
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
994 995 996 997
                            expect(data).assertEqual("callback_setDeleteGet_token");
                            appAccountManager.getOAuthToken("account_callback_setDeleteGet",OWNERSELF,"new_authType", (err, data)=>{
                                console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1100 err:" + JSON.stringify(err));
                                console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1100 data:" + data);
998
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
999 1000 1001 1002 1003 1004 1005
                                expect(data).assertEqual("callback_setDeleteGet_token");
                                appAccountManager.deleteOAuthToken("account_callback_setDeleteGet",OWNERSELF,"old_authType","callback_setDeleteGet_token",(err)=>{
                                    console.debug("====>deleteOAuthToken deleteOld ActsAccountOAuthToken_1100 err:" + JSON.stringify(err));
                                    appAccountManager.getOAuthToken("account_callback_setDeleteGet",OWNERSELF,"old_authType", (err, data)=>{
                                        console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1100 err:" + JSON.stringify(err));
                                        console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1100 data:" + data);
                                        expect(err.code!=0).assertEqual(true);
1006
                                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
1007 1008 1009
                                        appAccountManager.getOAuthToken("account_callback_setDeleteGet",OWNERSELF,"new_authType", (err, data)=>{
                                            console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1100 err:" + JSON.stringify(err));
                                            console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1100 data:" + data);
1010
                                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1011 1012 1013 1014 1015 1016 1017
                                            expect(data).assertEqual("callback_setDeleteGet_token");
                                            appAccountManager.deleteOAuthToken("account_callback_setDeleteGet",OWNERSELF,"new_authType","callback_setDeleteGet_token",(err)=>{
                                                console.debug("====>deleteOAuthToken deleteNew ActsAccountOAuthToken_1100 err:" + JSON.stringify(err));
                                                appAccountManager.getOAuthToken("account_callback_setDeleteGet",OWNERSELF,"old_authType", (err, data)=>{
                                                    console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1100 err:" + JSON.stringify(err));
                                                    console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1100 data:" + data);
                                                    expect(err.code!=0).assertEqual(true);
1018
                                                    expect(data).assertEqual(null);
J
jiyong_sd 已提交
1019 1020 1021 1022
                                                    appAccountManager.getOAuthToken("account_callback_setDeleteGet",OWNERSELF,"new_authType", (err, data)=>{
                                                        console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1100 err:" + JSON.stringify(err));
                                                        console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1100 data:" + data);
                                                        expect(err.code!=0).assertEqual(true);
1023
                                                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
1024 1025
                                                        appAccountManager.deleteAccount("account_callback_setDeleteGet", (err)=>{
                                                            console.debug("====>deleteAccount ActsAccountOAuthToken_1100 err:" + JSON.stringify(err));
1026
                                                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055
                                                            console.debug("====>ActsAccountOAuthToken_1100 end====");
                                                            done();
                                                        });   
                                                    });
                                                })
                                            });
                                        });
                                    });
                                });
                            });    
                        });
                    });
                });    
            });
        });


        it('ActsAccountOAuthToken_1200', 0, async function(done) {
            console.debug("====>ActsAccountOAuthToken_1200 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_1200 addAccount start====");
            await appAccountManager.addAccount("account_promise_setDeleteGet");

            console.debug("====>setOAuthToken setOld ActsAccountOAuthToken_1200 start====");
            await appAccountManager.setOAuthToken("account_promise_setDeleteGet","old_authType","promise_setDeleteGet_token");
            console.debug("====>setOAuthToken setNew ActsAccountOAuthToken_1200 start====");
            await appAccountManager.setOAuthToken("account_promise_setDeleteGet","new_authType","promise_setDeleteGet_token");

            console.debug("====>getOAuthToken ActsAccountOAuthToken_1200 start====");
1
15829070344 已提交
1056 1057
            var data1BeforeDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType");
            console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data1BeforeDel:" + data1BeforeDel);
J
jiyong_sd 已提交
1058 1059
            expect(data1_beforeDel).assertEqual("promise_setDeleteGet_token");
            console.debug("====>getOAuthToken ActsAccountOAuthToken_1200 start====");
1
15829070344 已提交
1060 1061 1062
            var data2BeforeDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"new_authType");
            console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1200 data2BeforeDel:" + data2BeforeDel);
            expect(data2beforeDel).assertEqual("promise_setDeleteGet_token");
J
jiyong_sd 已提交
1063 1064 1065 1066 1067 1068 1069

            console.debug("====>deleteOAuthToken deleteOld ActsAccountOAuthToken_1200 start====");
            try{
                await appAccountManager.deleteOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType","promise_setDeleteGet_token");
            }
            catch(err){
                console.debug("====>deleteOAuthToken ActsAccountOAuthToken_1200 err:" + JSON.stringify(err));
1070
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
1071 1072 1073 1074
            }

            console.debug("====>getOAuthToken ActsAccountOAuthToken_1200 start====");
            try{
1
15829070344 已提交
1075 1076
                var data1AfterDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType",);
                console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data1_AfterDel:" + data1AfterDel);
1077
                expect().assertFail();
J
jiyong_sd 已提交
1078 1079 1080
            }
            catch(err){
                console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 err:" + JSON.stringify(err));
1081
                expect(err.code!=0).assertEqual(true);                
J
jiyong_sd 已提交
1082 1083 1084 1085
            }
            console.debug("====>getOAuthToken ActsAccountOAuthToken_1200 start====");
            try{
                var data2_AfterDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"new_authType",);
1
15829070344 已提交
1086 1087
                console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data2_AfterDel:" + data2AfterDel);
                expect(data2AfterDel).assertEqual("promise_setDeleteGet_token");
J
jiyong_sd 已提交
1088 1089 1090
            }
            catch(err){
                console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1200 err:" + JSON.stringify(err));
1091
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
1092 1093 1094 1095 1096 1097 1098
            }
            console.debug("====>deleteOAuthToken deleteNew ActsAccountOAuthToken_1200 start====");
            try{
                await appAccountManager.deleteOAuthToken("account_promise_setDeleteGet",OWNERSELF,"new_authType","promise_setDeleteGet_token");
            }
            catch(err){
                console.debug("====>deleteOAuthToken ActsAccountOAuthToken_1200 err:" + JSON.stringify(err));
1099
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
1100 1101 1102 1103
            }

            console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 start====");
            try{
1
15829070344 已提交
1104 1105
                var data1AgainDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType",);
                console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data1_AgainDel:" + data1AgainDel);
1106
                expect().assertFail();
J
jiyong_sd 已提交
1107 1108 1109 1110 1111 1112 1113
            }
            catch(err){
                console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 err:" + JSON.stringify(err));
                expect(err.code!=0).assertEqual(true);
            }
            console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1200 start====");
            try{
1
15829070344 已提交
1114 1115
                var data2AgainDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"new_authType",);
                console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data2_AgainDel:" + data2AgainDel);
1116
                expect().assertFail();
J
jiyong_sd 已提交
1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133
            }
            catch(err){
                console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1200 err:" + JSON.stringify(err));
                expect(err.code!=0).assertEqual(true);
            }
            await appAccountManager.deleteAccount("account_promise_setDeleteGet");
            console.debug("====>ActsAccountOAuthToken_1200 end====");
            done();

        });


        it('ActsAccountOAuthToken_1300', 0, async function(done) {
            console.debug("====>ActsAccountOAuthToken_1300 start====");
            var appAccountManager = account.createAppAccountManager();
            appAccountManager.addAccount("account_callback_setDeleteGet", (err)=>{
            console.debug("====>addAccount ActsAccountOAuthToken_1300 err:" + JSON.stringify(err));
1134
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1135 1136
                appAccountManager.setOAuthToken("account_callback_setDeleteGet","authType","account_callback_setDeleteGet_token",(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_1300 err:" + JSON.stringify(err));
1137
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1138 1139
                    appAccountManager.deleteOAuthToken("account_callback_setDeleteGet",OWNERSELF,"authType","account_callback_setDeleteGet_token",(err)=>{
                        console.debug("====>deleteOAuthToken ActsAccountOAuthToken_1300 err:" + JSON.stringify(err));
1140
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1141 1142 1143 1144
                        appAccountManager.getOAuthToken("account_callback_setDeleteGet",OWNERSELF,"authType", (err, data)=>{
                            console.debug("====>getOAuthToken ActsAccountOAuthToken_1300 err:" + JSON.stringify(err));
                            console.debug("====>getOAuthToken ActsAccountOAuthToken_1300 data:" + data);
                            expect(err.code != 0).assertEqual(true);
1145
                            expect(data).assertEqual(null);
J
jiyong_sd 已提交
1146 1147
                            appAccountManager.deleteAccount("account_callback_setDeleteGet", (err)=>{
                                console.debug("====>deleteAccount ActsAccountOAuthToken_1300 err:" + JSON.stringify(err));
1148
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244
                                console.debug("====>ActsAccountOAuthToken_1300 end====");
                                done();
                            });
                        });
                    });
                });
            });
        });


        it('ActsAccountOAuthToken_1400', 0, async function(done) {
            console.debug("====>ActsAccountOAuthToken_1400 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_1400 addAccount start====");
            await appAccountManager.addAccount("account_promise_setDeleteGet");
            console.debug("====>setOAuthToken ActsAccountOAuthToken_1400 start====");
            await appAccountManager.setOAuthToken("account_promise_setDeleteGet","authType","promise_setDeleteGet_token");
            console.debug("====>deleteOAuthToken ActsAccountOAuthToken_1400 start====");
            await appAccountManager.deleteOAuthToken("account_promise_setDeleteGet",OWNERSELF,"authType","promise_setDeleteGet_token");
            console.debug("====>getOAuthToken ActsAccountOAuthToken_1400 start====");
            try{
                var data = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"authType");
            }
            catch(err){
                console.debug("====>getOAuthToken ActsAccountOAuthToken_1400 err:" + JSON.stringify(err));
                expect(err.code != 0).assertEqual(true);
                console.debug("====>getOAuthToken ActsAccountOAuthToken_1400 data:" + data);
                console.debug("====>ActsAccountOAuthToken_1400 deleteAccount start====");
                await appAccountManager.deleteAccount("account_promise_setDeleteGet");
                console.debug("====>ActsAccountOAuthToken_1400 end====");
                done();
            }
        });


        it('ActsAccountOAuthToken_1500', 0, async function(done) {
            console.debug("====>ActsAccountOAuthToken_1500 start====");
            var appAccountManager = account.createAppAccountManager();
            appAccountManager.setOAuthToken("account_callback_accountNotExit","authType","account_callback_accountNotExit_token", (err)=>{
                console.debug("====>setOAuthToken ActsAccountOAuthToken_1500 err:" + JSON.stringify(err));
                expect(err.code!=0).assertEqual(true);
                console.debug("====>ActsAccountOAuthToken_1500 end====");
                done();
            });
        });

        it('ActsAccountOAuthToken_1600', 0, async function(done) {
            console.debug("====>ActsAccountOAuthToken_1600 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>setOAuthToken ActsAccountOAuthToken_1600 start====");
            try{
                await appAccountManager.setOAuthToken("account_promise_accountNotExit","authType","account_promise_accountNotExit_token");
            }
            catch(err){
                console.debug("====>setOAuthToken ActsAccountOAuthToken_1600 err:" + JSON.stringify(err));
                expect(err.code != 0).assertEqual(true);
                console.debug("====>ActsAccountOAuthToken_1600 end====");
                done();
            }
        });



        it('ActsAccountOAuthToken_1700', 0, async function(done) {
            console.debug("====>ActsAccountOAuthToken_1700 start====");
            var appAccountManager = account.createAppAccountManager();
            appAccountManager.deleteOAuthToken("account_callback_accountNotExit",OWNERSELF,"authType","account_callback_accountNotExit_token", (err)=>{
                console.debug("====>deleteOAuthToken ActsAccountOAuthToken_1700 err:" + JSON.stringify(err));
                expect(err.code!=0).assertEqual(true);
                console.debug("====>ActsAccountOAuthToken_1700 end====");
                done();
            });
        });

        it('ActsAccountOAuthToken_1800', 0, async function(done) {
            console.debug("====>ActsAccountOAuthToken_1800 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>deleteOAuthToken ActsAccountOAuthToken_1800 start====");
            try{
                await appAccountManager.deleteOAuthToken("account_promise_accountNotExit",OWNERSELF,"authType","account_promise_accountNotExit_token");
            }
            catch(err){
                console.debug("====>deleteOAuthToken ActsAccountOAuthToken_1800 err:" + JSON.stringify(err));
                expect(err.code != 0).assertEqual(true);
                console.debug("====>ActsAccountOAuthToken_1800 end====");
                done();
            }
        });



        it('ActsAccountOAuthToken_1900', 0, async function(done) {
            console.debug("====>ActsAccountOAuthToken_1900 start====");
            var appAccountManager = account.createAppAccountManager();
            appAccountManager.addAccount("account_callback_repeatDelete", (err)=>{
                console.debug("====>addAccount ActsAccountOAuthToken_1900 err:" + JSON.stringify(err));
1245
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
1246 1247 1248 1249 1250 1251
                appAccountManager.deleteOAuthToken("account_callback_repeatDelete",OWNERSELF,"aythType","promise_repeatDelete_token",(err)=>{
                    console.debug("====>deleteOAuthToken  ActsAccountOAuthToken_1900 err:" + JSON.stringify(err));
                    appAccountManager.getOAuthToken("account_callback_repeatDelete",OWNERSELF,"authType", (err, data)=>{
                        console.debug("====>getOAuthToken ActsAccountOAuthToken_1900 err:" + JSON.stringify(err));
                        console.debug("====>getOAuthToken ActsAccountOAuthToken_1900 data:" + data);
                        expect(err.code != 0).assertEqual(true);
1252
                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
1253 1254
                        appAccountManager.deleteAccount("account_callback_repeatDelete", (err)=>{
                            console.debug("====>deleteAccount ActsAccountOAuthToken_1900 err:" + JSON.stringify(err));
1255
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293
                            console.debug("====>ActsAccountOAuthToken_1900 end====");
                            done();
                        });
                    });
                });
            });
        });


        it('ActsAccountOAuthToken_2000', 0, async function(done) {
            console.debug("====>ActsAccountOAuthToken_2000 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_2000 addAccount start====");
            await appAccountManager.addAccount("account_promise_noExitToken");
            console.debug("====>deleteOAuthToken ActsAccountOAuthToken_2000 start====");
            await appAccountManager.deleteOAuthToken("account_promise_noExitToken",OWNERSELF,"aythType","test_token").catch((err)=>{
            console.debug("====>deleteOAuthToken ActsAccountOAuthToken_2000 err:" + JSON.stringify(err));
            });
            console.debug("====>getOAuthToken ActsAccountOAuthToken_2000 start====");
            try{
                var data = await appAccountManager.getOAuthToken("account_promise_noExitToken",OWNERSELF,"authType");
            }
            catch(err){
                console.debug("====>getOAuthToken ActsAccountOAuthToken_2000 err:" + JSON.stringify(err));
                expect(err.code != 0).assertEqual(true);
                console.debug("====>ActsAccountOAuthToken_2000 deleteAccount start====");
                await appAccountManager.deleteAccount("account_promise_noExitToken");
                console.debug("====>ActsAccountOAuthToken_2000 end====");
                done();
            }
        });


        it('ActsAccountOAuthToken_2100', 0, async function(done) {
            console.debug("====>ActsAccountOAuthToken_2100 start====");
            var appAccountManager = account.createAppAccountManager();
            appAccountManager.addAccount("account_callback_repeatDelete", (err)=>{
            console.debug("====>addAccount ActsAccountOAuthToken_2100 err:" + JSON.stringify(err));
1294
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1295 1296
                appAccountManager.setOAuthToken("account_callback_repeatDelete","authType","",(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_2100 err:" + JSON.stringify(err));
1297
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1298 1299 1300 1301 1302 1303
                    appAccountManager.deleteOAuthToken("account_callback_repeatDelete",OWNERSELF,"aythType","promise_repeatDelete_token",(err)=>{
                        console.debug("====>deleteOAuthToken first ActsAccountOAuthToken_2100 err:" + JSON.stringify(err));
                        appAccountManager.getOAuthToken("account_callback_repeatDelete",OWNERSELF,"authType", (err, data)=>{
                            console.debug("====>getOAuthToken first ActsAccountOAuthToken_2100 err:" + JSON.stringify(err));
                            console.debug("====>getOAuthToken first ActsAccountOAuthToken_2100 data:" + data);
                            expect(err.code != 0).assertEqual(true);
1304
                            expect(data).assertEqual(null);
J
jiyong_sd 已提交
1305 1306 1307 1308 1309 1310
                            appAccountManager.deleteOAuthToken("account_callback_repeatDelete",OWNERSELF,"aythType","promise_repeatDelete_token",(err)=>{
                                console.debug("====>deleteOAuthToken second ActsAccountOAuthToken_2100 err:" + JSON.stringify(err));
                                appAccountManager.getOAuthToken("account_callback_repeatDelete",OWNERSELF,"authType", (err, data)=>{
                                    console.debug("====>getOAuthToken second ActsAccountOAuthToken_2100 err:" + JSON.stringify(err));
                                    console.debug("====>getOAuthToken second ActsAccountOAuthToken_2100 data:" + data);
                                    expect(err.code != 0).assertEqual(true);
1311
                                    expect(data).assertEqual(null);
J
jiyong_sd 已提交
1312 1313
                                    appAccountManager.deleteAccount("account_callback_repeatDelete", (err)=>{
                                        console.debug("====>deleteAccount ActsAccountOAuthToken_2100 err:" + JSON.stringify(err));
1314
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358
                                        console.debug("====>ActsAccountOAuthToken_2100 end====");
                                        done();
                                    });
                                });
                            });
                        });
                    });
                });
            });
        });



        it('ActsAccountOAuthToken_2200', 0, async function(done) {
            console.debug("====>ActsAccountOAuthToken_2200 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_2200 addAccount start====");
            await appAccountManager.addAccount("account_promise_repeatDelete");
            console.debug("====>setOAuthToken ActsAccountOAuthToken_2200 start====");
            await appAccountManager.setOAuthToken("account_promise_repeatDelete","aythType","promise_repeatDelete_token");
            console.debug("====>deleteOAuthToken first ActsAccountOAuthToken_2200 start====");
            await appAccountManager.deleteOAuthToken("account_promise_repeatDelete",OWNERSELF,"aythType","promise_repeatDelete_token");
            console.debug("====>deleteOAuthToken second ActsAccountOAuthToken_2200 start====");
            await appAccountManager.deleteOAuthToken("account_promise_repeatDelete",OWNERSELF,"aythType","promise_repeatDelete_token");
            console.debug("====>getOAuthToken ActsAccountOAuthToken_2200 start====");
            try{
                var data = await appAccountManager.getOAuthToken("account_promise_repeatDelete",OWNERSELF,"authType");
            }
            catch(err){
                console.debug("====>getOAuthToken ActsAccountOAuthToken_2200 err:" + JSON.stringify(err));
                expect(err.code != 0).assertEqual(true);
                console.debug("====>ActsAccountOAuthToken_2200 deleteAccount start====");
                await appAccountManager.deleteAccount("account_promise_repeatDelete");
                console.debug("====>ActsAccountOAuthToken_2200 end====");
                done();
            }
        });


        it('ActsAccountOAuthToken_2300', 0, async function(done) {
            console.debug("====>ActsAccountOAuthToken_2300 start====");
            var appAccountManager = account.createAppAccountManager();
            appAccountManager.addAccount("account_callback_setEmptyToken", (err)=>{
            console.debug("====>addAccount ActsAccountOAuthToken_2300 err:" + JSON.stringify(err));
1359
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1360 1361
                appAccountManager.setOAuthToken("account_callback_setEmptyToken","authType","",(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_2300 err:" + JSON.stringify(err));
1362
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1363 1364 1365 1366
                    appAccountManager.getOAuthToken("account_callback_setEmptyToken",OWNERSELF,"authType", (err, data)=>{
                        console.debug("====>getOAuthToken ActsAccountOAuthToken_2300 err:" + JSON.stringify(err));
                        console.debug("====>getOAuthToken ActsAccountOAuthToken_2300 data:" + data);
                        expect(err.code != 0).assertEqual(true);
1367
                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
1368 1369
                        appAccountManager.deleteAccount("account_callback_setEmptyToken", (err)=>{
                            console.debug("====>deleteAccount ActsAccountOAuthToken_2300 err:" + JSON.stringify(err));
1370
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407
                            console.debug("====>ActsAccountOAuthToken_2300 end====");
                            done();
                        });
                    });
                });
            });
        });


        it('ActsAccountOAuthToken_2400', 0, async function(done) {
            console.debug("====>ActsAccountOAuthToken_2400 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_2400 addAccount start====");
            await appAccountManager.addAccount("account_promise_setEmptyToken");
            console.debug("====>setOAuthToken ActsAccountOAuthToken_2400 start====");
            await appAccountManager.setOAuthToken("account_promise_setEmptyToken","aythType","");
            console.debug("====>getOAuthToken ActsAccountOAuthToken_2400 start====");
            try{
                await appAccountManager.getOAuthToken("account_promise_setEmptyToken","authType",limitToken);
            }
            catch(err){
                console.debug("====>getOAuthToken ActsAccountOAuthToken_2400 err:" + JSON.stringify(err));
                expect(err.code != 0).assertEqual(true);
                console.debug("====>ActsAccountOAuthToken_2400 deleteAccount start====");
                await appAccountManager.deleteAccount("account_promise_setEmptyToken");
                console.debug("====>ActsAccountOAuthToken_2400 end====");
                done();
            }
        });



        it('ActsAccountOAuthToken_2500', 0, async function(done) {
            console.debug("====>ActsAccountOAuthToken_2500 start====");
            var appAccountManager = account.createAppAccountManager();
            appAccountManager.addAccount("account_callback_spaceToken", (err)=>{
            console.debug("====>addAccount ActsAccountOAuthToken_2500 err:" + JSON.stringify(err));
1408
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1409 1410
                appAccountManager.setOAuthToken("account_callback_spaceToken","authType"," ",(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_2500 err:" + JSON.stringify(err));
1411
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1412 1413 1414
                    appAccountManager.getOAuthToken("account_callback_spaceToken",OWNERSELF,"authType", (err, data)=>{
                        console.debug("====>getOAuthToken ActsAccountOAuthToken_2500 err:" + JSON.stringify(err));
                        console.debug("====>getOAuthToken ActsAccountOAuthToken_2500 data:" + data);
1415
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1416 1417 1418
                        expect(data).assertEqual(" ");
                        appAccountManager.deleteAccount("account_callback_spaceToken", (err)=>{
                            console.debug("====>deleteAccount ActsAccountOAuthToken_2500 err:" + JSON.stringify(err));
1419
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455
                            console.debug("====>ActsAccountOAuthToken_2500 end====");
                            done();
                        });
                    });
                });
            });
        });


        it('ActsAccountOAuthToken_2600', 0, async function(done) {
            console.debug("====>ActsAccountOAuthToken_2600 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_2600 addAccount start====");
            await appAccountManager.addAccount("account_promise_spaceToken");
            console.debug("====>setOAuthToken ActsAccountOAuthToken_2600 start====");
            await appAccountManager.setOAuthToken("account_promise_spaceToken","aythType"," ");
            console.debug("====>getOAuthToken ActsAccountOAuthToken_2600 start====");
            var data = await appAccountManager.getOAuthToken("account_promise_spaceToken",OWNERSELF,"aythType");
            expect(data).assertEqual(" ");
            console.debug("====>ActsAccountOAuthToken_2600 deleteAccount start====");
            await appAccountManager.deleteAccount("account_promise_spaceToken");
            console.debug("====>ActsAccountOAuthToken_2600 end====");
            done();
        });



        it('ActsAccountOAuthToken_2700', 0, async function(done) {
            var limitToken = '';
                for (let i = 0; i < TOKENLENGTHLIMIT + 1; i++) {
                    limitToken += 't';
                }
            console.debug("====>ActsAccountOAuthToken_2700 start====");
            var appAccountManager = account.createAppAccountManager();
            appAccountManager.addAccount("account_callback_exceed_limitToken", (err)=>{
            console.debug("====>addAccount ActsAccountOAuthToken_2700 err:" + JSON.stringify(err));
1456
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1457 1458 1459 1460 1461
                appAccountManager.setOAuthToken("account_callback_exceed_limitToken","authType",limitToken,(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_2700 err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    appAccountManager.deleteAccount("account_callback_exceed_limitToken", (err)=>{
                        console.debug("====>deleteAccount ActsAccountOAuthToken_2700 err:" + JSON.stringify(err));
1462
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503
                        console.debug("====>ActsAccountOAuthToken_2700 end====");
                        done();
                    });
                });
            });
        });


        it('ActsAccountOAuthToken_2800', 0, async function(done) {
            var limitToken = '';
                for (let i = 0; i < TOKENLENGTHLIMIT + 1; i++) {
                    limitToken += 't';
                }
            console.debug("====>ActsAccountOAuthToken_2800 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_2800 addAccount start====");
            await appAccountManager.addAccount("account_promise_exceed_limitToken");
            console.debug("====>setOAuthToken ActsAccountOAuthToken_2800 start====");
            try{
                await appAccountManager.setOAuthToken("account_promise_exceed_limitToken","authType",limitToken);
            }
            catch(err){
                console.debug("====>setOAuthToken ActsAccountOAuthToken_2800 err:" + JSON.stringify(err));
                expect(err.code != 0).assertEqual(true);
                console.debug("====>ActsAccountOAuthToken_2800 deleteAccount start====");
                appAccountManager.deleteAccount("account_promise_exceed_limitToken");
                console.debug("====>ActsAccountOAuthToken_2800 end====");
                done();
            }
        });


        it('ActsAccountOAuthToken_2900', 0, async function(done) {
            var limitToken = '';
                for (let i = 0; i < TOKENLENGTHLIMIT; i++) {
                    limitToken += 't';
                }
            console.debug("====>ActsAccountOAuthToken_2900 start====");
            var appAccountManager = account.createAppAccountManager();
            appAccountManager.addAccount("account_callback_limitToken", (err)=>{
            console.debug("====>addAccount ActsAccountOAuthToken_2900 err:" + JSON.stringify(err));
1504
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1505 1506
                appAccountManager.setOAuthToken("account_callback_limitToken","authType",limitToken,(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_2900 err:" + JSON.stringify(err));
1507
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1508 1509 1510
                    appAccountManager.getOAuthToken("account_callback_limitToken",OWNERSELF,"authType", (err, data)=>{
                        console.debug("====>getOAuthToken ActsAccountOAuthToken_2900 err:" + JSON.stringify(err));
                        console.debug("====>getOAuthToken ActsAccountOAuthToken_2900 data:" + data);
1511
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1512 1513 1514
                        expect(data).assertEqual(limitToken);
                        appAccountManager.deleteAccount("account_callback_limitToken", (err)=>{
                            console.debug("====>deleteAccount ActsAccountOAuthToken_2900 err:" + JSON.stringify(err));
1515
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554
                            console.debug("====>ActsAccountOAuthToken_2900 end====");
                            done();
                        });
                    });
                });
            });
        });


        it('ActsAccountOAuthToken_3000', 0, async function(done) {
            var limitToken = '';
                for (let i = 0; i < TOKENLENGTHLIMIT; i++) {
                    limitToken += 't';
                }
            console.debug("====>ActsAccountOAuthToken_3000 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_3000 addAccount start====");
            await appAccountManager.addAccount("account_promise_limitToken");
            console.debug("====>setOAuthToken ActsAccountOAuthToken_3000 start====");
            await appAccountManager.setOAuthToken("account_promise_limitToken","authType",limitToken);
            console.debug("====>getOAuthToken ActsAccountOAuthToken_3000 start====");
            var data = await appAccountManager.getOAuthToken("account_promise_limitToken",OWNERSELF,"authType");
            expect(data).assertEqual(limitToken);
            console.debug("====>ActsAccountOAuthToken_3000 deleteAccount start====");
            await appAccountManager.deleteAccount("account_promise_limitToken");
            console.debug("====>ActsAccountOAuthToken_3000 end====");
            done();
        });


        it('ActsAccountOAuthToken_3100', 0, async function(done) {
            var limitAuthType = '';
                for (let i = 0; i < AUTHTYPELENGTHLIMIT + 1; i++) {
                    limitAuthType += 't';
                }
            console.debug("====>ActsAccountOAuthToken_3100 start====");
            var appAccountManager = account.createAppAccountManager();
            appAccountManager.addAccount("account_callback_limitAuthType", (err)=>{
            console.debug("====>addAccount ActsAccountOAuthToken_3100 err:" + JSON.stringify(err));
1555
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1556 1557 1558 1559 1560
                appAccountManager.setOAuthToken("account_callback_limitAuthType",limitAuthType,"account_callback_limitAuthType_token",(err, data)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_3100 err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    appAccountManager.deleteAccount("account_callback_limitAuthType", (err)=>{
                        console.debug("====>deleteAccount ActsAccountOAuthToken_3100 err:" + JSON.stringify(err));
1561
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603
                        console.debug("====>ActsAccountOAuthToken_3100 end====");
                        done();
                    });
                });
            });
        });


        it('ActsAccountOAuthToken_3200', 0, async function(done) {
            var limitAuthType = '';
                for (let i = 0; i < AUTHTYPELENGTHLIMIT + 1; i++) {
                    limitAuthType += 't';
                }
            console.debug("====>ActsAccountOAuthToken_3400 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_3400 addAccount start====");
            await appAccountManager.addAccount("account_promise_exceed_limitAuthType");
            console.debug("====>setOAuthToken ActsAccountOAuthToken_3400 start====");
            try{
                await appAccountManager.setOAuthToken("account_promise_exceed_limitAuthType",limitAuthType,"account_promise_limitAuthType_token");
            }
            catch(err){
                console.debug("====>setOAuthToken ActsAccountOAuthToken_3400 err:" + JSON.stringify(err));
                expect(err.code != 0).assertEqual(true);
                console.debug("====>ActsAccountOAuthToken_3400 deleteAccount start====");
                appAccountManager.deleteAccount("account_promise_exceed_limitAuthType");
                console.debug("====>ActsAccountOAuthToken_3400 end====");
                done();
            }
        });



        it('ActsAccountOAuthToken_3300', 0, async function(done) {
            var limitAuthType = '';
                for (let i = 0; i < AUTHTYPELENGTHLIMIT + 1; i++) {
                    limitAuthType += 't';
                }
            console.debug("====>ActsAccountOAuthToken_3300 start====");
            var appAccountManager = account.createAppAccountManager();
            appAccountManager.addAccount("account_callback_limitAuthType", (err)=>{
            console.debug("====>addAccount ActsAccountOAuthToken_3300 err:" + JSON.stringify(err));
1604
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1605 1606 1607 1608 1609 1610
                appAccountManager.getOAuthToken("account_callback_limitAuthType","com.example.actsaccounttest",limitAuthType, (err, data)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_3300 err:" + JSON.stringify(err));
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_3300 data:" + data);
                    expect(err.code!=0).assertEqual(true);
                    appAccountManager.deleteAccount("account_callback_limitAuthType", (err)=>{
                        console.debug("====>deleteAccount ActsAccountOAuthToken_3300 err:" + JSON.stringify(err));
1611
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658
                        console.debug("====>ActsAccountOAuthToken_3300 end====");
                        done();
                    });
                });
            });
        });

        it('ActsAccountOAuthToken_3400', 0, async function(done) {
            var limitAuthType = '';
                for (let i = 0; i < AUTHTYPELENGTHLIMIT + 1; i++) {
                    limitAuthType += 't';
                }
            console.debug("====>ActsAccountOAuthToken_3400 start====");
            var appAccountManager = account.createAppAccountManager();
            console.debug("====>ActsAccountOAuthToken_3400 addAccount start====");
            await appAccountManager.addAccount("account_promise_limitAuthType");
            console.debug("====>getOAuthToken ActsAccountOAuthToken_3400 start====");
            try{
                await appAccountManager.getOAuthToken("account_promise_limitAuthType",OWNERSELF,limitAuthType);
            }
            catch(err){
                console.debug("====>getOAuthToken ActsAccountOAuthToken_3400 err:" + JSON.stringify(err));
                expect(err.code != 0).assertEqual(true);
                console.debug("====>ActsAccountOAuthToken_3400 deleteAccount start====");
                appAccountManager.deleteAccount("account_promise_limitAuthType");
                console.debug("====>ActsAccountOAuthToken_3400 end====");
                done();
            }
        });



            /*
        * @tc.number     : ActsAccountOAuthToken_2700
        * @tc.name       : Test oauth token in callback form
        * @tc.desc       : 设置一个authType长度刚好为限制长度的token  查询
        */
            it('ActsAccountOAuthToken_3500', 0, async function(done) {
                console.debug("====>ActsAccountOAuthToken_3500 start====");
                var limitAuthType = '';
                for (let i = 0; i < AUTHTYPELENGTHLIMIT; i++) {
                    limitAuthType += 't';
                }
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_3500 create finish====");
                appAccountManager.addAccount("account_callback_limitAuthType", (err)=>{
                    console.debug("====>add account ActsAccountOAuthToken_3500 err:" + JSON.stringify(err));
1659
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1660 1661
                    appAccountManager.setOAuthToken("account_callback_limitAuthType",limitAuthType,"account_callback_limitAuthType_token", (err)=>{
                        console.debug("====>setOAuthToken ActsAccountOAuthToken_3500 err:" + JSON.stringify(err));
1662
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1663 1664 1665
                        appAccountManager.getOAuthToken("account_callback_limitAuthType","com.example.actsaccounttest",limitAuthType, (err, data)=>{
                            console.debug("====>getOAuthToken ActsAccountOAuthToken_3500 err:" + JSON.stringify(err));
                            console.debug("====>getOAuthToken ActsAccountOAuthToken_3500 data:" + data);
1666
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1667 1668 1669
                            expect(data).assertEqual("account_callback_limitAuthType_token");
                            appAccountManager.deleteAccount("account_callback_limitAuthType", (err)=>{
                                console.debug("====>delete Account ActsAccountOAuthToken_3500 err:" + JSON.stringify(err));
1670
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815
                                console.debug("====>ActsAccountOAuthToken_3500 end====");
                                done();
                            });
                        });
                    });
                });
            });
            
            /*
            * @tc.number     : ActsAccountOAuthToken_2800
            * @tc.name       : Test oauth token in promise form
            * @tc.desc       : 设置一个authType长度刚好为限制长度的token
            */
            
            /*
            * @tc.number     : ActsAccountOAuthToken_2900
            * @tc.name       : Test oauth token in callback form
            * @tc.desc       : Clear token parameter name is an empty string
            */
            //测试 删除一个账号名为空的token callback方式
            it('ActsAccountOAuthToken_4100', 0, async function(done) {
                console.debug("====>ActsAccountOAuthToken_4100 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_4100 create finish====");
                appAccountManager.deleteOAuthToken(" ","com.example.actsaccounttest","authType","account_notExist_token", (err)=>{
                    console.debug("====>clearOAuthToken ActsAccountOAuthToken_4100 err:" + JSON.stringify(err));
                    expect(err.code != 0).assertEqual(true);
                    console.debug("====>ActsAccountOAuthToken_4100 end====");
                    done();
                });
            });
            
            /*
            * @tc.number     : ActsAccountOAuthToken_3000
            * @tc.name       : Test oauth token in promise form
            * @tc.desc       : Clear token parameter name is an empty string
            */
            //测试 删除一个账号名为空的token promise方式
            it('ActsAccountOAuthToken_4200', 0, async function(done) {
                console.debug("====>ActsAccountOAuthToken_4200 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_4200 create finish====");
                console.debug("====>clearOAuthToken ActsAccountOAuthToken_4200 start====");
                try{
                    await appAccountManager.deleteOAuthToken("","com.example.actsaccounttest","authType","account_notExist_token");
                }
                catch(err){
                    console.debug("====>deleteOAuthToken ActsAccountOAuthToken_4200 err:" + JSON.stringify(err));
                    expect(err.code != 0).assertEqual(true);
                    console.debug("====>ActsAccountOAuthToken_4200 end====");
                    done();
                }
            });
            
            /*
            * @tc.number     : ActsAccountOAuthToken_3100
            * @tc.name       : Test oauth token in callback form
            * @tc.desc       : The clear token parameter name is a space string
            */
            it('ActsAccountOAuthToken_4300', 0, async function(done) {
                console.debug("====>ActsAccountOAuthToken_4300 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_4300 create finish====");
                appAccountManager.deleteOAuthToken(" ","com.example.actsaccounttest","authType","account_notExist_token", (err)=>{
                    console.debug("====>clearOAuthToken ActsAccountOAuthToken_4300 err:" + JSON.stringify(err));
                    expect(err.code != 0).assertEqual(true);
                    console.debug("====>ActsAccountOAuthToken_4300 end====");
                    done();
                });
            });
            
            /*
            * @tc.number     : ActsAccountOAuthToken_3200
            * @tc.name       : Test oauth token in promise form
            * @tc.desc       : The clear token parameter name is a space string
            */
            it('ActsAccountOAuthToken_4400', 0, async function(done) {
                console.debug("====>ActsAccountOAuthToken_4400 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_4400 create finish====");
                console.debug("====>clearOAuthToken ActsAccountOAuthToken_4400 start====");
                try{
                    await appAccountManager.deleteOAuthToken(" ","com.example.actsaccounttest","authType","account_notExist_token");
                }
                catch(err){
                    console.debug("====>deleteOAuthToken ActsAccountOAuthToken_4400 err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    console.debug("====>ActsAccountOAuthToken_4400 end====");
                    done();
                }
            });
        
            /*
            * @tc.number     : ActsAccountOAuthToken_3300
            * @tc.name       : Test oauth token in callback form
            * @tc.desc       : Clear the token parameter name exceeds the length limit of 1024 characters
            */
            it('ActsAccountOAuthToken_4500', 0, async function(done) {
                console.debug("====>ActsAccountOAuthToken_4500 start====");
                var nameLimit = '';
                for (let i = 0; i < LENGTHLIMIT + 1; i++) {
                    nameLimit += 't';
                }
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_4500 create finish====");
                appAccountManager.deleteOAuthToken(nameLimit,"com.example.actsaccounttest","authType","account_notExist_token", (err)=>{
                    console.debug("====>clearOAuthToken ActsAccountOAuthToken_4500 err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    console.debug("====>ActsAccountOAuthToken_4500 end====");
                    done();
                });
            });
        
            /*
            * @tc.number     : ActsAccountOAuthToken_3400
            * @tc.name       : Test oauth token in promise form
            * @tc.desc       : Clear the token parameter name exceeds the length limit of 1024 characters
            */
            it('ActsAccountOAuthToken_4600', 0, async function(done) {
                console.debug("====>ActsAccountOAuthToken_4600 start====");
                var nameLimit = '';
                for (let i = 0; i < LENGTHLIMIT + 1; i++) {
                    nameLimit += 't';
                }
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_4600 create finish====");
                console.debug("====>deleteOAuthToken ActsAccountOAuthToken_4600 start====");
                try{
                    await appAccountManager.deleteOAuthToken(nameLimit,"com.example.actsaccounttest","authType","account_notExist_token");
                }
                catch(err){
                    console.debug("====>deleteOAuthToken ActsAccountOAuthToken_4600 err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    console.debug("====>ActsAccountOAuthToken_4600 end====");
                    done();
                }
            });
        
            //查询无效包名owner(为其他字符串时)账号的token callback方式
            it('ActsAccountOAuthToken_4700', 0, async function(done) {
                console.debug("====>ActsAccountOAuthToken_4700 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_4700 create finish====");
                appAccountManager.addAccount("account_callback_invalid_owner", (err)=>{
                    console.debug("====>add account ActsAccountOAuthToken_4700 err:" + JSON.stringify(err));
1816
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1817 1818 1819 1820
                    appAccountManager.getOAuthToken("account_callback_invalid_owner","invalid_owner","authType", (err, data)=>{
                        console.debug("====>getOAuthToken ActsAccountOAuthToken_4700 err:" + JSON.stringify(err));
                        console.debug("====>getOAuthToken ActsAccountOAuthToken_4700 data:" + data);
                        expect(err.code!=0).assertEqual(true);
1821
                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
1822 1823
                        appAccountManager.deleteAccount("account_callback_invalid_owner", (err)=>{
                            console.debug("====>delete account ActsAccountOAuthToken_4700 err:" + JSON.stringify(err));
1824
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859
                            console.debug("====>ActsAccountOAuthToken_4700 end====");
                            done();
                        });
                    });
                });
            });


            it('ActsAccountOAuthToken_3600', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_3600 start====");
                var limitAuthType = '';
                for (var i = 0; i < AUTHTYPELENGTHLIMIT; i++) {
                    limitAuthType += 't';
                }
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_3600 addAccount start====");
                await appAccountManager.addAccount("account_promise_limitAuthType");
                console.debug("====>ActsAccountOAuthToken_3600 setOAuthToken start====");
                await appAccountManager.setOAuthToken("account_promise_limitAuthType",limitAuthType,"account_promise_limitAuthType_token");
                console.debug("====>ActsAccountOAuthToken_3600 getOAuthToken start====");
                var data = await appAccountManager.getOAuthToken("account_promise_limitAuthType",OWNERSELF,limitAuthType);
                expect(data).assertEqual("account_promise_limitAuthType_token");
                console.debug("====>ActsAccountOAuthToken_3600 deleteAccount start====");
                await appAccountManager.deleteAccount("account_promise_limitAuthType");
                console.debug("====>ActsAccountOAuthToken_3600 end====");
                done();
            });
        
            
            it('ActsAccountOAuthToken_3700', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_3700 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_3700 addAccount start====");
                appAccountManager.addAccount("account_callback_authType_empty",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_3700 addAccount err:" + JSON.stringify(err));
1860
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1861 1862
                    appAccountManager.setOAuthToken("account_callback_authType_empty","","account_callback_authType_empty_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_3700 setOAuthToken err:" + JSON.stringify(err));
1863
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1864 1865 1866
                        appAccountManager.getOAuthToken("account_callback_authType_empty",OWNERSELF,"",(err,data)=>{
                            console.debug("====>ActsAccountOAuthToken_3700 getOAuthToken err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_3700 getOAuthToken data:" + data);
1867
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1868 1869 1870
                            expect(data).assertEqual("account_callback_authType_empty_token");
                            appAccountManager.deleteAccount("account_callback_authType_empty",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_3700 deleteAccount err:" + JSON.stringify(err));
1871
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901
                                console.debug("====>ActsAccountOAuthToken_3700 end====");
                                done();
                            });
                        });
                    });
                });
            });
            
            it('ActsAccountOAuthToken_3800', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_3800 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_3800 addAccount start====");
                await appAccountManager.addAccount("account_promise_authType_empty");
                console.debug("====>ActsAccountOAuthToken_3800 setOAuthToken start====");
                await appAccountManager.setOAuthToken("account_promise_authType_empty","","account_promise_authType_empty_token");
                console.debug("====>ActsAccountOAuthToken_3800 getOAuthToken start====");
                var data = await appAccountManager.getOAuthToken("account_promise_authType_empty",OWNERSELF,"");
                expect(data).assertEqual("account_promise_authType_empty_token");
                console.debug("====>ActsAccountOAuthToken_3800 deleteAccount start====");
                await appAccountManager.deleteAccount("account_promise_authType_empty");
                console.debug("====>ActsAccountOAuthToken_3800 end====");
                done();
            });
        
            it('ActsAccountOAuthToken_3900', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_3900 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_3900 addAccount start====");
                appAccountManager.addAccount("account_callback_authType_space",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_3900 addAccount err:" + JSON.stringify(err));
1902
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1903 1904
                    appAccountManager.setOAuthToken("account_callback_authType_space"," ","account_callback_authType_space_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_3900 setOAuthToken err:" + JSON.stringify(err));
1905
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1906 1907 1908
                        appAccountManager.getOAuthToken("account_callback_authType_space",OWNERSELF," ",(err,data)=>{
                            console.debug("====>ActsAccountOAuthToken_3900 getOAuthToken err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_3900 getOAuthToken data:" + data);
1909
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1910 1911 1912
                            expect(data).assertEqual("account_callback_authType_space_token");
                            appAccountManager.deleteAccount("account_callback_authType_space",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_3900 deleteAccount err:" + JSON.stringify(err));
1913
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963
                                console.debug("====>ActsAccountOAuthToken_3900 end====");
                                done();
                            });
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_4000', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_4000 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_4000 addAccount start====");
                await appAccountManager.addAccount("account_promise_authType_space");
                console.debug("====>ActsAccountOAuthToken_4000 setOAuthToken start====");
                await appAccountManager.setOAuthToken("account_promise_authType_space"," ","account_promise_authType_space_token");
                console.debug("====>ActsAccountOAuthToken_4000 getOAuthToken start====");
                var data = await appAccountManager.getOAuthToken("account_promise_authType_space",OWNERSELF," ");
                expect(data).assertEqual("account_promise_authType_space_token");
                console.debug("====>ActsAccountOAuthToken_4000 deleteAccount start====");
                await appAccountManager.deleteAccount("account_promise_authType_space");
                console.debug("====>ActsAccountOAuthToken_4000 end====");
                done();
            });
        
        
            it('ActsAccountOAuthToken_4800', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_4800 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_4800 addAccount start====");
                await appAccountManager.addAccount("account_promise_invalid_owner");
                console.debug("====>ActsAccountOAuthToken_4800 getOAuthToken start====");
                try{
                    var data = await appAccountManager.getOAuthToken("account_promise_invalid_owner","invalid_owner","authType");
                }
                catch(err){
                    console.debug("====>ActsAccountOAuthToken_4800 getOAuthToken err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    console.debug("====>ActsAccountOAuthToken_4800 deleteAccount start====");
                    await appAccountManager.deleteAccount("account_promise_invalid_owner");
                    console.debug("====>ActsAccountOAuthToken_4800 end====");
                    done();
                }
            });
        
            it('ActsAccountOAuthToken_4900', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_4900 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_4900 addAccount start====");
                appAccountManager.addAccount("account_callback_owner_empty",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_4900 addAccount err:" + JSON.stringify(err));
1964
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1965 1966 1967 1968
                    appAccountManager.getOAuthToken("account_callback_owner_empty","","authType",(err,data)=>{
                        console.debug("====>ActsAccountOAuthToken_4900 getOAuthToken err:" + JSON.stringify(err));
                        console.debug("====>ActsAccountOAuthToken_4900 getOAuthToken data:" + data);
                        expect(err.code!=0).assertEqual(true);
1969
                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
1970 1971
                        appAccountManager.deleteAccount("account_callback_owner_empty",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_4900 deleteAccount err:" + JSON.stringify(err));
1972
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004
                            console.debug("====>ActsAccountOAuthToken_4900 end====");
                            done();
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_5000', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_5000 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_5000 addAccount start====");
                await appAccountManager.addAccount("account_promise_owner_empty");
                console.debug("====>ActsAccountOAuthToken_5000 getOAuthToken start====");
                try{
                    var data = await appAccountManager.getOAuthToken("account_promise_owner_empty","","authType");
                }
                catch(err){
                    console.debug("====>ActsAccountOAuthToken_5000 getOAuthToken err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    console.debug("====>ActsAccountOAuthToken_5000 deleteAccount start====");
                    await appAccountManager.deleteAccount("account_promise_owner_empty");
                    console.debug("====>ActsAccountOAuthToken_5000 end====");
                    done();
                }
            });
        
            it('ActsAccountOAuthToken_5100', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_5100 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_5100 addAccount start====");
                appAccountManager.addAccount("account_callback_owner_space",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_5100 addAccount err:" + JSON.stringify(err));
2005
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2006 2007 2008 2009
                    appAccountManager.getOAuthToken("account_callback_owner_space"," ","authType",(err,data)=>{
                        console.debug("====>ActsAccountOAuthToken_5100 getOAuthToken err:" + JSON.stringify(err));
                        console.debug("====>ActsAccountOAuthToken_5100 getOAuthToken data:" + data);
                        expect(err.code!=0).assertEqual(true);
2010
                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
2011 2012
                        appAccountManager.deleteAccount("account_callback_owner_space",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_5100 deleteAccount err:" + JSON.stringify(err));
2013
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045
                            console.debug("====>ActsAccountOAuthToken_5100 end====");
                            done();
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_5200', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_5200 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_5200 addAccount start====");
                await appAccountManager.addAccount("account_callback_owner_space");
                console.debug("====>ActsAccountOAuthToken_5200 getOAuthToken start====");
                try{
                    var data = await appAccountManager.getOAuthToken("account_callback_owner_space"," ","authType");
                }
                catch(err){
                    console.debug("====>ActsAccountOAuthToken_5200 getOAuthToken err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    console.debug("====>ActsAccountOAuthToken_5200 deleteAccount start====");
                    await appAccountManager.deleteAccount("account_callback_owner_space");
                    console.debug("====>ActsAccountOAuthToken_5200 end====");
                    done();
                }
            });
        
            it('ActsAccountOAuthToken_5300', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_5300 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_5300 addAccount start====");
                appAccountManager.addAccount("account_callback_authType_invalid",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_5300 addAccount err:" + JSON.stringify(err));
2046
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2047 2048
                    appAccountManager.setOAuthToken("account_callback_authType_invalid","authType","account_callback_authType_invalid_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_5300 setOAuthToken err:" + JSON.stringify(err));
2049
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2050 2051 2052 2053
                        appAccountManager.getOAuthToken("account_callback_authType_invalid",OWNERSELF,"invalid_authType",(err,data)=>{
                            console.debug("====>ActsAccountOAuthToken_5300 getOAuthToken err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_5300 getOAuthToken data:" + data);
                            expect(err.code!=0).assertEqual(true);
2054
                            expect(data).assertEqual(null);
J
jiyong_sd 已提交
2055 2056
                            appAccountManager.deleteAccount("account_callback_authType_invalid",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_5300 deleteAccount err:" + JSON.stringify(err));
2057
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092
                                console.debug("====>ActsAccountOAuthToken_5300 end====");
                                done();
                            });
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_5400', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_5400 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_5400 addAccount start====");
                await appAccountManager.addAccount("account_promise_authType_invalid");
                console.debug("====>ActsAccountOAuthToken_5400 setOAuthToken start====");
                await appAccountManager.setOAuthToken("account_promise_authType_invalid","authType","account_promise_authType_invalid_token");
                console.debug("====>ActsAccountOAuthToken_5400 getOAuthToken start====");
                try{
                    var data = await appAccountManager.getOAuthToken("account_promise_authType_invalid",OWNERSELF,"invalid_authType");
                }
                catch(err){
                    console.debug("====>ActsAccountOAuthToken_5400 getOAuthToken err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    console.debug("====>ActsAccountOAuthToken_5400 deleteAccount start====");
                    await appAccountManager.deleteAccount("account_promise_authType_invalid");
                    console.debug("====>ActsAccountOAuthToken_5400 end====");
                    done();
                }
            });
        
            it('ActsAccountOAuthToken_5500', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_5500 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_5500 addAccount start====");
                appAccountManager.addAccount("account_callback_authType_empty",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_5500 addAccount err:" + JSON.stringify(err));
2093
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2094 2095
                    appAccountManager.setOAuthToken("account_callback_authType_empty","authType","account_callback_authType_empty_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_5500 setOAuthToken err:" + JSON.stringify(err));
2096
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2097 2098 2099 2100
                        appAccountManager.getOAuthToken("account_callback_authType_empty",OWNERSELF,"",(err,data)=>{
                            console.debug("====>ActsAccountOAuthToken_5500 getOAuthToken err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_5500 getOAuthToken data:" + data);
                            expect(err.code!=0).assertEqual(true);
2101
                            expect(data).assertEqual(null);
J
jiyong_sd 已提交
2102 2103
                            appAccountManager.deleteAccount("account_callback_authType_empty",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_5500 deleteAccount err:" + JSON.stringify(err));
2104
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139
                                console.debug("====>ActsAccountOAuthToken_5500 end====");
                                done();
                            });
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_5600', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_5600 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_5600 addAccount start====");
                await appAccountManager.addAccount("account_promise_authType_empty");
                console.debug("====>ActsAccountOAuthToken_5600 setOAuthToken start====");
                await appAccountManager.setOAuthToken("account_promise_authType_empty","authType","account_promise_authType_empty_token");
                console.debug("====>ActsAccountOAuthToken_5600 getOAuthToken start====");
                try{
                    var data = await appAccountManager.getOAuthToken("account_promise_authType_empty",OWNERSELF,"");
                }
                catch(err){
                    console.debug("====>ActsAccountOAuthToken_5600 getOAuthToken err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    console.debug("====>ActsAccountOAuthToken_5600 deleteAccount start====");
                    await appAccountManager.deleteAccount("account_promise_authType_empty");
                    console.debug("====>ActsAccountOAuthToken_5600 end====");
                    done();
                }
            });
        
            it('ActsAccountOAuthToken_5700', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_5700 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_5700 addAccount start====");
                appAccountManager.addAccount("account_callback_authType_space",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_5700 addAccount err:" + JSON.stringify(err));
2140
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2141 2142
                    appAccountManager.setOAuthToken("account_callback_authType_space","authType","account_callback_authType_space_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_5700 setOAuthToken err:" + JSON.stringify(err));
2143
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2144 2145 2146 2147
                        appAccountManager.getOAuthToken("account_callback_authType_space",OWNERSELF," ",(err,data)=>{
                            console.debug("====>ActsAccountOAuthToken_5700 getOAuthToken err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_5700 getOAuthToken data:" + data);
                            expect(err.code!=0).assertEqual(true);
2148
                            expect(data).assertEqual(null);
J
jiyong_sd 已提交
2149 2150
                            appAccountManager.deleteAccount("account_callback_authType_space",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_5700 deleteAccount err:" + JSON.stringify(err));
2151
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186
                                console.debug("====>ActsAccountOAuthToken_5700 end====");
                                done();
                            });
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_5800', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_5800 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_5800 addAccount start====");
                await appAccountManager.addAccount("account_promise_authType_space");
                console.debug("====>ActsAccountOAuthToken_5800 setOAuthToken start====");
                await appAccountManager.setOAuthToken("account_promise_authType_space","authType","account_promise_authType_space_token");
                console.debug("====>ActsAccountOAuthToken_5800 getOAuthToken start====");
                try{
                    var data = await appAccountManager.getOAuthToken("account_promise_authType_space",OWNERSELF," ");
                }
                catch(err){
                    console.debug("====>ActsAccountOAuthToken_5800 getOAuthToken err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    console.debug("====>ActsAccountOAuthToken_5800 deleteAccount start====");
                    await appAccountManager.deleteAccount("account_promise_authType_space");
                    console.debug("====>ActsAccountOAuthToken_5800 end====");
                    done();
                }
            });
        
            it('ActsAccountOAuthToken_5900', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_5900 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_5900 addAccount start====");
                appAccountManager.addAccount("account_callback_owner_invalid",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_5900 addAccount err:" + JSON.stringify(err));
2187
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2188 2189
                    appAccountManager.setOAuthToken("account_callback_owner_invalid","authType","account_callback_owner_invalid_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_5900 setOAuthToken err:" + JSON.stringify(err));
2190
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2191 2192 2193 2194 2195
                        appAccountManager.deleteOAuthToken("account_callback_owner_invalid","invalid_owner","authType","account_callback_owner_invalid_token",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_5900 getOAuthToken err:" + JSON.stringify(err));
                            expect(err.code!=0).assertEqual(true);
                            appAccountManager.deleteAccount("account_callback_owner_invalid",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_5900 deleteAccount err:" + JSON.stringify(err));
2196
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231
                                console.debug("====>ActsAccountOAuthToken_5900 end====");
                                done();
                            });
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_6000', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_6000 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_6000 addAccount start====");
                await appAccountManager.addAccount("account_promise_owner_invalid");
                console.debug("====>ActsAccountOAuthToken_6000 setOAuthToken start====");
                await appAccountManager.setOAuthToken("account_promise_owner_invalid","authType","account_promise_owner_invalid_token");
                console.debug("====>ActsAccountOAuthToken_6000 getOAuthToken start====");
                try{
                    await appAccountManager.deleteOAuthToken("account_promise_owner_invalid","invalid_owner","authType","account_promise_owner_invalid_token");
                }
                catch(err){
                    console.debug("====>ActsAccountOAuthToken_6000 getOAuthToken err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    console.debug("====>ActsAccountOAuthToken_6000 deleteAccount start====");
                    await appAccountManager.deleteAccount("account_promise_owner_invalid");
                    console.debug("====>ActsAccountOAuthToken_6000 end====");
                    done();
                }
            });
        
            it('ActsAccountOAuthToken_6100', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_6100 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_6100 addAccount start====");
                appAccountManager.addAccount("account_callback_owner_empty",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_6100 addAccount err:" + JSON.stringify(err));
2232
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2233 2234
                    appAccountManager.setOAuthToken("account_callback_owner_empty","authType","account_callback_owner_empty_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_6100 setOAuthToken err:" + JSON.stringify(err));
2235
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2236 2237 2238 2239 2240
                        appAccountManager.deleteOAuthToken("account_callback_owner_empty","","authType","account_callback_owner_empty_token",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_6100 getOAuthToken err:" + JSON.stringify(err));
                            expect(err.code!=0).assertEqual(true);
                            appAccountManager.deleteAccount("account_callback_owner_empty",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_6100 deleteAccount err:" + JSON.stringify(err));
2241
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276
                                console.debug("====>ActsAccountOAuthToken_6100 end====");
                                done();
                            });
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_6200', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_6200 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_6200 addAccount start====");
                await appAccountManager.addAccount("account_promise_owner_empty");
                console.debug("====>ActsAccountOAuthToken_6200 setOAuthToken start====");
                await appAccountManager.setOAuthToken("account_promise_owner_empty","authType","account_promise_owner_empty_token");
                console.debug("====>ActsAccountOAuthToken_6200 getOAuthToken start====");
                try{
                    await appAccountManager.deleteOAuthToken("account_promise_owner_empty","","authType","account_promise_owner_empty_token");
                }
                catch(err){
                    console.debug("====>ActsAccountOAuthToken_6200 getOAuthToken err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    console.debug("====>ActsAccountOAuthToken_6200 deleteAccount start====");
                    await appAccountManager.deleteAccount("account_promise_owner_empty");
                    console.debug("====>ActsAccountOAuthToken_6200 end====");
                    done();
                }
            });
        
            it('ActsAccountOAuthToken_6300', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_6300 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_6300 addAccount start====");
                appAccountManager.addAccount("account_callback_owner_space",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_6300 addAccount err:" + JSON.stringify(err));
2277
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2278 2279
                    appAccountManager.setOAuthToken("account_callback_owner_space","authType","account_callback_owner_space_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_6300 setOAuthToken err:" + JSON.stringify(err));
2280
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2281 2282 2283 2284 2285
                        appAccountManager.deleteOAuthToken("account_callback_owner_space"," ","authType","account_callback_owner_space_token",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_6300 getOAuthToken err:" + JSON.stringify(err));
                            expect(err.code!=0).assertEqual(true);
                            appAccountManager.deleteAccount("account_callback_owner_space",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_6300 deleteAccount err:" + JSON.stringify(err));
2286
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325
                                console.debug("====>ActsAccountOAuthToken_6300 end====");
                                done();
                            });
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_6400', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_6400 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_6400 addAccount start====");
                await appAccountManager.addAccount("account_promise_owner_space");
                console.debug("====>ActsAccountOAuthToken_6400 setOAuthToken start====");
                await appAccountManager.setOAuthToken("account_promise_owner_space","authType","account_promise_owner_space_token");
                console.debug("====>ActsAccountOAuthToken_6400 getOAuthToken start====");
                try{
                    await appAccountManager.deleteOAuthToken("account_promise_owner_space"," ","authType","account_promise_owner_space_token");
                }
                catch(err){
                    console.debug("====>ActsAccountOAuthToken_6400 getOAuthToken err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    console.debug("====>ActsAccountOAuthToken_6400 deleteAccount start====");
                    await appAccountManager.deleteAccount("account_promise_owner_space");
                    console.debug("====>ActsAccountOAuthToken_6400 end====");
                    done();
                }
            });
        
            it('ActsAccountOAuthToken_6500', 0, async function (done) {
                var limitToken = '';
                for(var i = 0;i < TOKENLENGTHLIMIT + 1; i++){
                    limitToken += 'c';
                }
                console.debug("====>ActsAccountOAuthToken_6500 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_6500 addAccount start====");
                appAccountManager.addAccount("account_callback_token_exceedLimit",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_6500 addAccount err:" + JSON.stringify(err));
2326
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2327 2328 2329 2330 2331
                    appAccountManager.deleteOAuthToken("account_callback_token_exceedLimit",OWNERSELF,"authType",limitToken,(err)=>{
                        console.debug("====>ActsAccountOAuthToken_6500 getOAuthToken err:" + JSON.stringify(err));
                        expect(err.code!=0).assertEqual(true);
                        appAccountManager.deleteAccount("account_callback_token_exceedLimit",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_6500 deleteAccount err:" + JSON.stringify(err));
2332
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372
                            console.debug("====>ActsAccountOAuthToken_6500 end====");
                            done();
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_6600', 0, async function (done) {
                var limitToken = '';
                for(var i = 0;i < TOKENLENGTHLIMIT + 1; i++){
                    limitToken += 'c';
                }
                console.debug("====>ActsAccountOAuthToken_6600 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_6600 addAccount start====");
                await appAccountManager.addAccount("account_promise_token_exceedLimit");
                console.debug("====>ActsAccountOAuthToken_6600 deleteOAuthToken start====");
                try{
                    await appAccountManager.deleteOAuthToken("account_promise_token_exceedLimit",OWNERSELF,"authType",limitToken);
                }
                catch(err){
                    console.debug("====>ActsAccountOAuthToken_6600 getOAuthToken err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    console.debug("====>ActsAccountOAuthToken_6600 deleteAccount start====");
                    await appAccountManager.deleteAccount("account_promise_token_exceedLimit");
                    console.debug("====>ActsAccountOAuthToken_6600 end====");
                    done();
                }
            });
        
            it('ActsAccountOAuthToken_6700', 0, async function (done) {
                var limitToken = '';
                for(var i = 0;i < TOKENLENGTHLIMIT; i++){
                    limitToken += 'c';
                }
                console.debug("====>ActsAccountOAuthToken_6700 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_6700 addAccount start====");
                appAccountManager.addAccount("account_callback_token_limit",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_6700 addAccount err:" + JSON.stringify(err));
2373
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2374 2375
                    appAccountManager.setOAuthToken("account_callback_token_limit","authType",limitToken,(err)=>{
                        console.debug("====>ActsAccountOAuthToken_6700 setOAuthToken err:" + JSON.stringify(err));
2376
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2377 2378
                        appAccountManager.deleteOAuthToken("account_callback_token_limit",OWNERSELF,"authType",limitToken,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_6700 getOAuthToken err:" + JSON.stringify(err));
2379
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2380 2381
                            appAccountManager.deleteAccount("account_callback_token_limit",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_6700 deleteAccount err:" + JSON.stringify(err));
2382
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415
                                console.debug("====>ActsAccountOAuthToken_6700 end====");
                                done();
                            });
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_6800', 0, async function (done) {
                var limitToken = '';
                for(var i = 0;i < TOKENLENGTHLIMIT; i++){
                    limitToken += 'c';
                }
                console.debug("====>ActsAccountOAuthToken_6800 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_6800 addAccount start====");
                await appAccountManager.addAccount("account_promise_token_limit");
                console.debug("====>ActsAccountOAuthToken_6800 setOAuthToken start====");
                await appAccountManager.setOAuthToken("account_promise_token_limit","authType",limitToken);
                console.debug("====>ActsAccountOAuthToken_6800 deleteOAuthToken start====");
                await appAccountManager.deleteOAuthToken("account_promise_token_limit",OWNERSELF,"authType",limitToken);
                console.debug("====>ActsAccountOAuthToken_6800 deleteAccount start====");
                await appAccountManager.deleteAccount("account_promise_token_limit");
                console.debug("====>ActsAccountOAuthToken_6800 end====");
                done();
            });
        
            it('ActsAccountOAuthToken_6900', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_6900 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_6900 addAccount start====");
                appAccountManager.addAccount("account_callback_delete_space",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_6900 addAccount err:" + JSON.stringify(err));
2416
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2417 2418
                    appAccountManager.setOAuthToken("account_callback_delete_space","authType","account_callback_delete_space_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_6900 setOAuthToken err:" + JSON.stringify(err));
2419
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2420 2421
                        appAccountManager.deleteOAuthToken("account_callback_delete_space",OWNERSELF,"authType","",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_6900 getOAuthToken err:" + JSON.stringify(err));
2422
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2423 2424 2425
                            appAccountManager.getOAuthToken("account_callback_delete_space",OWNERSELF,"authType",(err,data)=>{
                                console.debug("====>ActsAccountOAuthToken_6900 getOAuthToken err:" + JSON.stringify(err));
                                console.debug("====>ActsAccountOAuthToken_6900 getOAuthToken data:" + data);
2426
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2427 2428 2429
                                expect(data).assertEqual("account_callback_delete_space_token");
                                appAccountManager.deleteAccount("account_callback_delete_space",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_6900 deleteAccount err:" + JSON.stringify(err));
2430
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459
                                    console.debug("====>ActsAccountOAuthToken_6900 end====");
                                    done();
                                });
                            });
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_7000', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_7000 start====");
                var appAccountManager = account.createAppAccountManager();
                console.debug("====>ActsAccountOAuthToken_7000 addAccount start====");
                await appAccountManager.addAccount("account_promise_delete_space");
                console.debug("====>ActsAccountOAuthToken_7000 setOAuthToken start====");
                await appAccountManager.setOAuthToken("account_promise_delete_space","authType","account_promise_delete_space_token");
                console.debug("====>ActsAccountOAuthToken_7000 deleteOAuthToken start====");
                await appAccountManager.deleteOAuthToken("account_promise_delete_space",OWNERSELF,"authType","");
                console.debug("====>ActsAccountOAuthToken_7000 getOAuthToken start====");
                var data = await appAccountManager.getOAuthToken("account_promise_delete_space",OWNERSELF,"authType");
                expect(data).assertEqual("account_promise_delete_space_token");
                console.debug("====>ActsAccountOAuthToken_7000 deleteAccount start====");
                await appAccountManager.deleteAccount("account_promise_delete_space");
                console.debug("====>ActsAccountOAuthToken_7000 end====");
                done();
            });
        
            it('ActsAccountOAuthToken_9200', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_9200 start====");
1
15829070344 已提交
2460 2461 2462 2463 2464 2465
            	var appAccountManager = account.createAppAccountManager();
            	appAccountManager.getAuthenticatorCallback("test_sessionId").then((databack)=>{
                    console.debug("====>ActsAccountOAuthToken_9200 getAuthenticatorCallback data:" + JSON.stringify(databack))
                    expect(databack).assertEqual(undefined);
                    done();
            	}).catch((err)=>{
J
jiyong_sd 已提交
2466 2467 2468
                    console.debug("====>ActsAccountOAuthToken_9200 getAuthenticatorCallback err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    done();
1
15829070344 已提交
2469
            	})
J
jiyong_sd 已提交
2470 2471 2472 2473 2474 2475 2476 2477
            });
        
            it('ActsAccountOAuthToken_9300', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_9300 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.getAuthenticatorCallback("",(err,databack)=>{
                    console.debug("====>ActsAccountOAuthToken_9300 getAuthenticatorCallback err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
2478
                    expect(databack).assertEqual(null);
J
jiyong_sd 已提交
2479 2480 2481 2482 2483 2484 2485 2486 2487 2488
                    done();
                });
            });
        
            it('ActsAccountOAuthToken_9400', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_9400 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.getAuthenticatorCallback(" ",(err,databack)=>{
                    console.debug("====>ActsAccountOAuthToken_9400 getAuthenticatorCallback err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
2489
                    expect(databack).assertEqual(null);
J
jiyong_sd 已提交
2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569
                    done();
                });
            });
        
            it('ActsAccountOAuthToken_9500', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_9500 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.getAuthenticatorInfo(OWNERSELF,(err,databack)=>{
                    console.debug("====>ActsAccountOAuthToken_9500 getAuthenticatorInfo err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    expect(account.ResultCode.SUCCESS).assertEqual(0);
                    expect(account.ResultCode.ERROR_ACCOUNT_NOT_EXIST).assertEqual(10001);
                    expect(account.ResultCode.ERROR_APP_ACCOUNT_SERVICE_EXCEPTION).assertEqual(10002);
                    expect(account.ResultCode.ERROR_INVALID_PASSWORD).assertEqual(10003);
                    expect(account.ResultCode.ERROR_INVALID_REQUEST).assertEqual(10004);
                    expect(account.ResultCode.ERROR_INVALID_RESPONSE).assertEqual(10005);
                    expect(account.ResultCode.ERROR_NETWORK_EXCEPTION).assertEqual(10006);
                    expect(account.ResultCode.ERROR_OAUTH_AUTHENTICATOR_NOT_EXIST).assertEqual(10007);
                    expect(account.ResultCode.ERROR_OAUTH_CANCELED).assertEqual(10008);
                    expect(account.ResultCode.ERROR_OAUTH_LIST_TOO_LARGE).assertEqual(10009);
                    expect(account.ResultCode.ERROR_OAUTH_SERVICE_BUSY).assertEqual(10010);
                    expect(account.ResultCode.ERROR_OAUTH_SERVICE_EXCEPTION).assertEqual(10011);
                    expect(account.ResultCode.ERROR_OAUTH_SESSION_NOT_EXIST).assertEqual(10012);
                    expect(account.ResultCode.ERROR_OAUTH_TIMEOUT).assertEqual(10013);
                    expect(account.ResultCode.ERROR_OAUTH_TOKEN_NOT_EXIST).assertEqual(10014);
                    expect(account.ResultCode.ERROR_OAUTH_TOKEN_TOO_MANY).assertEqual(10015);
                    expect(account.ResultCode.ERROR_OAUTH_UNSUPPORT_ACTION).assertEqual(10016);
                    expect(account.ResultCode.ERROR_OAUTH_UNSUPPORT_AUTH_TYPE).assertEqual(10017);
                    expect(account.ResultCode.ERROR_PERMISSION_DENIED).assertEqual(10018);                   
                    done();
                });
            });
        
            it('ActsAccountOAuthToken_9600', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_9600 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.getAuthenticatorInfo("",(err,databack)=>{
                    console.debug("====>ActsAccountOAuthToken_9600 getAuthenticatorInfo err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    expect(account.Constants.ACTION_ADD_ACCOUNT_IMPLICITLY).assertEqual('addAccountImplicitly');
                    expect(account.Constants.ACTION_AUTHENTICATE).assertEqual('authenticate');
                    expect(account.Constants.KEY_NAME).assertEqual('name');
                    expect(account.Constants.KEY_OWNER).assertEqual('owner');
                    expect(account.Constants.KEY_TOKEN).assertEqual('token');
                    expect(account.Constants.KEY_ACTION).assertEqual('action');
                    expect(account.Constants.KEY_AUTH_TYPE).assertEqual('authType');
                    expect(account.Constants.KEY_SESSION_ID).assertEqual('sessionId');
                    expect(account.Constants.KEY_CALLER_PID).assertEqual('callerPid');
                    expect(account.Constants.KEY_CALLER_UID).assertEqual('callerUid');
                    expect(account.Constants.KEY_CALLER_BUNDLE_NAME).assertEqual('callerBundleName');
                    done();
                });
            });
        
            it('ActsAccountOAuthToken_9700', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_9700 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.getAuthenticatorInfo(" ",(err,databack)=>{
                    console.debug("====>ActsAccountOAuthToken_9700 getAuthenticatorInfo err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    done();
                });
            });
        
            it('ActsAccountOAuthToken_9800', 0, async function (done) {
                var limiOwner = '';
                for(var i = 0;i < OWNERLENGTHLIMIT + 1; i++){
                    limiOwner += 't';
                }
                console.debug("====>ActsAccountOAuthToken_9800 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.getAuthenticatorInfo(limiOwner,(err,databack)=>{
                    console.debug("====>ActsAccountOAuthToken_9800 getAuthenticatorInfo err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    done();
                });
            });
        
            it('ActsAccountOAuthToken_9900', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_9900 start====");
1
15829070344 已提交
2570 2571
            	var appAccountManager = account.createAppAccountManager();
            	appAccountManager.addAccount("account_setOAuthTokenVisibility_name",(err,)=>{
J
jiyong_sd 已提交
2572
                    console.debug("====>ActsAccountOAuthToken_9900 addAccount err:" + JSON.stringify(err));
1
15829070344 已提交
2573 2574
                    expect(err).assertEqual(null);            
                    appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","authType","test_BundleName",true).then(()=>{
J
jiyong_sd 已提交
2575 2576 2577
                        appAccountManager.getOAuthToken("account_setOAuthTokenVisibility_name",OWNERSELF,"authType",(err,data)=>{
                            console.debug("====>ActsAccountOAuthToken_9900 getOAuthToken err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_9900 getOAuthToken data:" + data);
1
15829070344 已提交
2578
                            expect(err.code!=0).assertEqual(true);                        
J
jiyong_sd 已提交
2579 2580
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","authType",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_9900 getOAuthList err:" + JSON.stringify(err));
1
15829070344 已提交
2581
                                expect(err).assertEqual(null);                       
J
jiyong_sd 已提交
2582 2583
                                console.debug("====>ActsAccountOAuthToken_9900 getOAuthList dataArray:" + JSON.stringify(dataArray));
                                expect(dataArray.length).assertEqual(1);
1
15829070344 已提交
2584 2585
                            	expect(dataArray[0]).assertEqual("test_BundleName");
                            	appAccountManager.deleteAccount("account_setOAuthTokenVisibility_name",(err)=>{
J
jiyong_sd 已提交
2586
                                    console.debug("====>ActsAccountOAuthToken_9900 deleteAccount err:" + JSON.stringify(err));
1
15829070344 已提交
2587
                                    expect(err).assertEqual(null);                            
J
jiyong_sd 已提交
2588 2589 2590 2591 2592
                                    console.debug("====>ActsAccountOAuthToken_9900 end====");
                                    done();
                                });
                            });
                        });
1
15829070344 已提交
2593 2594 2595 2596
                    }).catch((err)=>{
                        expect(err).assertEqual(null);                
		        done();
                    })
J
jiyong_sd 已提交
2597 2598 2599 2600 2601 2602 2603 2604
                });
            });
        
            it('ActsAccountOAuthToken_10000', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_10000 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_setOAuthTokenVisibility_name",(err,)=>{
                    console.debug("====>ActsAccountOAuthToken_10000 addAccount err:" + JSON.stringify(err));
2605
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2606 2607
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10000 setOAuthToken err:" + JSON.stringify(err));
2608
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2609 2610
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","authType","test_BundleName","",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10000 setOAuthTokenVisibility err:" + JSON.stringify(err));
2611
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2612 2613
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","authType",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_10000 getOAuthList err:" + JSON.stringify(err));
2614
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2615 2616 2617 2618
                                console.debug("====>ActsAccountOAuthToken_10000 getOAuthList dataArray:" + JSON.stringify(dataArray));
                                expect(dataArray.length).assertEqual(0);
                                appAccountManager.deleteAccount("account_setOAuthTokenVisibility_name",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_10000 deleteAccount err:" + JSON.stringify(err));
2619
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633
                                    console.debug("====>ActsAccountOAuthToken_10000 end====");
                                    done();
                                });
                            });
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_10100', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_10100 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_setOAuthTokenVisibility_name",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_10100 addAccount err:" + JSON.stringify(err));
2634
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2635 2636
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10100 setOAuthToken err:" + JSON.stringify(err));
2637
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2638 2639
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","authType","test_BundleName","invalid_string",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10100 setOAuthTokenVisibility err:" + JSON.stringify(err));
2640
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2641 2642
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","authType",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_10100 getOAuthList err:" + JSON.stringify(err));
2643
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2644 2645 2646 2647
                                console.debug("====>ActsAccountOAuthToken_10100 getOAuthList dataArray:" + JSON.stringify(dataArray));
                                expect(dataArray.length).assertEqual(0);
                                appAccountManager.deleteAccount("account_setOAuthTokenVisibility_name",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_10100 deleteAccount err:" + JSON.stringify(err));
2648
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662
                                    console.debug("====>ActsAccountOAuthToken_10100 end====");
                                    done();
                                });
                            });
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_10200', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_10200 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_setOAuthTokenVisibility_name",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_10200 addAccount err:" + JSON.stringify(err));
2663
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2664 2665
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10200 setOAuthToken err:" + JSON.stringify(err));
2666
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2667 2668 2669 2670 2671
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","authType","",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10200 setOAuthTokenVisibility err:" + JSON.stringify(err));
                            expect(err.code!=0).assertEqual(true);
                            appAccountManager.deleteAccount("account_setOAuthTokenVisibility_name",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_10200 deleteAccount err:" + JSON.stringify(err));
2672
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685
                                console.debug("====>ActsAccountOAuthToken_10200 end====");
                                done();
                            });
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_10300', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_10300 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_setOAuthTokenVisibility_name",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_10300 addAccount err:" + JSON.stringify(err));
2686
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2687 2688
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10300 setOAuthToken err:" + JSON.stringify(err));
2689
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2690 2691
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","authType"," ",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10300 setOAuthTokenVisibility err:" + JSON.stringify(err));
2692
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2693 2694
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","authType",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_10300 getOAuthList err:" + JSON.stringify(err));
2695
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2696 2697 2698 2699 2700
                                console.debug("====>ActsAccountOAuthToken_10300 getOAuthList dataArray:" + JSON.stringify(dataArray));
                                expect(dataArray.length).assertEqual(1);
                                expect(dataArray[0]).assertEqual(" ");
                                appAccountManager.deleteAccount("account_setOAuthTokenVisibility_name",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_10300 deleteAccount err:" + JSON.stringify(err));
2701
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719
                                    console.debug("====>ActsAccountOAuthToken_10300 end====");
                                    done();
                                });
                            });    
                        });
                    });
                });
            });
            
            it('ActsAccountOAuthToken_10400', 0, async function (done) {
                var limitBundleName = '';
                for(var i = 0;i < OWNERLENGTHLIMIT + 1; i++){
                    limitBundleName += 't';
                }
                console.debug("====>ActsAccountOAuthToken_10400 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_setOAuthTokenVisibility_name",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_10400 addAccount err:" + JSON.stringify(err));
2720
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2721 2722
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10400 setOAuthToken err:" + JSON.stringify(err));
2723
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2724 2725 2726 2727 2728
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","authType",limitBundleName,true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10400 setOAuthTokenVisibility err:" + JSON.stringify(err));
                            expect(err.code!=0).assertEqual(true);
                            appAccountManager.deleteAccount("account_setOAuthTokenVisibility_name",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_10400 deleteAccount err:" + JSON.stringify(err));
2729
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742
                                console.debug("====>ActsAccountOAuthToken_10400 end====");
                                done();
                            });
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_10500', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_10500 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_setOAuthTokenVisibility_name",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_10500 addAccount err:" + JSON.stringify(err));
2743
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2744 2745
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10500 setOAuthToken err:" + JSON.stringify(err));
2746
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2747 2748
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","","test_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10500 setOAuthTokenVisibility err:" + JSON.stringify(err));
2749
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2750 2751
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_10500 getOAuthList err:" + JSON.stringify(err));
2752
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2753 2754 2755 2756 2757
                                console.debug("====>ActsAccountOAuthToken_10500 getOAuthList dataArray:" + JSON.stringify(dataArray));
                                expect(dataArray.length).assertEqual(1);
                                expect(dataArray[0]).assertEqual("test_bundleName");
                                appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","authType",(err,dataArray)=>{
                                    console.debug("====>ActsAccountOAuthToken_10500 getOAuthList authType:\"authType\" err:" + JSON.stringify(err));
2758
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2759 2760 2761 2762
                                    console.debug("====>ActsAccountOAuthToken_10500 getOAuthList authType:\"authType\" dataArray:" + JSON.stringify(dataArray));
                                    expect(dataArray.length).assertEqual(0);
                                    appAccountManager.deleteAccount("account_setOAuthTokenVisibility_name",(err)=>{
                                        console.debug("====>ActsAccountOAuthToken_10500 deleteAccount err:" + JSON.stringify(err));
2763
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778
                                        console.debug("====>ActsAccountOAuthToken_10500 end====");
                                        done();
                                    });
                                });
                            });    
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_10600', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_10600 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_setOAuthTokenVisibility_name",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_10600 addAccount err:" + JSON.stringify(err));
2779
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2780 2781
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10600 setOAuthToken err:" + JSON.stringify(err));
2782
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2783 2784
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name"," ","test_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10600 setOAuthTokenVisibility err:" + JSON.stringify(err));
2785
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2786 2787
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name"," ",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_10600 getOAuthList err:" + JSON.stringify(err));
2788
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2789 2790 2791 2792 2793
                                console.debug("====>ActsAccountOAuthToken_10600 getOAuthList dataArray:" + JSON.stringify(dataArray));
                                expect(dataArray.length).assertEqual(1);
                                expect(dataArray[0]).assertEqual("test_bundleName");
                                appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","authType",(err,dataArray)=>{
                                    console.debug("====>ActsAccountOAuthToken_10600 getOAuthList authType:\"authType\" err:" + JSON.stringify(err));
2794
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2795 2796 2797 2798
                                    console.debug("====>ActsAccountOAuthToken_10600 getOAuthList authType:\"authType\" dataArray:" + JSON.stringify(dataArray));
                                    expect(dataArray.length).assertEqual(0);
                                    appAccountManager.deleteAccount("account_setOAuthTokenVisibility_name",(err)=>{
                                        console.debug("====>ActsAccountOAuthToken_10600 deleteAccount err:" + JSON.stringify(err));
2799
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819
                                        console.debug("====>ActsAccountOAuthToken_10600 end====");
                                        done();
                                    });
                                });
                            });    
                        });
                    });
                });
            });
        
        
            it('ActsAccountOAuthToken_10700', 0, async function (done) {
                var limitAuthType = '';
                for(var i = 0;i < AUTHTYPELENGTHLIMIT + 1; i++){
                    limitAuthType += 't';
                }
                console.debug("====>ActsAccountOAuthToken_10700 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_setOAuthTokenVisibility_name",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_10700 addAccount err:" + JSON.stringify(err));
2820
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2821 2822
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10700 setOAuthToken err:" + JSON.stringify(err));
2823
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2824 2825 2826 2827 2828
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name",limitAuthType,"test_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10700 setOAuthTokenVisibility err:" + JSON.stringify(err));
                            expect(err.code!=0).assertEqual(true);
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","authType",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_10700 getOAuthList authType:\"authType\" err:" + JSON.stringify(err));
2829
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2830 2831 2832 2833
                                console.debug("====>ActsAccountOAuthToken_10700 getOAuthList authType:\"authType\" dataArray:" + JSON.stringify(dataArray));
                                expect(dataArray.length).assertEqual(0);
                                appAccountManager.deleteAccount("account_setOAuthTokenVisibility_name",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_10700 deleteAccount err:" + JSON.stringify(err));
2834
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848
                                    console.debug("====>ActsAccountOAuthToken_10700 end====");
                                    done();
                                });
                            }); 
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_10800', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_10800 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_setOAuthTokenVisibility_name",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_10800 addAccount err:" + JSON.stringify(err));
2849
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2850 2851
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10800 setOAuthToken err:" + JSON.stringify(err));
2852
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2853 2854
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","invalid_authType","test_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10800 setOAuthTokenVisibility err:" + JSON.stringify(err));
2855
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2856 2857
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","invalid_authType",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_10800 getOAuthList err:" + JSON.stringify(err));
2858
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2859 2860 2861 2862 2863
                                console.debug("====>ActsAccountOAuthToken_10800 getOAuthList dataArray:" + JSON.stringify(dataArray));
                                expect(dataArray.length).assertEqual(1);
                                expect(dataArray[0]).assertEqual("test_bundleName");
                                appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","authType",(err,dataArray)=>{
                                    console.debug("====>ActsAccountOAuthToken_10800 getOAuthList authType:\"authType\" err:" + JSON.stringify(err));
2864
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2865 2866 2867 2868
                                    console.debug("====>ActsAccountOAuthToken_10800 getOAuthList authType:\"authType\" dataArray:" + JSON.stringify(dataArray));
                                    expect(dataArray.length).assertEqual(0);
                                    appAccountManager.deleteAccount("account_setOAuthTokenVisibility_name",(err)=>{
                                        console.debug("====>ActsAccountOAuthToken_10800 deleteAccount err:" + JSON.stringify(err));
2869
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972
                                        console.debug("====>ActsAccountOAuthToken_10800 end====");
                                        done();
                                    });
                                });
                            });    
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_10900', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_10900 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.setOAuthTokenVisibility("","authType","test_bundleName",true,(err)=>{
                    console.debug("====>ActsAccountOAuthToken_10900 setOAuthTokenVisibility err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    done();
                });
            });
        
            it('ActsAccountOAuthToken_11000', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_11000 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.setOAuthTokenVisibility(" ","authType","test_bundleName",true,(err)=>{
                    console.debug("====>ActsAccountOAuthToken_11000 setOAuthTokenVisibility err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    done();
                });
            });
        
            it('ActsAccountOAuthToken_11100', 0, async function (done) {
                var limitName = '';
                for(var i = 0; i < LENGTHLIMIT + 1; i++){
                    limitName += 't';
                }
                console.debug("====>ActsAccountOAuthToken_11100 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.setOAuthTokenVisibility(limitName,"authType","test_bundleName",true,(err)=>{
                    console.debug("====>ActsAccountOAuthToken_11100 setOAuthTokenVisibility err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    done();
                });
            });
        
            it('ActsAccountOAuthToken_11200', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_11200 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.setOAuthTokenVisibility("no_add_account","authType","test_bundleName",true,(err)=>{
                    console.debug("====>ActsAccountOAuthToken_11200 setOAuthTokenVisibility err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    done();
                });
            });
        
            it('ActsAccountOAuthToken_11300', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_11300 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.checkOAuthTokenVisibility("","authType","test_bundleName",(err,stateBack)=>{
                    console.debug("====>ActsAccountOAuthToken_11300 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    done();
                });
            });
        
            it('ActsAccountOAuthToken_11400', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_11400 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.checkOAuthTokenVisibility(" ","authType","test_bundleName",(err,stateBack)=>{
                    console.debug("====>ActsAccountOAuthToken_11400 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    done();
                });
            });
        
            it('ActsAccountOAuthToken_11500', 0, async function (done) {
                var limitName = '';
                for(var i = 0; i < LENGTHLIMIT + 1; i++){
                    limitName += 't';
                }
                console.debug("====>ActsAccountOAuthToken_11500 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.checkOAuthTokenVisibility(limitName,"authType","test_bundleName",(err,stateBack)=>{
                    console.debug("====>ActsAccountOAuthToken_11500 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    done();
                });
            });
        
            it('ActsAccountOAuthToken_11600', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_11600 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.checkOAuthTokenVisibility("no_add_account","authType","test_bundleName",(err,stateBack)=>{
                    console.debug("====>ActsAccountOAuthToken_11600 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    done();
                });
            });
        
            it('ActsAccountOAuthToken_11700', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_11700 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_11700 addAccount err:" + JSON.stringify(err));
2973
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2974 2975
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_11700 setOAuthToken err:" + JSON.stringify(err));
2976
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2977 2978 2979
                        appAccountManager.checkOAuthTokenVisibility("account_checkOAuthTokenVisibility_name","","test_bundleName",(err,stateBack)=>{
                            console.debug("====>ActsAccountOAuthToken_11700 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_11700 checkOAuthTokenVisibility stateBack:" + stateBack);
2980
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2981 2982 2983 2984
                            expect(stateBack).assertEqual(false);
                            appAccountManager.checkOAuthTokenVisibility("account_checkOAuthTokenVisibility_name","",OWNERSELF,(err,stateBack)=>{
                                console.debug("====>ActsAccountOAuthToken_11700 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                                console.debug("====>ActsAccountOAuthToken_11700 checkOAuthTokenVisibility stateBack:" + stateBack);
2985
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2986 2987 2988
                                expect(stateBack).assertEqual(true);
                                appAccountManager.deleteAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_11700 deleteAccount err:" + JSON.stringify(err));
2989
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003
                                    console.debug("====>ActsAccountOAuthToken_11700 end====");
                                    done();
                                });
                            });    
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_11800', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_11800 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_11800 addAccount err:" + JSON.stringify(err));
3004
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3005 3006
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_11800 setOAuthToken err:" + JSON.stringify(err));
3007
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3008 3009 3010
                        appAccountManager.checkOAuthTokenVisibility("account_checkOAuthTokenVisibility_name"," ","test_bundleName",(err,stateBack)=>{
                            console.debug("====>ActsAccountOAuthToken_11800 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_11800 checkOAuthTokenVisibility stateBack:" + stateBack);
3011
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3012 3013 3014 3015
                            expect(stateBack).assertEqual(false);
                            appAccountManager.checkOAuthTokenVisibility("account_checkOAuthTokenVisibility_name"," ",OWNERSELF,(err,stateBack)=>{
                                console.debug("====>ActsAccountOAuthToken_11800 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                                console.debug("====>ActsAccountOAuthToken_11800 checkOAuthTokenVisibility stateBack:" + stateBack);
3016
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3017 3018 3019
                                expect(stateBack).assertEqual(true);
                                appAccountManager.deleteAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_11800 deleteAccount err:" + JSON.stringify(err));
3020
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038
                                    console.debug("====>ActsAccountOAuthToken_11800 end====");
                                    done();
                                });
                            });    
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_11900', 0, async function (done) {
                var limitAuthType ='';
                for(var i = 0; i < AUTHTYPELENGTHLIMIT + 1; i++){
                    limitAuthType += 't';
                }
                console.debug("====>ActsAccountOAuthToken_11900 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_11900 addAccount err:" + JSON.stringify(err));
3039
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3040 3041
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_11900 setOAuthToken err:" + JSON.stringify(err));
3042
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3043 3044 3045 3046 3047 3048 3049 3050
                        appAccountManager.checkOAuthTokenVisibility("account_checkOAuthTokenVisibility_name",limitAuthType,"test_bundleName",(err,stateBack)=>{
                            console.debug("====>ActsAccountOAuthToken_11900 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                            expect(err.code!=0).assertEqual(true);
                            appAccountManager.checkOAuthTokenVisibility("account_checkOAuthTokenVisibility_name",limitAuthType,OWNERSELF,(err,stateBack)=>{
                                console.debug("====>ActsAccountOAuthToken_11900 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                                expect(err.code!=0).assertEqual(true);
                                appAccountManager.deleteAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_11900 deleteAccount err:" + JSON.stringify(err));
3051
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065
                                    console.debug("====>ActsAccountOAuthToken_11900 end====");
                                    done();
                                });
                            });    
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_12000', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_12000 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_12000 addAccount err:" + JSON.stringify(err));
3066
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3067 3068
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12000 setOAuthToken err:" + JSON.stringify(err));
3069
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3070 3071 3072
                        appAccountManager.checkOAuthTokenVisibility("account_checkOAuthTokenVisibility_name","invalid_authType","test_bundleName",(err,stateBack)=>{
                            console.debug("====>ActsAccountOAuthToken_12000 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_12000 checkOAuthTokenVisibility stateBack:" + stateBack);
3073
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3074 3075 3076 3077
                            expect(stateBack).assertEqual(false);
                            appAccountManager.checkOAuthTokenVisibility("account_checkOAuthTokenVisibility_name","invalid_authType",OWNERSELF,(err,stateBack)=>{
                                console.debug("====>ActsAccountOAuthToken_12000 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                                console.debug("====>ActsAccountOAuthToken_12000 checkOAuthTokenVisibility stateBack:" + stateBack);
3078
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3079 3080 3081
                                expect(stateBack).assertEqual(true);
                                appAccountManager.deleteAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_12000 deleteAccount err:" + JSON.stringify(err));
3082
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096
                                    console.debug("====>ActsAccountOAuthToken_12000 end====");
                                    done();
                                });
                            });    
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_12100', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_12100 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_12100 addAccount err:" + JSON.stringify(err));
3097
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3098 3099
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12100 setOAuthToken err:" + JSON.stringify(err));
3100
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3101 3102 3103 3104 3105 3106
                        appAccountManager.checkOAuthTokenVisibility("account_checkOAuthTokenVisibility_name","authType","",(err,stateBack)=>{
                            console.debug("====>ActsAccountOAuthToken_12100 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_12100 checkOAuthTokenVisibility stateBack:" + stateBack);
                            expect(err.code!=0).assertEqual(true);
                            appAccountManager.deleteAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_12100 deleteAccount err:" + JSON.stringify(err));
3107
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120
                                console.debug("====>ActsAccountOAuthToken_12100 end====");
                                done();
                            });    
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_12200', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_12200 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_12200 addAccount err:" + JSON.stringify(err));
3121
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3122 3123
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12200 setOAuthToken err:" + JSON.stringify(err));
3124
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3125 3126 3127
                        appAccountManager.checkOAuthTokenVisibility("account_checkOAuthTokenVisibility_name","authType"," ",(err,stateBack)=>{
                            console.debug("====>ActsAccountOAuthToken_12200 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_12200 checkOAuthTokenVisibility stateBack:" + stateBack);
3128
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3129 3130 3131
                            expect(stateBack).assertEqual(false);
                            appAccountManager.deleteAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_12200 deleteAccount err:" + JSON.stringify(err));
3132
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149
                                console.debug("====>ActsAccountOAuthToken_12200 end====");
                                done();
                            });    
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_12300', 0, async function (done) {
                var limitBundleName = '';
                for(var i = 0; i < OWNERLENGTHLIMIT + 1; i++){
                    limitBundleName += 't';
                }
                console.debug("====>ActsAccountOAuthToken_12300 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_12300 addAccount err:" + JSON.stringify(err));
3150
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3151 3152
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12300 setOAuthToken err:" + JSON.stringify(err));
3153
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3154 3155 3156 3157 3158 3159
                        appAccountManager.checkOAuthTokenVisibility("account_checkOAuthTokenVisibility_name","authType",limitBundleName,(err,stateBack)=>{
                            console.debug("====>ActsAccountOAuthToken_12300 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_12300 checkOAuthTokenVisibility stateBack:" + stateBack);
                            expect(err.code!=0).assertEqual(true);
                            appAccountManager.deleteAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_12300 deleteAccount err:" + JSON.stringify(err));
3160
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173
                                console.debug("====>ActsAccountOAuthToken_12300 end====");
                                done();
                            });    
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_12400', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_12400 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_testGetOAuthList_name",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_12400 addAccount err:" + JSON.stringify(err));
3174
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3175 3176
                    appAccountManager.setOAuthToken("account_testGetOAuthList_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12400 setOAuthToken err:" + JSON.stringify(err));
3177
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3178 3179
                        appAccountManager.setOAuthTokenVisibility("account_testGetOAuthList_name","authType","test_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_12400 setOAuthTokenVisibility err:" + JSON.stringify(err));
3180
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3181 3182
                            appAccountManager.getOAuthList("account_testGetOAuthList_name","",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_12400 getOAuthList err:" + JSON.stringify(err));
3183
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3184 3185 3186 3187
                                console.debug("====>ActsAccountOAuthToken_12400 getOAuthList dataArray:" + JSON.stringify(dataArray));
                                expect(dataArray.length).assertEqual(0);
                                appAccountManager.deleteAccount("account_testGetOAuthList_name",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_12400 deleteAccount err:" + JSON.stringify(err));
3188
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202
                                    console.debug("====>ActsAccountOAuthToken_12400 end====");
                                    done();
                                });
                            });    
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_12500', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_12500 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_testGetOAuthList_name",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_12500 addAccount err:" + JSON.stringify(err));
3203
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3204 3205
                    appAccountManager.setOAuthToken("account_testGetOAuthList_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12500 setOAuthToken err:" + JSON.stringify(err));
3206
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3207 3208
                        appAccountManager.setOAuthTokenVisibility("account_testGetOAuthList_name","authType","test_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_12500 setOAuthTokenVisibility err:" + JSON.stringify(err));
3209
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3210 3211
                            appAccountManager.getOAuthList("account_testGetOAuthList_name"," ",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_12500 getOAuthList err:" + JSON.stringify(err));
3212
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3213 3214 3215 3216
                                console.debug("====>ActsAccountOAuthToken_12500 getOAuthList dataArray:" + JSON.stringify(dataArray));
                                expect(dataArray.length).assertEqual(0);
                                appAccountManager.deleteAccount("account_testGetOAuthList_name",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_12500 deleteAccount err:" + JSON.stringify(err));
3217
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235
                                    console.debug("====>ActsAccountOAuthToken_12500 end====");
                                    done();
                                });
                            });    
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_12600', 0, async function (done) {
                var limitAuthType ='';
                for(var i = 0; i < AUTHTYPELENGTHLIMIT + 1; i++){
                    limitAuthType += 't';
                }
                console.debug("====>ActsAccountOAuthToken_12600 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_testGetOAuthList_name",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_12600 addAccount err:" + JSON.stringify(err));
3236
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3237 3238
                    appAccountManager.setOAuthToken("account_testGetOAuthList_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12600 setOAuthToken err:" + JSON.stringify(err));
3239
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3240 3241
                        appAccountManager.setOAuthTokenVisibility("account_testGetOAuthList_name","authType","test_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_12600 setOAuthTokenVisibility err:" + JSON.stringify(err));
3242
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3243 3244 3245 3246
                            appAccountManager.getOAuthList("account_testGetOAuthList_name",limitAuthType,(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_12600 getOAuthList err:" + JSON.stringify(err));
                                expect(err.code!=0).assertEqual(true);
                                console.debug("====>ActsAccountOAuthToken_12600 getOAuthList dataArray:" + JSON.stringify(dataArray));
3247
                                expect(dataArray).assertEqual(null);
J
jiyong_sd 已提交
3248 3249
                                appAccountManager.deleteAccount("account_testGetOAuthList_name",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_12600 deleteAccount err:" + JSON.stringify(err));
3250
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262
                                    console.debug("====>ActsAccountOAuthToken_12600 end====");
                                    done();
                                });
                            });    
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_12700', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_12700 start====");
                var appAccountManager = account.createAppAccountManager();
1
15829070344 已提交
3263 3264 3265 3266 3267
                appAccountManager.getOAuthList("","authType").then((dataArray)=>{
                    console.debug("====>ActsAccountOAuthToken_12700 getOAuthList dataArray:" + JSON.stringify(dataArray));                
                    expect(dataArray.length).assertEqual(0);
                    done();
                }).catch((err)=>{
J
jiyong_sd 已提交
3268 3269
                    expect(err.code!=0).assertEqual(true);
                    done();
1
15829070344 已提交
3270
                })
J
jiyong_sd 已提交
3271 3272 3273 3274 3275 3276 3277 3278 3279
            });
        
            it('ActsAccountOAuthToken_12800', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_12800 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.getOAuthList(" ","authType",(err,dataArray)=>{
                    console.debug("====>ActsAccountOAuthToken_12800 getOAuthList err:" + JSON.stringify(err));
                    console.debug("====>ActsAccountOAuthToken_12800 getOAuthList dataArray:" + JSON.stringify(dataArray));
                    expect(err.code!=0).assertEqual(true);
3280
                    expect(dataArray).assertEqual(null);
J
jiyong_sd 已提交
3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295
                    done();
                });
            });
        
            it('ActsAccountOAuthToken_12900', 0, async function (done) {
                var limitName = '';
                for(var i = 0; i < LENGTHLIMIT + 1; i++){
                    limitName += 't';
                }
                console.debug("====>ActsAccountOAuthToken_12900 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.getOAuthList(limitName,"authType",(err,dataArray)=>{
                    console.debug("====>ActsAccountOAuthToken_12900 getOAuthList err:" + JSON.stringify(err));
                    console.debug("====>ActsAccountOAuthToken_12900 getOAuthList dataArray:" + JSON.stringify(dataArray));
                    expect(err.code!=0).assertEqual(true);
3296
                    expect(dataArray).assertEqual(null);
J
jiyong_sd 已提交
3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307
                    done();
                });
            });
        
            it('ActsAccountOAuthToken_13000', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_13000 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.getOAuthList("no_add_account","authType",(err,dataArray)=>{
                    console.debug("====>ActsAccountOAuthToken_13000 getOAuthList err:" + JSON.stringify(err));
                    console.debug("====>ActsAccountOAuthToken_13000 getOAuthList dataArray:" + JSON.stringify(dataArray));
                    expect(err.code!=0).assertEqual(true);
3308
                    expect(dataArray).assertEqual(null);
J
jiyong_sd 已提交
3309 3310 3311 3312 3313 3314 3315 3316 3317
                    done();
                });
            });
        
            it('ActsAccountOAuthToken_13100', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_13100 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccount("account_tokenTest_name",(err,)=>{
                    console.debug("====>ActsAccountOAuthToken_13100 addAccount err:" + JSON.stringify(err));
3318
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3319 3320
                    appAccountManager.setOAuthToken("account_tokenTest_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_13100 setOAuthToken err:" + JSON.stringify(err));
3321
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3322 3323 3324
                        appAccountManager.getOAuthToken("account_tokenTest_name",OWNERSELF,"authType",(err,data)=>{
                            console.debug("====>ActsAccountOAuthToken_13100 getOAuthToken err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_13100 getOAuthToken stateBack:" + data);
3325
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3326 3327 3328 3329
                            expect(data).assertEqual("test_token");
                            appAccountManager.checkOAuthTokenVisibility("account_tokenTest_name","authType","test_bundleName",(err,stateBack)=>{
                                console.debug("====>ActsAccountOAuthToken_13100 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                                console.debug("====>ActsAccountOAuthToken_13100 checkOAuthTokenVisibility stateBack:" + stateBack);
3330
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3331 3332 3333 3334
                                expect(stateBack).assertEqual(false);
                                appAccountManager.getOAuthList("account_tokenTest_name","authType",(err,dataArray)=>{
                                    console.debug("====>ActsAccountOAuthToken_13100 getOAuthList err:" + JSON.stringify(err));
                                    console.debug("====>ActsAccountOAuthToken_13100 getOAuthList dataArray:" + JSON.stringify(dataArray));
3335
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3336 3337 3338
                                    expect(dataArray.length).assertEqual(0);
                                    appAccountManager.setOAuthTokenVisibility("account_tokenTest_name","authType","test_bundleName",true,(err)=>{
                                        console.debug("====>ActsAccountOAuthToken_13100 setOAuthTokenVisibility err:" + JSON.stringify(err));
3339
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3340 3341 3342
                                        appAccountManager.checkOAuthTokenVisibility("account_tokenTest_name","authType","test_bundleName",(err,stateBack)=>{
                                            console.debug("====>ActsAccountOAuthToken_13100 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                                            console.debug("====>ActsAccountOAuthToken_13100 checkOAuthTokenVisibility stateBack:" + stateBack);
3343
                                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3344 3345 3346 3347
                                            expect(stateBack).assertEqual(true);
                                            appAccountManager.getOAuthList("account_tokenTest_name","authType",(err,dataArray)=>{
                                                console.debug("====>ActsAccountOAuthToken_13100 getOAuthList err:" + JSON.stringify(err));
                                                console.debug("====>ActsAccountOAuthToken_13100 getOAuthList dataArray:" + JSON.stringify(dataArray));
3348
                                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3349 3350 3351 3352
                                                expect(dataArray.length).assertEqual(1);
                                                expect(dataArray[0]).assertEqual("test_bundleName");
                                                appAccountManager.deleteAccount("account_tokenTest_name",(err)=>{
                                                    console.debug("====>ActsAccountOAuthToken_13100 deleteAccount err:" + JSON.stringify(err));
3353
                                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372
                                                    console.debug("====>ActsAccountOAuthToken_13100 end====");
                                                    done();
                                                });
                                            });
                                        });     
                                    });
                                });
                            }); 
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_13200', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_13200 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.getAuthenticatorInfo("com.example.actsaccountOauthtoken",(err,dataInfo)=>{
                    console.debug("====>ActsAccountOAuthToken_13200 getAuthenticatorInfo err:" + JSON.stringify(err));
                    console.debug("====>ActsAccountOAuthToken_13200 getAuthenticatorInfo dataInfo:" + JSON.stringify(dataInfo));
3373
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425
                    expect(isNaN(dataInfo.iconId)).assertFalse();
                    expect(isNaN(dataInfo.labelId)).assertFalse();
                    done();
                });
            });
        
            it('ActsAccountOAuthToken_13300', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_13300 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.authenticate("authenticate_test_account","com.example.actsaccountOauthtoken","authType",{},{
                    onResult: (resultCode, resultData)=>{
                        console.debug("====>ActsAccountOAuthToken_13300 authenticate resultCode:" + JSON.stringify(resultCode));
                        console.debug("====>ActsAccountOAuthToken_13300 authenticate resultData:" + JSON.stringify(resultData));
                        expect(resultCode.code).assertEqual(0);
                        expect(resultData.name).assertEqual("authenticate_test_account");
                        expect(resultData.authType).assertEqual("authType");
                        expect(resultData.token).assertEqual("serviceApp/authenticate/Token");
                        done();
                    },
                    onRequestRedirected: null
                });
                done();
            });
        
            it('ActsAccountOAuthToken_13400', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_13400 start====");
                var appAccountManager = account.createAppAccountManager();
                appAccountManager.addAccountImplicitly("com.example.actsaccountOauthtoken","authType",{},{
                    onResult: (resultCode, resultData) =>{
                        console.debug("====>ActsAccountOAuthToken_13400 authenticate resultCode:" + JSON.stringify(resultCode));
                        console.debug("====>ActsAccountOAuthToken_13400 authenticate resultData:" + JSON.stringify(resultData));
                        expect(resultCode.code).assertEqual(0);
                        expect(resultData.name).assertEqual("authenticate_test_account");
                        expect(resultData.authType).assertEqual("authType");
                        expect(resultData.token).assertEqual("serviceApp/authenticate/Token");
                        done();
                    },
                    onRequestRedirected: (request) =>{
                        console.debug("====>ActsAccountOAuthToken_13400 onRequestRedirected request:" + JSON.stringify(request));
                        let abilityStartSetting = {
                            want:request
                        }
                        featureAbility.startAbility(abilityStartSetting, (err, result)=>{
                            console.debug("====>ActsAccountOAuthToken_13400 onRequestRedirected err:" + JSON.stringify(err));
                        });
                        done();
                    }
                });
                done();
            });
    })
}