OAuthToken.test.js 227.0 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
                        expect(ArrayData.length).assertEqual(1);
                        expect(ArrayData[0].authType).assertEqual("authType");
                        expect(ArrayData[0].token).assertEqual("test_token");
599 600 601 602
                        expect(ArrayData[0].account).assertEqual(undefined);
                        expect(ArrayData[0].accounts).assertEqual(undefined);
                        console.debug("====>test1" + JSON.stringify(ArrayData[0].account))
                        console.debug("====>test2" + JSON.stringify(ArrayData[0].accounts))
J
jiyong_sd 已提交
603 604
                        appAccountManager.deleteAccount(limitName,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_8500 deleteAccount err:" + JSON.stringify(err));
605
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624
                            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));
625
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
626 627 628 629
                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);
630
                    expect(ArrayData).assertEqual(null);
J
jiyong_sd 已提交
631 632
                    appAccountManager.deleteAccount("account_callback_getAllOAuthTokens_test",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_8600 deleteAccount err:" + JSON.stringify(err));
633
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
634 635 636 637 638 639 640 641 642 643 644 645 646 647
                        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));
648
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
649 650 651 652
                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);
653
                    expect(ArrayData).assertEqual(null);
J
jiyong_sd 已提交
654 655
                    appAccountManager.deleteAccount("account_callback_getAllOAuthTokens_test",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_8700 deleteAccount err:" + JSON.stringify(err));
656
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
657 658 659 660 661 662 663 664 665 666 667 668 669 670
                        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));
671
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
672 673 674 675
                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);
676
                    expect(ArrayData).assertEqual(null);
J
jiyong_sd 已提交
677 678
                    appAccountManager.deleteAccount("account_callback_getAllOAuthTokens_test",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_8800 deleteAccount err:" + JSON.stringify(err));
679
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
680 681 682 683 684 685 686 687 688 689 690 691 692
                        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));
693
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
694 695 696 697
                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);
698
                    expect(ArrayData).assertEqual(null);
J
jiyong_sd 已提交
699 700
                    appAccountManager.deleteAccount("account_callback_getAllOAuthTokens_test",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_8900 deleteAccount err:" + JSON.stringify(err));
701
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717
                        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));
718
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
719 720
                appAccountManager.setOAuthToken("account_callback_normal","authType","callback_normal_token",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_0100 setOAuthToken err:" + JSON.stringify(err));
721
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
722 723 724
                    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);
725
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
726 727 728 729
                        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);
730
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
731 732 733
                            expect(stateBack).assertEqual(true);
                            appAccountManager.deleteOAuthToken("account_callback_normal",OWNERSELF,"authType","callback_normal_token",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_0100 deleteOAuthToken err:" + JSON.stringify(err));
734
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
735 736
                                appAccountManager.deleteAccount("account_callback_normal",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_0100 deleteAccount err:" + JSON.stringify(err));
737
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 777 778 779 780
                                    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));
781
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
782 783 784 785
                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);
786
                    expect(data).assertEqual(null);
J
jiyong_sd 已提交
787 788
                    appAccountManager.deleteAccount("account_callback_noSetToken",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_0300 deleteAccount err:" + JSON.stringify(err));
789
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 821 822 823 824
                        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);
825
                expect(data).assertEqual(null);
J
jiyong_sd 已提交
826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851
                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));
852
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
853 854
                appAccountManager.setOAuthToken("account_callback_setSameAuthType","authType","callback_setSameAuthType_token",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_0700 setOAuthToken err:" + JSON.stringify(err));
855
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
856 857
                    appAccountManager.setOAuthToken("account_callback_setSameAuthType","authType","callback_setSameAuthType_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_0700 setOAuthToken err:" + JSON.stringify(err));
858
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
859 860 861
                        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);
862
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
863 864 865
                            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));
866
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
867 868 869
                                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);
870
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
871 872 873
                                    expect(data).assertEqual("callback_setSameAuthType_DiffToken");
                                    appAccountManager.deleteAccount("account_callback_setSameAuthType",(err)=>{
                                        console.debug("====>ActsAccountOAuthToken_0700 deleteAccount err:" + JSON.stringify(err));
874
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 915 916 917 918
                                        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));
