Skip to content

Commit ff551e5

Browse files
Updating variable names from the test classes to follow Java's code convention (b/177441811) (#2546)
* Fixing variable names for the test classes.
1 parent 23fc235 commit ff551e5

22 files changed

+927
-849
lines changed

firebase-perf/src/test/java/com/google/firebase/perf/FirebasePerformanceTestBase.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,19 @@ public class FirebasePerformanceTestBase {
4848
protected static final String FAKE_FIREBASE_DB_URL = "https://fir-perftestapp.firebaseio.com";
4949
protected static final String FAKE_FIREBASE_PROJECT_ID = "fir-perftestapp";
5050

51-
protected Context context;
51+
protected Context appContext;
5252

5353
@Before
5454
public void setUpFirebaseApp() {
55-
context = ApplicationProvider.getApplicationContext();
55+
appContext = ApplicationProvider.getApplicationContext();
5656
FirebaseOptions options =
5757
new FirebaseOptions.Builder()
5858
.setApplicationId(FAKE_FIREBASE_APPLICATION_ID)
5959
.setApiKey(FAKE_FIREBASE_API_KEY)
6060
.setDatabaseUrl(FAKE_FIREBASE_DB_URL)
6161
.setProjectId(FAKE_FIREBASE_PROJECT_ID)
6262
.build();
63-
FirebaseApp.initializeApp(context, options);
63+
FirebaseApp.initializeApp(appContext, options);
6464
}
6565

6666
@After

firebase-perf/src/test/java/com/google/firebase/perf/application/AppStateMonitorTest.java

Lines changed: 115 additions & 173 deletions
Large diffs are not rendered by default.

firebase-perf/src/test/java/com/google/firebase/perf/config/DeviceCacheManagerTest.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void setUp() {
3939

4040
@Test
4141
public void getBoolean_valueIsNotSet_returnsEmpty() {
42-
deviceCacheManager.setContext(context);
42+
deviceCacheManager.setContext(appContext);
4343
fakeScheduledExecutorService.runAll();
4444

4545
assertThat(deviceCacheManager.getBoolean("some_key").isAvailable()).isFalse();
@@ -53,7 +53,7 @@ public void getBoolean_contextAndValueNotSet_returnsEmpty() {
5353

5454
@Test
5555
public void getBoolean_valueIsSet_returnsSetValue() {
56-
deviceCacheManager.setContext(context);
56+
deviceCacheManager.setContext(appContext);
5757
fakeScheduledExecutorService.runAll();
5858
deviceCacheManager.setValue("some_key", true);
5959

@@ -62,7 +62,7 @@ public void getBoolean_valueIsSet_returnsSetValue() {
6262

6363
@Test
6464
public void clear_setBooleanThenCleared_returnsEmpty() {
65-
deviceCacheManager.setContext(context);
65+
deviceCacheManager.setContext(appContext);
6666
fakeScheduledExecutorService.runAll();
6767
deviceCacheManager.setValue("some_key", true);
6868

@@ -85,7 +85,7 @@ public void getBoolean_firebaseAppNotExist_returnsEmpty() {
8585

8686
@Test
8787
public void setValueBoolean_setTwice_canGetLatestValue() {
88-
deviceCacheManager.setContext(context);
88+
deviceCacheManager.setContext(appContext);
8989
fakeScheduledExecutorService.runAll();
9090
deviceCacheManager.setValue("some_key", true);
9191
assertThat(deviceCacheManager.getBoolean("some_key").get()).isTrue();
@@ -108,7 +108,7 @@ public void setValueBoolean_keyIsNull_returnsFalse() {
108108

109109
@Test
110110
public void getString_valueIsNotSet_returnsEmpty() {
111-
deviceCacheManager.setContext(context);
111+
deviceCacheManager.setContext(appContext);
112112
fakeScheduledExecutorService.runAll();
113113

114114
assertThat(deviceCacheManager.getString("some_key").isAvailable()).isFalse();
@@ -121,7 +121,7 @@ public void getString_contextAndValueNotSet_returnsEmpty() {
121121

122122
@Test
123123
public void getString_valueIsSet_returnsSetValue() {
124-
deviceCacheManager.setContext(context);
124+
deviceCacheManager.setContext(appContext);
125125
fakeScheduledExecutorService.runAll();
126126
deviceCacheManager.setValue("some_key", "specialValue");
127127

@@ -140,7 +140,7 @@ public void getString_firebaseAppNotExist_returnsEmpty() {
140140

141141
@Test
142142
public void setValueString_setTwice_canGetLatestValue() {
143-
deviceCacheManager.setContext(context);
143+
deviceCacheManager.setContext(appContext);
144144
fakeScheduledExecutorService.runAll();
145145
deviceCacheManager.setValue("some_key", "EarliestValue");
146146
assertThat(deviceCacheManager.getString("some_key").get()).isEqualTo("EarliestValue");
@@ -157,22 +157,22 @@ public void setValueString_contextNotSet_returnsEmpty() {
157157

158158
@Test
159159
public void setValueString_setNullString_returnsEmpty() {
160-
deviceCacheManager.setContext(context);
160+
deviceCacheManager.setContext(appContext);
161161
fakeScheduledExecutorService.runAll();
162162
deviceCacheManager.setValue("some_key", null);
163163
assertThat(deviceCacheManager.getString("some_key").isAvailable()).isFalse();
164164
}
165165

166166
@Test
167167
public void setValueString_keyIsNull_returnsFalse() {
168-
deviceCacheManager.setContext(context);
168+
deviceCacheManager.setContext(appContext);
169169
fakeScheduledExecutorService.runAll();
170170
assertThat(deviceCacheManager.setValue(null, "value")).isFalse();
171171
}
172172

173173
@Test
174174
public void getFloat_valueIsNotSet_returnsEmpty() {
175-
deviceCacheManager.setContext(context);
175+
deviceCacheManager.setContext(appContext);
176176
fakeScheduledExecutorService.runAll();
177177

178178
assertThat(deviceCacheManager.getFloat("some_key").isAvailable()).isFalse();
@@ -189,7 +189,7 @@ public void getFloat_contextAndValueNotSet_returnsEmpty() {
189189

190190
@Test
191191
public void getFloat_valueIsSet_returnsSetValue() {
192-
deviceCacheManager.setContext(context);
192+
deviceCacheManager.setContext(appContext);
193193
fakeScheduledExecutorService.runAll();
194194
deviceCacheManager.setValue("some_key", 1.2f);
195195

@@ -209,7 +209,7 @@ public void getFloat_firebaseAppNotExist_returnsEmpty() {
209209

210210
@Test
211211
public void setValueFloat_setTwice_canGetLatestValue() {
212-
deviceCacheManager.setContext(context);
212+
deviceCacheManager.setContext(appContext);
213213
fakeScheduledExecutorService.runAll();
214214
deviceCacheManager.setValue("some_key", 1.01f);
215215
assertThat(deviceCacheManager.getFloat("some_key").get()).isEqualTo(1.01f);
@@ -226,7 +226,7 @@ public void setValueFloat_contextNotSet_returnsEmpty() {
226226

227227
@Test
228228
public void setValueFloat_keyIsNull_returnsFalse() {
229-
deviceCacheManager.setContext(context);
229+
deviceCacheManager.setContext(appContext);
230230
fakeScheduledExecutorService.runAll();
231231
assertThat(deviceCacheManager.setValue(null, 10.0f)).isFalse();
232232
}
@@ -235,7 +235,7 @@ public void setValueFloat_keyIsNull_returnsFalse() {
235235
public void getLong_valueIsNotSet_returnsEmpty() {
236236
DeviceCacheManager.clearInstance();
237237
deviceCacheManager = new DeviceCacheManager(fakeScheduledExecutorService);
238-
deviceCacheManager.setContext(context);
238+
deviceCacheManager.setContext(appContext);
239239
fakeScheduledExecutorService.runAll();
240240

241241
assertThat(fakeScheduledExecutorService.isEmpty()).isTrue();
@@ -253,7 +253,7 @@ public void getLong_contextAndValueNotSet_returnsEmpty() {
253253

254254
@Test
255255
public void getLong_valueIsSet_returnsSetValue() {
256-
deviceCacheManager.setContext(context);
256+
deviceCacheManager.setContext(appContext);
257257
fakeScheduledExecutorService.runAll();
258258
deviceCacheManager.setValue("some_key", 1L);
259259

@@ -272,7 +272,7 @@ public void getLong_firebaseAppNotExist_returnsEmpty() {
272272

273273
@Test
274274
public void setValueLong_setTwice_canGetLatestValue() {
275-
deviceCacheManager.setContext(context);
275+
deviceCacheManager.setContext(appContext);
276276
fakeScheduledExecutorService.runAll();
277277
deviceCacheManager.setValue("some_key", 2L);
278278
assertThat(deviceCacheManager.getLong("some_key").get()).isEqualTo(2L);
@@ -290,7 +290,7 @@ public void setValueLong_contextNotSet_returnsEmpty() {
290290

291291
@Test
292292
public void setValueLong_keyIsNull_returnsFalse() {
293-
deviceCacheManager.setContext(context);
293+
deviceCacheManager.setContext(appContext);
294294
fakeScheduledExecutorService.runAll();
295295
assertThat(deviceCacheManager.setValue(null, 10.0f)).isFalse();
296296
}

0 commit comments

Comments
 (0)