Skip to content

Commit b832f40

Browse files
authored
Merge branch 'master' into smokeTestFix
2 parents e3422d7 + a0f26e0 commit b832f40

File tree

19 files changed

+61
-99
lines changed

19 files changed

+61
-99
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ If you don't have a suitable testing project already:
8787
* Download the resulting `google-services.json` file and put it in the root of
8888
your checkout.
8989

90+
For now, you have to disable security rule enforcement for the Realtime
91+
Database, Cloud Firestore, and Cloud Storage in your test project (if running
92+
the integration tests for any of those). Re-enable your security rules after
93+
your test run.
94+
9095
#### Running Integration Tests
9196

9297
Integration tests can be executed on the command line by running
@@ -204,6 +209,9 @@ projects may be published as follows.
204209
publishProjectsToMavenLocal
205210
```
206211

212+
To generate the Maven dependency tree under `build/` instead, you can replace
213+
`publishProjectsToMavenLocal` in the above command with `firebasePublish`.
214+
207215
### Code Formatting
208216

209217
Code in this repo is formatted with the google-java-format tool. You can enable

firebase-database/README.md

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,6 @@ in realtime to every connected client. When you build cross-platform apps with o
77
and JavaScript SDKs, all of your clients share one Realtime Database instance and automatically
88
receive updates with the newest data.
99

10-
All Gradle commands should be run from the source root (which is one level up from this folder).
11-
12-
Building
13-
========
14-
You can build the SDK by invoking `./gradlew :firebase-database:assemble`.
15-
16-
If you want to test changes locally, you may also run
17-
`./gradlew -PprojectsToPublish="firebase-database" firebasePublish`. This generates the Maven
18-
dependency tree (under `build/`) that you can use during app development.
19-
20-
Testing
21-
=======
22-
23-
To run the unit tests:
24-
25-
- Invoke `./gradlew :firebase-database:check`.
26-
27-
To run the integration tests:
28-
29-
- Make sure that you have configured a `google-service.json` from your Firebase test project in the
30-
source root.
31-
- For now, you have to disable security rule enforcement for the Realtime Databse in your test
32-
project.
33-
- Start an Android Emulator.
34-
- Invoke `./gradlew :firebase-database:connectedCheck`.
35-
- Re-enable your security rules after your test run.
36-
37-
38-
Formatting
39-
==========
40-
Format your source files via `./gradlew :firebase-database:googleJavaFormat`
41-
10+
All Gradle commands should be run from the source root (which is one level up
11+
from this folder). See the README.md in the source root for instructions on
12+
publishing/testing the Realtime Database.

firebase-firestore/README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1-
Prior to submitting please run `./gradlew :firebase-firestore:googleJavaFormat` to format your code.
1+
# firebase-firestore
2+
3+
This is the Cloud Firestore component of the Firebase Android SDK.
4+
5+
Cloud Firestore is a flexible, scalable database for mobile, web, and server
6+
development from Firebase and Google Cloud Platform. Like Firebase Realtime
7+
Database, it keeps your data in sync across client apps through realtime
8+
listeners and offers offline support for mobile and web so you can build
9+
responsive apps that work regardless of network latency or Internet
10+
connectivity. Cloud Firestore also offers seamless integration with other
11+
Firebase and Google Cloud Platform products, including Cloud Functions.
12+
13+
All Gradle commands should be run from the source root (which is one level up
14+
from this folder). See the README.md in the source root for instructions on
15+
publishing/testing Cloud Firestore.

firebase-firestore/src/androidTest/java/com/google/firebase/firestore/FirestoreTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ public void testQuerySnapshotEventsForAdd() {
636636
assertFalse(doc2.getMetadata().hasPendingWrites());
637637
break;
638638
default:
639-
fail("unexpected call to onSnapshot:" + snapshot);
639+
fail("unexpected call to onSnapshot: " + snapshot);
640640
}
641641
});
642642
waitFor(emptyLatch);

firebase-firestore/src/androidTest/java/com/google/firebase/firestore/testutil/EventAccumulator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public EventAccumulator() {
3939
public EventListener<T> listener() {
4040
return (value, error) -> {
4141
synchronized (EventAccumulator.this) {
42-
hardAssert(error == null, "Unexpected error: " + error);
42+
hardAssert(error == null, "Unexpected error: %s", error);
4343
Log.i("EventAccumulator", "Received new event: " + value);
4444
events.add(value);
4545
checkFulfilled();

firebase-firestore/src/main/java/com/google/firebase/firestore/DocumentSnapshot.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -505,15 +505,14 @@ private Object convertValue(FieldValue value, FieldValueOptions options) {
505505
// TODO: Somehow support foreign references.
506506
Logger.warn(
507507
"DocumentSnapshot",
508-
String.format(
509-
"Document %s contains a document reference within a different database "
510-
+ "(%s/%s) which is not supported. It will be treated as a reference in "
511-
+ "the current database (%s/%s) instead.",
512-
key.getPath(),
513-
refDatabase.getProjectId(),
514-
refDatabase.getDatabaseId(),
515-
database.getProjectId(),
516-
database.getDatabaseId()));
508+
"Document %s contains a document reference within a different database "
509+
+ "(%s/%s) which is not supported. It will be treated as a reference in "
510+
+ "the current database (%s/%s) instead.",
511+
key.getPath(),
512+
refDatabase.getProjectId(),
513+
refDatabase.getDatabaseId(),
514+
database.getProjectId(),
515+
database.getDatabaseId());
517516
}
518517
return new DocumentReference(key, firestore);
519518
} else {

firebase-firestore/src/main/java/com/google/firebase/firestore/core/RelationFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private boolean matchesComparison(int comp) {
9494
case GREATER_THAN_OR_EQUAL:
9595
return comp >= 0;
9696
default:
97-
throw Assert.fail("Unknown operator: ", operator);
97+
throw Assert.fail("Unknown operator: %s", operator);
9898
}
9999
}
100100

firebase-firestore/src/main/java/com/google/firebase/firestore/core/SyncEngine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ public void handleRejectedListen(int targetId, Status error) {
376376
handleRemoteEvent(event);
377377
} else {
378378
QueryView queryView = queryViewsByTarget.get(targetId);
379-
hardAssert(queryView != null, "Unknown target: " + targetId);
379+
hardAssert(queryView != null, "Unknown target: %s", targetId);
380380
localStore.releaseQuery(queryView.getQuery());
381381
removeAndCleanup(queryView);
382382
callback.onError(queryView.getQuery(), error);

firebase-firestore/src/main/java/com/google/firebase/firestore/local/LocalDocumentsView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ private ImmutableSortedMap<DocumentKey, Document> getDocumentsMatchingCollection
143143
} else if (mutatedDoc instanceof Document) {
144144
results = results.insert(key, (Document) mutatedDoc);
145145
} else {
146-
throw fail("Unknown document type: " + mutatedDoc);
146+
throw fail("Unknown document type: %s", mutatedDoc);
147147
}
148148
}
149149
}

firebase-firestore/src/main/java/com/google/firebase/firestore/local/LocalSerializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ MaybeDocument decodeMaybeDocument(com.google.firebase.firestore.proto.MaybeDocum
6868
return decodeNoDocument(proto.getNoDocument());
6969

7070
default:
71-
throw fail("Unknown MaybeDocument " + proto);
71+
throw fail("Unknown MaybeDocument %s", proto);
7272
}
7373
}
7474

0 commit comments

Comments
 (0)