OAuthToken.test.js 226.8 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
                        console.debug("====>test1" + JSON.stringify(ArrayData[0].account))
                        console.debug("====>test2" + JSON.stringify(ArrayData[0].accounts))
J
jiyong_sd 已提交
601 602
                        appAccountManager.deleteAccount(limitName,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_8500 deleteAccount err:" + JSON.stringify(err));
603
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622
                            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));
623
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
624 625 626 627
                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);
628
                    expect(ArrayData).assertEqual(null);
J
jiyong_sd 已提交
629 630
                    appAccountManager.deleteAccount("account_callback_getAllOAuthTokens_test",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_8600 deleteAccount err:" + JSON.stringify(err));
631
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
632 633 634 635 636 637 638 639 640 641 642 643 644 645
                        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));
646
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
647 648 649 650
                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);
651
                    expect(ArrayData).assertEqual(null);
J
jiyong_sd 已提交
652 653
                    appAccountManager.deleteAccount("account_callback_getAllOAuthTokens_test",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_8700 deleteAccount err:" + JSON.stringify(err));
654
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
655 656 657 658 659 660 661 662 663 664 665 666 667 668
                        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));
669
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
670 671 672 673
                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);
674
                    expect(ArrayData).assertEqual(null);
J
jiyong_sd 已提交
675 676
                    appAccountManager.deleteAccount("account_callback_getAllOAuthTokens_test",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_8800 deleteAccount err:" + JSON.stringify(err));
677
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
678 679 680 681 682 683 684 685 686 687 688 689 690
                        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));
691
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
692 693 694 695
                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);
696
                    expect(ArrayData).assertEqual(null);
J
jiyong_sd 已提交
697 698
                    appAccountManager.deleteAccount("account_callback_getAllOAuthTokens_test",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_8900 deleteAccount err:" + JSON.stringify(err));
699
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715
                        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));
716
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
717 718
                appAccountManager.setOAuthToken("account_callback_normal","authType","callback_normal_token",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_0100 setOAuthToken err:" + JSON.stringify(err));
719
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
720 721 722
                    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);
723
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
724 725 726 727
                        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);
728
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
729 730 731
                            expect(stateBack).assertEqual(true);
                            appAccountManager.deleteOAuthToken("account_callback_normal",OWNERSELF,"authType","callback_normal_token",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_0100 deleteOAuthToken err:" + JSON.stringify(err));
732
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
733 734
                                appAccountManager.deleteAccount("account_callback_normal",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_0100 deleteAccount err:" + JSON.stringify(err));
735
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778
                                    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));
779
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
780 781 782 783
                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);
784
                    expect(data).assertEqual(null);
J
jiyong_sd 已提交
785 786
                    appAccountManager.deleteAccount("account_callback_noSetToken",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_0300 deleteAccount err:" + JSON.stringify(err));
787
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822
                        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);
823
                expect(data).assertEqual(null);
J
jiyong_sd 已提交
824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849
                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));
850
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
851 852
                appAccountManager.setOAuthToken("account_callback_setSameAuthType","authType","callback_setSameAuthType_token",(err)=>{
                    console.debug("====>ActsAccountOAuthToken_0700 setOAuthToken err:" + JSON.stringify(err));
853
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
854 855
                    appAccountManager.setOAuthToken("account_callback_setSameAuthType","authType","callback_setSameAuthType_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_0700 setOAuthToken err:" + JSON.stringify(err));
856
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
857 858 859
                        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);
860
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
861 862 863
                            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));
864
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
865 866 867
                                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);
868
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
869 870 871
                                    expect(data).assertEqual("callback_setSameAuthType_DiffToken");
                                    appAccountManager.deleteAccount("account_callback_setSameAuthType",(err)=>{
                                        console.debug("====>ActsAccountOAuthToken_0700 deleteAccount err:" + JSON.stringify(err));
872
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916
                                        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));