919
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
920 921
                appAccountManager.setOAuthToken("account_callback_setDiff","authType1","callback_setDiff_token1",(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_0900 err:" + JSON.stringify(err));
922
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
923 924
                    appAccountManager.setOAuthToken("account_callback_setDiff","authType2","callback_setDiff_token2",(err)=>{
                        console.debug("====>getOAuthToken ActsAccountOAuthToken_0900 err:" + JSON.stringify(err));
925
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
926 927 928
                        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);
929
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
930 931 932 933
                            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);
934
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
935 936 937
                                expect(data).assertEqual("callback_setDiff_token2");
                                appAccountManager.deleteAccount("account_callback_setDiff", (err)=>{
                                    console.debug("====>deleteAccount ActsAccountOAuthToken_0900 err:" + JSON.stringify(err));
938
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 983 984 985 986
                                    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));
987
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
988 989
                appAccountManager.setOAuthToken("account_callback_setDeleteGet","old_authType","callback_setDeleteGet_token",(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_1100 err:" + JSON.stringify(err));
990
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
991 992
                    appAccountManager.setOAuthToken("account_callback_setDeleteGet","new_authType","callback_setDeleteGet_token",(err)=>{
                        console.debug("====>getOAuthToken ActsAccountOAuthToken_1100 err:" + JSON.stringify(err));
993
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
994 995 996
                        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);
997
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
998 999 1000 1001
                            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);
1002
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
1003 1004 1005 1006 1007 1008 1009
                                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);
1010
                                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
1011 1012 1013
                                        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);
1014
                                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1015 1016 1017 1018 1019 1020 1021
                                            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);
1022
                                                    expect(data).assertEqual(null);
J
jiyong_sd 已提交
1023 1024 1025 1026
                                                    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);
1027
                                                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
1028 1029
                                                        appAccountManager.deleteAccount("account_callback_setDeleteGet", (err)=>{
                                                            console.debug("====>deleteAccount ActsAccountOAuthToken_1100 err:" + JSON.stringify(err));
1030
                                                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 1056 1057 1058 1059
                                                            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 已提交
1060 1061
            var data1BeforeDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType");
            console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data1BeforeDel:" + data1BeforeDel);
1062
            expect(data1BeforeDel).assertEqual("promise_setDeleteGet_token");
J
jiyong_sd 已提交
1063
            console.debug("====>getOAuthToken ActsAccountOAuthToken_1200 start====");
1
15829070344 已提交
1064 1065
            var data2BeforeDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"new_authType");
            console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1200 data2BeforeDel:" + data2BeforeDel);
1066
            expect(data2BeforeDel).assertEqual("promise_setDeleteGet_token");
J
jiyong_sd 已提交
1067 1068 1069 1070 1071 1072 1073

            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));
1074
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
1075 1076 1077 1078
            }

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

            console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 start====");
            try{
1
15829070344 已提交
1108 1109
                var data1AgainDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType",);
                console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data1_AgainDel:" + data1AgainDel);
1110
                expect().assertFail();
J
jiyong_sd 已提交
1111 1112 1113 1114 1115 1116 1117
            }
            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 已提交
1118 1119
                var data2AgainDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"new_authType",);
                console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data2_AgainDel:" + data2AgainDel);
1120
                expect().assertFail();
J
jiyong_sd 已提交
1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137
            }
            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));
