Skip to content

Updating variable names from the test classes to follow Java's code convention (b/177441811) #2546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ public class FirebasePerformanceTestBase {
protected static final String FAKE_FIREBASE_DB_URL = "https://fir-perftestapp.firebaseio.com";
protected static final String FAKE_FIREBASE_PROJECT_ID = "fir-perftestapp";

protected Context context;
protected Context appContext;

@Before
public void setUpFirebaseApp() {
context = ApplicationProvider.getApplicationContext();
appContext = ApplicationProvider.getApplicationContext();
FirebaseOptions options =
new FirebaseOptions.Builder()
.setApplicationId(FAKE_FIREBASE_APPLICATION_ID)
.setApiKey(FAKE_FIREBASE_API_KEY)
.setDatabaseUrl(FAKE_FIREBASE_DB_URL)
.setProjectId(FAKE_FIREBASE_PROJECT_ID)
.build();
FirebaseApp.initializeApp(context, options);
FirebaseApp.initializeApp(appContext, options);
}

@After
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void setUp() {

@Test
public void getBoolean_valueIsNotSet_returnsEmpty() {
deviceCacheManager.setContext(context);
deviceCacheManager.setContext(appContext);
fakeScheduledExecutorService.runAll();

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

@Test
public void getBoolean_valueIsSet_returnsSetValue() {
deviceCacheManager.setContext(context);
deviceCacheManager.setContext(appContext);
fakeScheduledExecutorService.runAll();
deviceCacheManager.setValue("some_key", true);

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

@Test
public void clear_setBooleanThenCleared_returnsEmpty() {
deviceCacheManager.setContext(context);
deviceCacheManager.setContext(appContext);
fakeScheduledExecutorService.runAll();
deviceCacheManager.setValue("some_key", true);

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

@Test
public void setValueBoolean_setTwice_canGetLatestValue() {
deviceCacheManager.setContext(context);
deviceCacheManager.setContext(appContext);
fakeScheduledExecutorService.runAll();
deviceCacheManager.setValue("some_key", true);
assertThat(deviceCacheManager.getBoolean("some_key").get()).isTrue();
Expand All @@ -108,7 +108,7 @@ public void setValueBoolean_keyIsNull_returnsFalse() {

@Test
public void getString_valueIsNotSet_returnsEmpty() {
deviceCacheManager.setContext(context);
deviceCacheManager.setContext(appContext);
fakeScheduledExecutorService.runAll();

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

@Test
public void getString_valueIsSet_returnsSetValue() {
deviceCacheManager.setContext(context);
deviceCacheManager.setContext(appContext);
fakeScheduledExecutorService.runAll();
deviceCacheManager.setValue("some_key", "specialValue");

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

@Test
public void setValueString_setTwice_canGetLatestValue() {
deviceCacheManager.setContext(context);
deviceCacheManager.setContext(appContext);
fakeScheduledExecutorService.runAll();
deviceCacheManager.setValue("some_key", "EarliestValue");
assertThat(deviceCacheManager.getString("some_key").get()).isEqualTo("EarliestValue");
Expand All @@ -157,22 +157,22 @@ public void setValueString_contextNotSet_returnsEmpty() {

@Test
public void setValueString_setNullString_returnsEmpty() {
deviceCacheManager.setContext(context);
deviceCacheManager.setContext(appContext);
fakeScheduledExecutorService.runAll();
deviceCacheManager.setValue("some_key", null);
assertThat(deviceCacheManager.getString("some_key").isAvailable()).isFalse();
}

@Test
public void setValueString_keyIsNull_returnsFalse() {
deviceCacheManager.setContext(context);
deviceCacheManager.setContext(appContext);
fakeScheduledExecutorService.runAll();
assertThat(deviceCacheManager.setValue(null, "value")).isFalse();
}

@Test
public void getFloat_valueIsNotSet_returnsEmpty() {
deviceCacheManager.setContext(context);
deviceCacheManager.setContext(appContext);
fakeScheduledExecutorService.runAll();

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

@Test
public void getFloat_valueIsSet_returnsSetValue() {
deviceCacheManager.setContext(context);
deviceCacheManager.setContext(appContext);
fakeScheduledExecutorService.runAll();
deviceCacheManager.setValue("some_key", 1.2f);

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

@Test
public void setValueFloat_setTwice_canGetLatestValue() {
deviceCacheManager.setContext(context);
deviceCacheManager.setContext(appContext);
fakeScheduledExecutorService.runAll();
deviceCacheManager.setValue("some_key", 1.01f);
assertThat(deviceCacheManager.getFloat("some_key").get()).isEqualTo(1.01f);
Expand All @@ -226,7 +226,7 @@ public void setValueFloat_contextNotSet_returnsEmpty() {

@Test
public void setValueFloat_keyIsNull_returnsFalse() {
deviceCacheManager.setContext(context);
deviceCacheManager.setContext(appContext);
fakeScheduledExecutorService.runAll();
assertThat(deviceCacheManager.setValue(null, 10.0f)).isFalse();
}
Expand All @@ -235,7 +235,7 @@ public void setValueFloat_keyIsNull_returnsFalse() {
public void getLong_valueIsNotSet_returnsEmpty() {
DeviceCacheManager.clearInstance();
deviceCacheManager = new DeviceCacheManager(fakeScheduledExecutorService);
deviceCacheManager.setContext(context);
deviceCacheManager.setContext(appContext);
fakeScheduledExecutorService.runAll();

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

@Test
public void getLong_valueIsSet_returnsSetValue() {
deviceCacheManager.setContext(context);
deviceCacheManager.setContext(appContext);
fakeScheduledExecutorService.runAll();
deviceCacheManager.setValue("some_key", 1L);

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

@Test
public void setValueLong_setTwice_canGetLatestValue() {
deviceCacheManager.setContext(context);
deviceCacheManager.setContext(appContext);
fakeScheduledExecutorService.runAll();
deviceCacheManager.setValue("some_key", 2L);
assertThat(deviceCacheManager.getLong("some_key").get()).isEqualTo(2L);
Expand All @@ -290,7 +290,7 @@ public void setValueLong_contextNotSet_returnsEmpty() {

@Test
public void setValueLong_keyIsNull_returnsFalse() {
deviceCacheManager.setContext(context);
deviceCacheManager.setContext(appContext);
fakeScheduledExecutorService.runAll();
assertThat(deviceCacheManager.setValue(null, 10.0f)).isFalse();
}
Expand Down
Loading