917
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
918 919
                appAccountManager.setOAuthToken("account_callback_setDiff","authType1","callback_setDiff_token1",(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_0900 err:" + JSON.stringify(err));
920
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
921 922
                    appAccountManager.setOAuthToken("account_callback_setDiff","authType2","callback_setDiff_token2",(err)=>{
                        console.debug("====>getOAuthToken ActsAccountOAuthToken_0900 err:" + JSON.stringify(err));
923
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
924 925 926
                        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);
927
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
928 929 930 931
                            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);
932
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
933 934 935
                                expect(data).assertEqual("callback_setDiff_token2");
                                appAccountManager.deleteAccount("account_callback_setDiff", (err)=>{
                                    console.debug("====>deleteAccount ActsAccountOAuthToken_0900 err:" + JSON.stringify(err));
936
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984
                                    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));
985
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
986 987
                appAccountManager.setOAuthToken("account_callback_setDeleteGet","old_authType","callback_setDeleteGet_token",(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_1100 err:" + JSON.stringify(err));
988
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
989 990
                    appAccountManager.setOAuthToken("account_callback_setDeleteGet","new_authType","callback_setDeleteGet_token",(err)=>{
                        console.debug("====>getOAuthToken ActsAccountOAuthToken_1100 err:" + JSON.stringify(err));
991
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
992 993 994
                        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);
995
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
996 997 998 999
                            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);
1000
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
1001 1002 1003 1004 1005 1006 1007
                                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);
1008
                                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
1009 1010 1011
                                        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);
1012
                                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1013 1014 1015 1016 1017 1018 1019
                                            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);
1020
                                                    expect(data).assertEqual(null);
J
jiyong_sd 已提交
1021 1022 1023 1024
                                                    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);
1025
                                                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
1026 1027
                                                        appAccountManager.deleteAccount("account_callback_setDeleteGet", (err)=>{
                                                            console.debug("====>deleteAccount ActsAccountOAuthToken_1100 err:" + JSON.stringify(err));
1028
                                                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057
                                                            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 已提交
1058 1059
            var data1BeforeDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType");
            console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data1BeforeDel:" + data1BeforeDel);
1060
            expect(data1BeforeDel).assertEqual("promise_setDeleteGet_token");
J
jiyong_sd 已提交
1061
            console.debug("====>getOAuthToken ActsAccountOAuthToken_1200 start====");
1
15829070344 已提交
1062 1063
            var data2BeforeDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"new_authType");
            console.debug("====>getOAuthToken getNew ActsAccountOAuthToken_1200 data2BeforeDel:" + data2BeforeDel);
1064
            expect(data2BeforeDel).assertEqual("promise_setDeleteGet_token");
J
jiyong_sd 已提交
1065 1066 1067 1068 1069 1070 1071

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

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

            console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 start====");
            try{
1
15829070344 已提交
1106 1107
                var data1AgainDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"old_authType",);
                console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data1_AgainDel:" + data1AgainDel);
1108
                expect().assertFail();
J
jiyong_sd 已提交
1109 1110 1111 1112 1113 1114 1115
            }
            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 已提交
1116 1117
                var data2AgainDel = await appAccountManager.getOAuthToken("account_promise_setDeleteGet",OWNERSELF,"new_authType",);
                console.debug("====>getOAuthToken getOld ActsAccountOAuthToken_1200 data2_AgainDel:" + data2AgainDel);
1118
                expect().assertFail();
J
jiyong_sd 已提交
1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135
            }
            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));