1138
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1139 1140
                appAccountManager.setOAuthToken("account_callback_setDeleteGet","authType","account_callback_setDeleteGet_token",(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_1300 err:" + JSON.stringify(err));
1141
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1142 1143
                    appAccountManager.deleteOAuthToken("account_callback_setDeleteGet",OWNERSELF,"authType","account_callback_setDeleteGet_token",(err)=>{
                        console.debug("====>deleteOAuthToken ActsAccountOAuthToken_1300 err:" + JSON.stringify(err));
1144
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1145 1146 1147 1148
                        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);
1149
                            expect(data).assertEqual(null);
J
jiyong_sd 已提交
1150 1151
                            appAccountManager.deleteAccount("account_callback_setDeleteGet", (err)=>{
                                console.debug("====>deleteAccount ActsAccountOAuthToken_1300 err:" + JSON.stringify(err));
1152
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 1245 1246 1247 1248
                                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));
1249
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
1250 1251 1252 1253 1254 1255
                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);
1256
                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
1257 1258
                        appAccountManager.deleteAccount("account_callback_repeatDelete", (err)=>{
                            console.debug("====>deleteAccount ActsAccountOAuthToken_1900 err:" + JSON.stringify(err));
1259
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 1294 1295 1296 1297
                            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));
1298
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1299 1300
                appAccountManager.setOAuthToken("account_callback_repeatDelete","authType","",(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_2100 err:" + JSON.stringify(err));
1301
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1302 1303 1304 1305 1306 1307
                    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);
1308
                            expect(data).assertEqual(null);
J
jiyong_sd 已提交
1309 1310 1311 1312 1313 1314
                            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);
1315
                                    expect(data).assertEqual(null);
J
jiyong_sd 已提交
1316 1317
                                    appAccountManager.deleteAccount("account_callback_repeatDelete", (err)=>{
                                        console.debug("====>deleteAccount ActsAccountOAuthToken_2100 err:" + JSON.stringify(err));
1318
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 1359 1360 1361 1362
                                        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));
1363
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1364 1365
                appAccountManager.setOAuthToken("account_callback_setEmptyToken","authType","",(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_2300 err:" + JSON.stringify(err));
1366
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1367 1368 1369 1370
                    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);
1371
                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
1372 1373
                        appAccountManager.deleteAccount("account_callback_setEmptyToken", (err)=>{
                            console.debug("====>deleteAccount ActsAccountOAuthToken_2300 err:" + JSON.stringify(err));
1374
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 1408 1409 1410 1411
                            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));
1412
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1413 1414
                appAccountManager.setOAuthToken("account_callback_spaceToken","authType"," ",(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_2500 err:" + JSON.stringify(err));
1415
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1416 1417 1418
                    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);
1419
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1420 1421 1422
                        expect(data).assertEqual(" ");
                        appAccountManager.deleteAccount("account_callback_spaceToken", (err)=>{
                            console.debug("====>deleteAccount ActsAccountOAuthToken_2500 err:" + JSON.stringify(err));
1423
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 1456 1457 1458 1459
                            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));
1460
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1461 1462 1463 1464 1465
                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));
1466
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 1504 1505 1506 1507
                        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));
1508
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1509 1510
                appAccountManager.setOAuthToken("account_callback_limitToken","authType",limitToken,(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_2900 err:" + JSON.stringify(err));
1511
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1512 1513 1514
                    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);
1515
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1516 1517 1518
                        expect(data).assertEqual(limitToken);
                        appAccountManager.deleteAccount("account_callback_limitToken", (err)=>{
                            console.debug("====>deleteAccount ActsAccountOAuthToken_2900 err:" + JSON.stringify(err));
1519
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 1555 1556 1557 1558
                            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));
1559
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1560 1561 1562 1563 1564
                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));
1565
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 1604 1605 1606 1607
                        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));
1608
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1609 1610 1611 1612 1613 1614
                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));
1615
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 1659 1660 1661 1662
                        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));
1663
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1664 1665
                    appAccountManager.setOAuthToken("account_callback_limitAuthType",limitAuthType,"account_callback_limitAuthType_token", (err)=>{
                        console.debug("====>setOAuthToken ActsAccountOAuthToken_3500 err:" + JSON.stringify(err));
1666
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1667 1668 1669
                        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);
1670
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1671 1672 1673
                            expect(data).assertEqual("account_callback_limitAuthType_token");
                            appAccountManager.deleteAccount("account_callback_limitAuthType", (err)=>{
                                console.debug("====>delete Account ActsAccountOAuthToken_3500 err:" + JSON.stringify(err));
1674
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 1816 1817 1818 1819
                                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));
1820
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1821 1822 1823 1824
                    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);
1825
                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
1826 1827
                        appAccountManager.deleteAccount("account_callback_invalid_owner", (err)=>{
                            console.debug("====>delete account ActsAccountOAuthToken_4700 err:" + JSON.stringify(err));
1828
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 1860 1861 1862 1863
                            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));
1864
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1865 1866
                    appAccountManager.setOAuthToken("account_callback_authType_empty","","account_callback_authType_empty_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_3700 setOAuthToken err:" + JSON.stringify(err));
1867
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1868 1869 1870
                        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);
1871
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1872 1873 1874
                            expect(data).assertEqual("account_callback_authType_empty_token");
                            appAccountManager.deleteAccount("account_callback_authType_empty",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_3700 deleteAccount err:" + JSON.stringify(err));
1875
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 1902 1903 1904 1905
                                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));
