AccountManagerServiceTestFixtures.java revision 8882d881f95f5719a4a9c3eb3f6555b4882e8c4d
1/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package com.android.server.accounts;
17
18import android.accounts.Account;
19
20import java.util.ArrayList;
21import java.util.List;
22
23/**
24 * Constants shared between test AccountAuthenticators and AccountManagerServiceTest.
25 */
26public final class AccountManagerServiceTestFixtures {
27    public static final String KEY_ACCOUNT_NAME = "account_manager_service_test:account_name_key";
28    public static final String KEY_ACCOUNT_SESSION_BUNDLE =
29            "account_manager_service_test:account_session_bundle_key";
30    public static final String KEY_ACCOUNT_STATUS_TOKEN =
31            "account_manager_service_test:account_status_token_key";
32    public static final String KEY_ACCOUNT_PASSWORD =
33            "account_manager_service_test:account_password_key";
34    public static final String KEY_OPTIONS_BUNDLE =
35            "account_manager_service_test:option_bundle_key";
36    public static final String ACCOUNT_NAME_SUCCESS = "success_on_return@fixture.com";
37    public static final String ACCOUNT_NAME_INTERVENE = "intervene@fixture.com";
38    public static final String ACCOUNT_NAME_ERROR = "error@fixture.com";
39
40    public static final String ACCOUNT_NAME =
41            "com.android.server.accounts.account_manager_service_test.account.name";
42    public static final String ACCOUNT_TYPE_1 =
43            "com.android.server.accounts.account_manager_service_test.account.type1";
44    public static final String ACCOUNT_TYPE_2 =
45            "com.android.server.accounts.account_manager_service_test.account.type2";
46    public static final String ACCOUNT_FAKE_TYPE =
47            "com.android.server.accounts.account_manager_service_test.account.type.fake";
48
49    public static final String ACCOUNT_STATUS_TOKEN =
50            "com.android.server.accounts.account_manager_service_test.account.status.token";
51    public static final String AUTH_TOKEN_LABEL =
52            "com.android.server.accounts.account_manager_service_test.auth.token.label";
53    public static final String AUTH_TOKEN =
54            "com.android.server.accounts.account_manager_service_test.auth.token";
55    public static final String KEY_TOKEN_EXPIRY =
56            "com.android.server.accounts.account_manager_service_test.auth.token.expiry";
57    public static final String ACCOUNT_FEATURE1 =
58            "com.android.server.accounts.account_manager_service_test.feature1";
59    public static final String ACCOUNT_FEATURE2 =
60            "com.android.server.accounts.account_manager_service_test.feature2";
61    public static final String[] ACCOUNT_FEATURES =
62            new String[]{ACCOUNT_FEATURE1, ACCOUNT_FEATURE2};
63    public static final String CALLER_PACKAGE =
64            "com.android.server.accounts.account_manager_service_test.caller.package";
65    public static final String ACCOUNT_PASSWORD =
66            "com.android.server.accounts.account_manager_service_test.account.password";
67    public static final String KEY_RESULT = "account_manager_service_test:result";
68    public static final String KEY_CALLBACK = "account_manager_service_test:callback";
69
70    public static final Account ACCOUNT_SUCCESS =
71            new Account(ACCOUNT_NAME_SUCCESS, ACCOUNT_TYPE_1);
72    public static final Account ACCOUNT_INTERVENE =
73            new Account(ACCOUNT_NAME_INTERVENE, ACCOUNT_TYPE_1);
74    public static final Account ACCOUNT_ERROR =
75            new Account(ACCOUNT_NAME_ERROR, ACCOUNT_TYPE_1);
76    public static final Account ACCOUNT_SUCCESS_TYPE_2 =
77            new Account(ACCOUNT_NAME_SUCCESS, ACCOUNT_TYPE_2);
78
79    public static final String SESSION_DATA_NAME_1 = "session.data.name.1";
80    public static final String SESSION_DATA_VALUE_1 = "session.data.value.1";
81
82    public static final String ERROR_MESSAGE =
83        "com.android.server.accounts.account_manager_service_test.error.message";
84
85    private AccountManagerServiceTestFixtures() {}
86}
87