1136
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1137 1138
                appAccountManager.setOAuthToken("account_callback_setDeleteGet","authType","account_callback_setDeleteGet_token",(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_1300 err:" + JSON.stringify(err));
1139
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1140 1141
                    appAccountManager.deleteOAuthToken("account_callback_setDeleteGet",OWNERSELF,"authType","account_callback_setDeleteGet_token",(err)=>{
                        console.debug("====>deleteOAuthToken ActsAccountOAuthToken_1300 err:" + JSON.stringify(err));
1142
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1143 1144 1145 1146
                        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);
1147
                            expect(data).assertEqual(null);
J
jiyong_sd 已提交
1148 1149
                            appAccountManager.deleteAccount("account_callback_setDeleteGet", (err)=>{
                                console.debug("====>deleteAccount ActsAccountOAuthToken_1300 err:" + JSON.stringify(err));
1150
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246
                                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));
1247
                expect(err).assertEqual(null);
J
jiyong_sd 已提交
1248 1249 1250 1251 1252 1253
                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);
1254
                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
1255 1256
                        appAccountManager.deleteAccount("account_callback_repeatDelete", (err)=>{
                            console.debug("====>deleteAccount ActsAccountOAuthToken_1900 err:" + JSON.stringify(err));
1257
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295
                            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));
1296
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1297 1298
                appAccountManager.setOAuthToken("account_callback_repeatDelete","authType","",(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_2100 err:" + JSON.stringify(err));
1299
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1300 1301 1302 1303 1304 1305
                    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);
1306
                            expect(data).assertEqual(null);
J
jiyong_sd 已提交
1307 1308 1309 1310 1311 1312
                            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);
1313
                                    expect(data).assertEqual(null);
J
jiyong_sd 已提交
1314 1315
                                    appAccountManager.deleteAccount("account_callback_repeatDelete", (err)=>{
                                        console.debug("====>deleteAccount ActsAccountOAuthToken_2100 err:" + JSON.stringify(err));
1316
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360
                                        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));
1361
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1362 1363
                appAccountManager.setOAuthToken("account_callback_setEmptyToken","authType","",(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_2300 err:" + JSON.stringify(err));
1364
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1365 1366 1367 1368
                    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);
1369
                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
1370 1371
                        appAccountManager.deleteAccount("account_callback_setEmptyToken", (err)=>{
                            console.debug("====>deleteAccount ActsAccountOAuthToken_2300 err:" + JSON.stringify(err));
1372
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409
                            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));
1410
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1411 1412
                appAccountManager.setOAuthToken("account_callback_spaceToken","authType"," ",(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_2500 err:" + JSON.stringify(err));
1413
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1414 1415 1416
                    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);
1417
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1418 1419 1420
                        expect(data).assertEqual(" ");
                        appAccountManager.deleteAccount("account_callback_spaceToken", (err)=>{
                            console.debug("====>deleteAccount ActsAccountOAuthToken_2500 err:" + JSON.stringify(err));
1421
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457
                            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));
1458
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1459 1460 1461 1462 1463
                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));
1464
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505
                        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));
1506
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1507 1508
                appAccountManager.setOAuthToken("account_callback_limitToken","authType",limitToken,(err)=>{
                    console.debug("====>getOAuthToken ActsAccountOAuthToken_2900 err:" + JSON.stringify(err));
1509
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1510 1511 1512
                    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);
1513
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1514 1515 1516
                        expect(data).assertEqual(limitToken);
                        appAccountManager.deleteAccount("account_callback_limitToken", (err)=>{
                            console.debug("====>deleteAccount ActsAccountOAuthToken_2900 err:" + JSON.stringify(err));
1517
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556
                            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));
1557
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1558 1559 1560 1561 1562
                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));
1563
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605
                        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));
1606
            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1607 1608 1609 1610 1611 1612
                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));
1613
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660
                        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));
1661
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1662 1663
                    appAccountManager.setOAuthToken("account_callback_limitAuthType",limitAuthType,"account_callback_limitAuthType_token", (err)=>{
                        console.debug("====>setOAuthToken ActsAccountOAuthToken_3500 err:" + JSON.stringify(err));
1664
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1665 1666 1667
                        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);
1668
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1669 1670 1671
                            expect(data).assertEqual("account_callback_limitAuthType_token");
                            appAccountManager.deleteAccount("account_callback_limitAuthType", (err)=>{
                                console.debug("====>delete Account ActsAccountOAuthToken_3500 err:" + JSON.stringify(err));
1672
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817
                                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));
1818
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1819 1820 1821 1822
                    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);