1906
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1907 1908
                    appAccountManager.setOAuthToken("account_callback_authType_space"," ","account_callback_authType_space_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_3900 setOAuthToken err:" + JSON.stringify(err));
1909
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1910 1911 1912
                        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);
1913
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1914 1915 1916
                            expect(data).assertEqual("account_callback_authType_space_token");
                            appAccountManager.deleteAccount("account_callback_authType_space",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_3900 deleteAccount err:" + JSON.stringify(err));
1917
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 1964 1965 1966 1967
                                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));
1968
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1969 1970 1971 1972
                    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);
1973
                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
1974 1975
                        appAccountManager.deleteAccount("account_callback_owner_empty",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_4900 deleteAccount err:" + JSON.stringify(err));
1976
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 2005 2006 2007 2008
                            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));
2009
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2010 2011 2012 2013
                    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);
2014
                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
2015 2016
                        appAccountManager.deleteAccount("account_callback_owner_space",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_5100 deleteAccount err:" + JSON.stringify(err));
2017
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 2046 2047 2048 2049
                            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));
2050
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2051 2052
                    appAccountManager.setOAuthToken("account_callback_authType_invalid","authType","account_callback_authType_invalid_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_5300 setOAuthToken err:" + JSON.stringify(err));
2053
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2054 2055 2056 2057
                        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);
2058
                            expect(data).assertEqual(null);
J
jiyong_sd 已提交
2059 2060
                            appAccountManager.deleteAccount("account_callback_authType_invalid",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_5300 deleteAccount err:" + JSON.stringify(err));
2061
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 2093 2094 2095 2096
                                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));
2097
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2098 2099
                    appAccountManager.setOAuthToken("account_callback_authType_empty","authType","account_callback_authType_empty_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_5500 setOAuthToken err:" + JSON.stringify(err));
2100
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2101 2102 2103 2104
                        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);
2105
                            expect(data).assertEqual(null);
J
jiyong_sd 已提交
2106 2107
                            appAccountManager.deleteAccount("account_callback_authType_empty",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_5500 deleteAccount err:" + JSON.stringify(err));
2108
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 2140 2141 2142 2143
                                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));
2144
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2145 2146
                    appAccountManager.setOAuthToken("account_callback_authType_space","authType","account_callback_authType_space_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_5700 setOAuthToken err:" + JSON.stringify(err));
2147
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2148 2149 2150 2151
                        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);
2152
                            expect(data).assertEqual(null);
J
jiyong_sd 已提交
2153 2154
                            appAccountManager.deleteAccount("account_callback_authType_space",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_5700 deleteAccount err:" + JSON.stringify(err));
2155
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 2187 2188 2189 2190
                                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));
2191
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2192 2193
                    appAccountManager.setOAuthToken("account_callback_owner_invalid","authType","account_callback_owner_invalid_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_5900 setOAuthToken err:" + JSON.stringify(err));
2194
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2195 2196 2197 2198 2199
                        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));
2200
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 2232 2233 2234 2235
                                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));
2236
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2237 2238
                    appAccountManager.setOAuthToken("account_callback_owner_empty","authType","account_callback_owner_empty_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_6100 setOAuthToken err:" + JSON.stringify(err));
2239
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2240 2241 2242 2243 2244
                        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));
2245
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 2277 2278 2279 2280
                                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));
2281
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2282 2283
                    appAccountManager.setOAuthToken("account_callback_owner_space","authType","account_callback_owner_space_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_6300 setOAuthToken err:" + JSON.stringify(err));
2284
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2285 2286 2287 2288 2289
                        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));
2290
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 2326 2327 2328 2329
                                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));
2330
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2331 2332 2333 2334 2335
                    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));
2336
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 2373 2374 2375 2376
                            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));