1823
                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
1824 1825
                        appAccountManager.deleteAccount("account_callback_invalid_owner", (err)=>{
                            console.debug("====>delete account ActsAccountOAuthToken_4700 err:" + JSON.stringify(err));
1826
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861
                            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));
1862
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1863 1864
                    appAccountManager.setOAuthToken("account_callback_authType_empty","","account_callback_authType_empty_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_3700 setOAuthToken err:" + JSON.stringify(err));
1865
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1866 1867 1868
                        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);
1869
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1870 1871 1872
                            expect(data).assertEqual("account_callback_authType_empty_token");
                            appAccountManager.deleteAccount("account_callback_authType_empty",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_3700 deleteAccount err:" + JSON.stringify(err));
1873
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903
                                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));
1904
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1905 1906
                    appAccountManager.setOAuthToken("account_callback_authType_space"," ","account_callback_authType_space_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_3900 setOAuthToken err:" + JSON.stringify(err));
1907
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
1908 1909 1910
                        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);
1911
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1912 1913 1914
                            expect(data).assertEqual("account_callback_authType_space_token");
                            appAccountManager.deleteAccount("account_callback_authType_space",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_3900 deleteAccount err:" + JSON.stringify(err));
1915
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965
                                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));
1966
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
1967 1968 1969 1970
                    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);
1971
                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
1972 1973
                        appAccountManager.deleteAccount("account_callback_owner_empty",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_4900 deleteAccount err:" + JSON.stringify(err));
1974
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006
                            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));
2007
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2008 2009 2010 2011
                    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);
2012
                        expect(data).assertEqual(null);
J
jiyong_sd 已提交
2013 2014
                        appAccountManager.deleteAccount("account_callback_owner_space",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_5100 deleteAccount err:" + JSON.stringify(err));
2015
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047
                            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));
2048
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2049 2050
                    appAccountManager.setOAuthToken("account_callback_authType_invalid","authType","account_callback_authType_invalid_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_5300 setOAuthToken err:" + JSON.stringify(err));
2051
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2052 2053 2054 2055
                        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);
2056
                            expect(data).assertEqual(null);
J
jiyong_sd 已提交
2057 2058
                            appAccountManager.deleteAccount("account_callback_authType_invalid",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_5300 deleteAccount err:" + JSON.stringify(err));
2059
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094
                                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));
2095
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2096 2097
                    appAccountManager.setOAuthToken("account_callback_authType_empty","authType","account_callback_authType_empty_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_5500 setOAuthToken err:" + JSON.stringify(err));
2098
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2099 2100 2101 2102
                        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);
2103
                            expect(data).assertEqual(null);
J
jiyong_sd 已提交
2104 2105
                            appAccountManager.deleteAccount("account_callback_authType_empty",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_5500 deleteAccount err:" + JSON.stringify(err));
2106
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141
                                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));
2142
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2143 2144
                    appAccountManager.setOAuthToken("account_callback_authType_space","authType","account_callback_authType_space_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_5700 setOAuthToken err:" + JSON.stringify(err));
2145
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2146 2147 2148 2149
                        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);
2150
                            expect(data).assertEqual(null);
J
jiyong_sd 已提交
2151 2152
                            appAccountManager.deleteAccount("account_callback_authType_space",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_5700 deleteAccount err:" + JSON.stringify(err));
2153
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188
                                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));
2189
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2190 2191
                    appAccountManager.setOAuthToken("account_callback_owner_invalid","authType","account_callback_owner_invalid_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_5900 setOAuthToken err:" + JSON.stringify(err));
2192
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2193 2194 2195 2196 2197
                        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));
2198
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233
                                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));
2234
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2235 2236
                    appAccountManager.setOAuthToken("account_callback_owner_empty","authType","account_callback_owner_empty_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_6100 setOAuthToken err:" + JSON.stringify(err));
2237
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2238 2239 2240 2241 2242
                        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));
2243
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278
                                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));
2279
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2280 2281
                    appAccountManager.setOAuthToken("account_callback_owner_space","authType","account_callback_owner_space_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_6300 setOAuthToken err:" + JSON.stringify(err));
2282
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2283 2284 2285 2286 2287
                        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));
2288
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327
                                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));
2328
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2329 2330 2331 2332 2333
                    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));
2334
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374
                            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));
2375
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2376 2377
                    appAccountManager.setOAuthToken("account_callback_token_limit","authType",limitToken,(err)=>{
                        console.debug("====>ActsAccountOAuthToken_6700 setOAuthToken err:" + JSON.stringify(err));
2378
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2379 2380
                        appAccountManager.deleteOAuthToken("account_callback_token_limit",OWNERSELF,"authType",limitToken,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_6700 getOAuthToken err:" + JSON.stringify(err));
2381
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2382 2383
                            appAccountManager.deleteAccount("account_callback_token_limit",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_6700 deleteAccount err:" + JSON.stringify(err));
2384
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417
                                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));
2418
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2419 2420
                    appAccountManager.setOAuthToken("account_callback_delete_space","authType","account_callback_delete_space_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_6900 setOAuthToken err:" + JSON.stringify(err));
2421
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2422 2423
                        appAccountManager.deleteOAuthToken("account_callback_delete_space",OWNERSELF,"authType","",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_6900 getOAuthToken err:" + JSON.stringify(err));
2424
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2425 2426 2427
                            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);
2428
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2429 2430 2431
                                expect(data).assertEqual("account_callback_delete_space_token");
                                appAccountManager.deleteAccount("account_callback_delete_space",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_6900 deleteAccount err:" + JSON.stringify(err));
2432
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461
                                    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 已提交
2462 2463 2464 2465 2466 2467
            	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 已提交
2468 2469 2470
                    console.debug("====>ActsAccountOAuthToken_9200 getAuthenticatorCallback err:" + JSON.stringify(err));
                    expect(err.code!=0).assertEqual(true);
                    done();
1
15829070344 已提交
2471
            	})
J
jiyong_sd 已提交
2472 2473 2474 2475 2476 2477 2478 2479
            });
        
            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);
2480
                    expect(databack).assertEqual(null);
J
jiyong_sd 已提交
2481 2482 2483 2484 2485 2486 2487 2488 2489 2490
                    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);
2491
                    expect(databack).assertEqual(null);
J
jiyong_sd 已提交
2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571
                    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 已提交
2572 2573
            	var appAccountManager = account.createAppAccountManager();
            	appAccountManager.addAccount("account_setOAuthTokenVisibility_name",(err,)=>{
J
jiyong_sd 已提交
2574
                    console.debug("====>ActsAccountOAuthToken_9900 addAccount err:" + JSON.stringify(err));
1
15829070344 已提交
2575 2576
                    expect(err).assertEqual(null);            
                    appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","authType","test_BundleName",true).then(()=>{
J
jiyong_sd 已提交
2577 2578 2579
                        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 已提交
2580
                            expect(err.code!=0).assertEqual(true);                        
J
jiyong_sd 已提交
2581 2582
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","authType",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_9900 getOAuthList err:" + JSON.stringify(err));
1
15829070344 已提交
2583
                                expect(err).assertEqual(null);                       
J
jiyong_sd 已提交
2584 2585
                                console.debug("====>ActsAccountOAuthToken_9900 getOAuthList dataArray:" + JSON.stringify(dataArray));
                                expect(dataArray.length).assertEqual(1);
1
15829070344 已提交
2586 2587
                            	expect(dataArray[0]).assertEqual("test_BundleName");
                            	appAccountManager.deleteAccount("account_setOAuthTokenVisibility_name",(err)=>{
J
jiyong_sd 已提交
2588
                                    console.debug("====>ActsAccountOAuthToken_9900 deleteAccount err:" + JSON.stringify(err));
1
15829070344 已提交
2589
                                    expect(err).assertEqual(null);                            
J
jiyong_sd 已提交
2590 2591 2592 2593 2594
                                    console.debug("====>ActsAccountOAuthToken_9900 end====");
                                    done();
                                });
                            });
                        });