2377
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2378 2379
                    appAccountManager.setOAuthToken("account_callback_token_limit","authType",limitToken,(err)=>{
                        console.debug("====>ActsAccountOAuthToken_6700 setOAuthToken err:" + JSON.stringify(err));
2380
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2381 2382
                        appAccountManager.deleteOAuthToken("account_callback_token_limit",OWNERSELF,"authType",limitToken,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_6700 getOAuthToken err:" + JSON.stringify(err));
2383
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2384 2385
                            appAccountManager.deleteAccount("account_callback_token_limit",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_6700 deleteAccount err:" + JSON.stringify(err));
2386
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 2416 2417 2418 2419
                                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));
2420
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2421 2422
                    appAccountManager.setOAuthToken("account_callback_delete_space","authType","account_callback_delete_space_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_6900 setOAuthToken err:" + JSON.stringify(err));
2423
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2424 2425
                        appAccountManager.deleteOAuthToken("account_callback_delete_space",OWNERSELF,"authType","",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_6900 getOAuthToken err:" + JSON.stringify(err));
2426
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2427 2428 2429
                            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);
2430
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2431 2432 2433
                                expect(data).assertEqual("account_callback_delete_space_token");
                                appAccountManager.deleteAccount("account_callback_delete_space",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_6900 deleteAccount err:" + JSON.stringify(err));
2434
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 2460 2461 2462 2463
                                    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 已提交
2464 2465 2466 2467 2468 2469
            	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 已提交
2470 2471 2472
                    console.debug("====>ActsAccountOAuthToken_9200 getAuthenticatorCallback err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    done();
1
15829070344 已提交
2473
            	})
J
jiyong_sd 已提交
2474 2475 2476 2477 2478 2479 2480 2481
            });
        
            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);
2482
                    expect(databack).assertEqual(null);
J
jiyong_sd 已提交
2483 2484 2485 2486 2487 2488 2489 2490 2491 2492
                    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);
2493
                    expect(databack).assertEqual(null);
J
jiyong_sd 已提交
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 2570 2571 2572 2573
                    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 已提交
2574 2575
            	var appAccountManager = account.createAppAccountManager();
            	appAccountManager.addAccount("account_setOAuthTokenVisibility_name",(err,)=>{
J
jiyong_sd 已提交
2576
                    console.debug("====>ActsAccountOAuthToken_9900 addAccount err:" + JSON.stringify(err));
1
15829070344 已提交
2577 2578
                    expect(err).assertEqual(null);            
                    appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","authType","test_BundleName",true).then(()=>{
J
jiyong_sd 已提交
2579 2580 2581
                        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 已提交
2582
                            expect(err.code!=0).assertEqual(true);                        
J
jiyong_sd 已提交
2583 2584
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","authType",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_9900 getOAuthList err:" + JSON.stringify(err));
1
15829070344 已提交
2585
                                expect(err).assertEqual(null);                       
J
jiyong_sd 已提交
2586 2587
                                console.debug("====>ActsAccountOAuthToken_9900 getOAuthList dataArray:" + JSON.stringify(dataArray));
                                expect(dataArray.length).assertEqual(1);
1
15829070344 已提交
2588 2589
                            	expect(dataArray[0]).assertEqual("test_BundleName");
                            	appAccountManager.deleteAccount("account_setOAuthTokenVisibility_name",(err)=>{
J
jiyong_sd 已提交
2590
                                    console.debug("====>ActsAccountOAuthToken_9900 deleteAccount err:" + JSON.stringify(err));
1
15829070344 已提交
2591
                                    expect(err).assertEqual(null);                            
J
jiyong_sd 已提交
2592 2593 2594 2595 2596
                                    console.debug("====>ActsAccountOAuthToken_9900 end====");
                                    done();
                                });
                            });
                        });
1
15829070344 已提交
2597 2598 2599 2600
                    }).catch((err)=>{
                        expect(err).assertEqual(null);                
		        done();
                    })
J
jiyong_sd 已提交
2601 2602 2603 2604 2605 2606 2607 2608
                });
            });
        
            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));
2609
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2610 2611
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10000 setOAuthToken err:" + JSON.stringify(err));
2612
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2613 2614
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","authType","test_BundleName","",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10000 setOAuthTokenVisibility err:" + JSON.stringify(err));
2615
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2616 2617
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","authType",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_10000 getOAuthList err:" + JSON.stringify(err));
2618
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2619 2620 2621 2622
                                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));
2623
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637
                                    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));
2638
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2639 2640
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10100 setOAuthToken err:" + JSON.stringify(err));
2641
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2642 2643
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","authType","test_BundleName","invalid_string",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10100 setOAuthTokenVisibility err:" + JSON.stringify(err));
2644
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2645 2646
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","authType",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_10100 getOAuthList err:" + JSON.stringify(err));
2647
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2648 2649 2650 2651
                                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));