1
15829070344 已提交
2595 2596 2597 2598
                    }).catch((err)=>{
                        expect(err).assertEqual(null);                
		        done();
                    })
J
jiyong_sd 已提交
2599 2600 2601 2602 2603 2604 2605 2606
                });
            });
        
            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));
2607
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2608 2609
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10000 setOAuthToken err:" + JSON.stringify(err));
2610
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2611 2612
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","authType","test_BundleName","",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10000 setOAuthTokenVisibility err:" + JSON.stringify(err));
2613
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2614 2615
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","authType",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_10000 getOAuthList err:" + JSON.stringify(err));
2616
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2617 2618 2619 2620
                                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));
2621
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635
                                    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));
2636
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2637 2638
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10100 setOAuthToken err:" + JSON.stringify(err));
2639
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2640 2641
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","authType","test_BundleName","invalid_string",(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10100 setOAuthTokenVisibility err:" + JSON.stringify(err));
2642
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2643 2644
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","authType",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_10100 getOAuthList err:" + JSON.stringify(err));
2645
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2646 2647 2648 2649
                                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));
2650
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664
                                    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));
2665
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2666 2667
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10200 setOAuthToken err:" + JSON.stringify(err));
2668
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2669 2670 2671 2672 2673
                        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));
2674
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687
                                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));
2688
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2689 2690
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10300 setOAuthToken err:" + JSON.stringify(err));
2691
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2692 2693
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","authType"," ",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10300 setOAuthTokenVisibility err:" + JSON.stringify(err));
2694
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2695 2696
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","authType",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_10300 getOAuthList err:" + JSON.stringify(err));
2697
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2698 2699 2700 2701 2702
                                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));
2703
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721
                                    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));
2722
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2723 2724
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10400 setOAuthToken err:" + JSON.stringify(err));
2725
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2726 2727 2728 2729 2730
                        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));
2731
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744
                                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));
2745
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2746 2747
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10500 setOAuthToken err:" + JSON.stringify(err));
2748
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2749 2750
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","","test_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10500 setOAuthTokenVisibility err:" + JSON.stringify(err));
2751
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2752 2753
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_10500 getOAuthList err:" + JSON.stringify(err));
2754
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2755 2756 2757 2758 2759
                                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));
2760
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2761 2762 2763 2764
                                    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));
2765
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780
                                        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));
2781
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2782 2783
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10600 setOAuthToken err:" + JSON.stringify(err));
2784
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2785 2786
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name"," ","test_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10600 setOAuthTokenVisibility err:" + JSON.stringify(err));
2787
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2788 2789
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name"," ",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_10600 getOAuthList err:" + JSON.stringify(err));
2790
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2791 2792 2793 2794 2795
                                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));
2796
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2797 2798 2799 2800
                                    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));
2801
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821
                                        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));
2822
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2823 2824
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10700 setOAuthToken err:" + JSON.stringify(err));
2825
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2826 2827 2828 2829 2830
                        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));
2831
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2832 2833 2834 2835
                                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));
2836
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850
                                    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));
2851
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2852 2853
                    appAccountManager.setOAuthToken("account_setOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_10800 setOAuthToken err:" + JSON.stringify(err));