2652
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666
                                    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));
2667
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2668 2669
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10200 setOAuthToken err:" + JSON.stringify(err));
2670
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2671 2672 2673 2674 2675
                        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));
2676
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689
                                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));
2690
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2691 2692
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10300 setOAuthToken err:" + JSON.stringify(err));
2693
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2694 2695
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","authType"," ",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10300 setOAuthTokenVisibility err:" + JSON.stringify(err));
2696
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2697 2698
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","authType",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_10300 getOAuthList err:" + JSON.stringify(err));
2699
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2700 2701 2702 2703 2704
                                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));
2705
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723
                                    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));
2724
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2725 2726
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10400 setOAuthToken err:" + JSON.stringify(err));
2727
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2728 2729 2730 2731 2732
                        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));
2733
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746
                                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));
2747
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2748 2749
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10500 setOAuthToken err:" + JSON.stringify(err));
2750
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2751 2752
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","","test_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10500 setOAuthTokenVisibility err:" + JSON.stringify(err));
2753
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2754 2755
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_10500 getOAuthList err:" + JSON.stringify(err));
2756
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2757 2758 2759 2760 2761
                                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));
2762
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2763 2764 2765 2766
                                    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));
2767
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782
                                        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));
2783
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2784 2785
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10600 setOAuthToken err:" + JSON.stringify(err));
2786
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2787 2788
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name"," ","test_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10600 setOAuthTokenVisibility err:" + JSON.stringify(err));
2789
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2790 2791
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name"," ",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_10600 getOAuthList err:" + JSON.stringify(err));
2792
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2793 2794 2795 2796 2797
                                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));
2798
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2799 2800 2801 2802
                                    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));
2803
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823
                                        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));
2824
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2825 2826
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10700 setOAuthToken err:" + JSON.stringify(err));
2827
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2828 2829 2830 2831 2832
                        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));
2833
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2834 2835 2836 2837
                                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));
2838
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852
                                    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));
2853
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2854 2855
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10800 setOAuthToken err:" + JSON.stringify(err));
2856
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2857 2858
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","invalid_authType","test_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10800 setOAuthTokenVisibility err:" + JSON.stringify(err));
2859
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2860 2861
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","invalid_authType",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_10800 getOAuthList err:" + JSON.stringify(err));
2862
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2863 2864 2865 2866 2867
                                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));
2868
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2869 2870 2871 2872
                                    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));
2873
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 2973 2974 2975 2976
                                        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));
2977
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2978 2979
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_11700 setOAuthToken err:" + JSON.stringify(err));
2980
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2981 2982 2983
                        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);
2984
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2985 2986 2987 2988
                            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);
2989
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2990 2991 2992
                                expect(stateBack).assertEqual(true);
                                appAccountManager.deleteAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_11700 deleteAccount err:" + JSON.stringify(err));
2993
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007
                                    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));
3008
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3009 3010
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_11800 setOAuthToken err:" + JSON.stringify(err));
3011
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3012 3013 3014
                        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);
3015
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3016 3017 3018 3019
                            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);
3020
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3021 3022 3023
                                expect(stateBack).assertEqual(true);
                                appAccountManager.deleteAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_11800 deleteAccount err:" + JSON.stringify(err));
3024
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042
                                    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));
3043
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3044 3045
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_11900 setOAuthToken err:" + JSON.stringify(err));
3046
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3047 3048 3049 3050 3051 3052 3053 3054
                        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));
3055
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069
                                    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));
3070
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3071 3072
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12000 setOAuthToken err:" + JSON.stringify(err));
3073
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3074 3075 3076
                        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);
3077
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3078 3079 3080 3081
                            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);
3082
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3083 3084 3085
                                expect(stateBack).assertEqual(true);
                                appAccountManager.deleteAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_12000 deleteAccount err:" + JSON.stringify(err));
3086
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100
                                    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));
3101
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3102 3103
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12100 setOAuthToken err:" + JSON.stringify(err));
3104
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3105 3106 3107 3108 3109 3110
                        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));
3111
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124
                                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));
3125
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3126 3127
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12200 setOAuthToken err:" + JSON.stringify(err));
3128
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3129 3130 3131
                        appAccountManager.checkOAuthTokenVisibility("account_checkOAuthTokenVisibility_name","authType"," ",(err,stateBack)=>{
                            console.debug("====>ActsAccountOAuthToken_12200 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_12200 checkOAuthTokenVisibility stateBack:" + stateBack);
3132
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3133 3134 3135
                            expect(stateBack).assertEqual(false);
                            appAccountManager.deleteAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_12200 deleteAccount err:" + JSON.stringify(err));
3136
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153
                                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));
3154
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3155 3156
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12300 setOAuthToken err:" + JSON.stringify(err));
3157
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3158 3159 3160 3161 3162 3163
                        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));
3164
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177
                                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));
3178
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3179 3180
                    appAccountManager.setOAuthToken("account_testGetOAuthList_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12400 setOAuthToken err:" + JSON.stringify(err));
3181
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3182 3183
                        appAccountManager.setOAuthTokenVisibility("account_testGetOAuthList_name","authType","test_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_12400 setOAuthTokenVisibility err:" + JSON.stringify(err));
3184
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3185 3186
                            appAccountManager.getOAuthList("account_testGetOAuthList_name","",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_12400 getOAuthList err:" + JSON.stringify(err));
3187
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3188 3189 3190 3191
                                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));
3192
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206
                                    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));
3207
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3208 3209
                    appAccountManager.setOAuthToken("account_testGetOAuthList_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12500 setOAuthToken err:" + JSON.stringify(err));
3210
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3211 3212
                        appAccountManager.setOAuthTokenVisibility("account_testGetOAuthList_name","authType","test_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_12500 setOAuthTokenVisibility err:" + JSON.stringify(err));
3213
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3214 3215
                            appAccountManager.getOAuthList("account_testGetOAuthList_name"," ",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_12500 getOAuthList err:" + JSON.stringify(err));
3216
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3217 3218 3219 3220
                                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));
3221
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239
                                    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));
3240
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3241 3242
                    appAccountManager.setOAuthToken("account_testGetOAuthList_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12600 setOAuthToken err:" + JSON.stringify(err));
3243
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3244 3245
                        appAccountManager.setOAuthTokenVisibility("account_testGetOAuthList_name","authType","test_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_12600 setOAuthTokenVisibility err:" + JSON.stringify(err));
3246
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3247 3248 3249 3250
                            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));
3251
                                expect(dataArray).assertEqual(null);
J
jiyong_sd 已提交
3252 3253
                                appAccountManager.deleteAccount("account_testGetOAuthList_name",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_12600 deleteAccount err:" + JSON.stringify(err));
3254
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266
                                    console.debug("====>ActsAccountOAuthToken_12600 end====");
                                    done();
                                });
                            });    
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_12700', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_12700 start====");
                var appAccountManager = account.createAppAccountManager();
1
15829070344 已提交
3267 3268 3269 3270 3271
                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 已提交
3272 3273
                    expect(err.code!=0).assertEqual(true);
                    done();
1
15829070344 已提交
3274
                })
J
jiyong_sd 已提交
3275 3276 3277 3278 3279 3280 3281 3282 3283
            });
        
            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);
3284
                    expect(dataArray).assertEqual(null);
J
jiyong_sd 已提交
3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299
                    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);
3300
                    expect(dataArray).assertEqual(null);
J
jiyong_sd 已提交
3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311
                    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);
3312
                    expect(dataArray).assertEqual(null);
J
jiyong_sd 已提交
3313 3314 3315 3316 3317 3318 3319 3320 3321
                    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));
3322
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3323 3324
                    appAccountManager.setOAuthToken("account_tokenTest_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_13100 setOAuthToken err:" + JSON.stringify(err));
3325
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3326 3327 3328
                        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);
3329
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3330 3331 3332 3333
                            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);
3334
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3335 3336 3337 3338
                                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));
3339
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3340 3341 3342
                                    expect(dataArray.length).assertEqual(0);
                                    appAccountManager.setOAuthTokenVisibility("account_tokenTest_name","authType","test_bundleName",true,(err)=>{
                                        console.debug("====>ActsAccountOAuthToken_13100 setOAuthTokenVisibility err:" + JSON.stringify(err));
3343
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3344 3345 3346
                                        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);
3347
                                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3348 3349 3350 3351
                                            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));
3352
                                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3353 3354 3355 3356
                                                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));
3357
                                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376
                                                    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));
3377
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
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 3426 3427 3428 3429
                    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();
            });
    })
}