2854
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2855 2856
                        appAccountManager.setOAuthTokenVisibility("account_setOAuthTokenVisibility_name","invalid_authType","test_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_10800 setOAuthTokenVisibility err:" + JSON.stringify(err));
2857
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2858 2859
                            appAccountManager.getOAuthList("account_setOAuthTokenVisibility_name","invalid_authType",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_10800 getOAuthList err:" + JSON.stringify(err));
2860
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2861 2862 2863 2864 2865
                                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));
2866
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2867 2868 2869 2870
                                    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));
2871
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974
                                        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));
2975
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2976 2977
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_11700 setOAuthToken err:" + JSON.stringify(err));
2978
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
2979 2980 2981
                        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);
2982
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
2983 2984 2985 2986
                            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);
2987
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
2988 2989 2990
                                expect(stateBack).assertEqual(true);
                                appAccountManager.deleteAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_11700 deleteAccount err:" + JSON.stringify(err));
2991
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005
                                    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));
3006
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3007 3008
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_11800 setOAuthToken err:" + JSON.stringify(err));
3009
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3010 3011 3012
                        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);
3013
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3014 3015 3016 3017
                            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);
3018
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3019 3020 3021
                                expect(stateBack).assertEqual(true);
                                appAccountManager.deleteAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_11800 deleteAccount err:" + JSON.stringify(err));
3022
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040
                                    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));
3041
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3042 3043
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_11900 setOAuthToken err:" + JSON.stringify(err));
3044
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3045 3046 3047 3048 3049 3050 3051 3052
                        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));
3053
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067
                                    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));
3068
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3069 3070
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12000 setOAuthToken err:" + JSON.stringify(err));
3071
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3072 3073 3074
                        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);
3075
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3076 3077 3078 3079
                            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);
3080
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3081 3082 3083
                                expect(stateBack).assertEqual(true);
                                appAccountManager.deleteAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_12000 deleteAccount err:" + JSON.stringify(err));
3084
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098
                                    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));
3099
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3100 3101
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12100 setOAuthToken err:" + JSON.stringify(err));
3102
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3103 3104 3105 3106 3107 3108
                        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));
3109
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122
                                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));
3123
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3124 3125
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12200 setOAuthToken err:" + JSON.stringify(err));
3126
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3127 3128 3129
                        appAccountManager.checkOAuthTokenVisibility("account_checkOAuthTokenVisibility_name","authType"," ",(err,stateBack)=>{
                            console.debug("====>ActsAccountOAuthToken_12200 checkOAuthTokenVisibility err:" + JSON.stringify(err));
                            console.debug("====>ActsAccountOAuthToken_12200 checkOAuthTokenVisibility stateBack:" + stateBack);
3130
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3131 3132 3133
                            expect(stateBack).assertEqual(false);
                            appAccountManager.deleteAccount("account_checkOAuthTokenVisibility_name",(err)=>{
                                console.debug("====>ActsAccountOAuthToken_12200 deleteAccount err:" + JSON.stringify(err));
3134
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151
                                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));
3152
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3153 3154
                    appAccountManager.setOAuthToken("account_checkOAuthTokenVisibility_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12300 setOAuthToken err:" + JSON.stringify(err));
3155
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3156 3157 3158 3159 3160 3161
                        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));
3162
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175
                                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));
3176
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3177 3178
                    appAccountManager.setOAuthToken("account_testGetOAuthList_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12400 setOAuthToken err:" + JSON.stringify(err));
3179
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3180 3181
                        appAccountManager.setOAuthTokenVisibility("account_testGetOAuthList_name","authType","test_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_12400 setOAuthTokenVisibility err:" + JSON.stringify(err));
3182
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3183 3184
                            appAccountManager.getOAuthList("account_testGetOAuthList_name","",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_12400 getOAuthList err:" + JSON.stringify(err));
3185
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3186 3187 3188 3189
                                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));
3190
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204
                                    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));
3205
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3206 3207
                    appAccountManager.setOAuthToken("account_testGetOAuthList_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12500 setOAuthToken err:" + JSON.stringify(err));
3208
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3209 3210
                        appAccountManager.setOAuthTokenVisibility("account_testGetOAuthList_name","authType","test_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_12500 setOAuthTokenVisibility err:" + JSON.stringify(err));
3211
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3212 3213
                            appAccountManager.getOAuthList("account_testGetOAuthList_name"," ",(err,dataArray)=>{
                                console.debug("====>ActsAccountOAuthToken_12500 getOAuthList err:" + JSON.stringify(err));
3214
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3215 3216 3217 3218
                                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));
3219
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237
                                    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));
3238
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3239 3240
                    appAccountManager.setOAuthToken("account_testGetOAuthList_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_12600 setOAuthToken err:" + JSON.stringify(err));
3241
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3242 3243
                        appAccountManager.setOAuthTokenVisibility("account_testGetOAuthList_name","authType","test_bundleName",true,(err)=>{
                            console.debug("====>ActsAccountOAuthToken_12600 setOAuthTokenVisibility err:" + JSON.stringify(err));
3244
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3245 3246 3247 3248
                            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));
3249
                                expect(dataArray).assertEqual(null);
J
jiyong_sd 已提交
3250 3251
                                appAccountManager.deleteAccount("account_testGetOAuthList_name",(err)=>{
                                    console.debug("====>ActsAccountOAuthToken_12600 deleteAccount err:" + JSON.stringify(err));
3252
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264
                                    console.debug("====>ActsAccountOAuthToken_12600 end====");
                                    done();
                                });
                            });    
                        });
                    });
                });
            });
        
            it('ActsAccountOAuthToken_12700', 0, async function (done) {
                console.debug("====>ActsAccountOAuthToken_12700 start====");
                var appAccountManager = account.createAppAccountManager();
1
15829070344 已提交
3265 3266 3267 3268 3269
                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 已提交
3270 3271
                    expect(err.code!=0).assertEqual(true);
                    done();
1
15829070344 已提交
3272
                })
J
jiyong_sd 已提交
3273 3274 3275 3276 3277 3278 3279 3280 3281
            });
        
            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);
3282
                    expect(dataArray).assertEqual(null);
J
jiyong_sd 已提交
3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297
                    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);
3298
                    expect(dataArray).assertEqual(null);
J
jiyong_sd 已提交
3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309
                    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);
3310
                    expect(dataArray).assertEqual(null);
J
jiyong_sd 已提交
3311 3312 3313 3314 3315 3316 3317 3318 3319
                    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));
3320
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3321 3322
                    appAccountManager.setOAuthToken("account_tokenTest_name","authType","test_token",(err)=>{
                        console.debug("====>ActsAccountOAuthToken_13100 setOAuthToken err:" + JSON.stringify(err));
3323
                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3324 3325 3326
                        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);
3327
                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3328 3329 3330 3331
                            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);
3332
                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3333 3334 3335 3336
                                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));
3337
                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3338 3339 3340
                                    expect(dataArray.length).assertEqual(0);
                                    appAccountManager.setOAuthTokenVisibility("account_tokenTest_name","authType","test_bundleName",true,(err)=>{
                                        console.debug("====>ActsAccountOAuthToken_13100 setOAuthTokenVisibility err:" + JSON.stringify(err));
3341
                                        expect(err).assertEqual(null);
J
jiyong_sd 已提交
3342 3343 3344
                                        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);
3345
                                            expect(err).assertEqual(null);
J
jiyong_sd 已提交
3346 3347 3348 3349
                                            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));
3350
                                                expect(err).assertEqual(null);
J
jiyong_sd 已提交
3351 3352 3353 3354
                                                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));
3355
                                                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374
                                                    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));
3375
                    expect(err).assertEqual(null);
J
jiyong_sd 已提交
3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427
                    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();
            });
    })
}