Search in sources :

Example 1 with LoadBundleTask

use of com.google.firebase.firestore.LoadBundleTask in project firebase-android-sdk by firebase.

the class SpecTestCase method doLoadBundle.

private void doLoadBundle(String json) throws Exception {
    BundleReader bundleReader = new BundleReader(new BundleSerializer(new RemoteSerializer(databaseInfo.getDatabaseId())), new ByteArrayInputStream(json.getBytes(StandardCharsets.UTF_8)));
    LoadBundleTask bundleTask = new LoadBundleTask();
    queue.runSync(() -> {
        syncEngine.loadBundle(bundleReader, bundleTask);
        bundleTask.addOnFailureListener(e -> log("Loading bundle failed with " + e));
    });
    assertTrue(bundleTask.isSuccessful());
}
Also used : BundleSerializer(com.google.firebase.firestore.bundle.BundleSerializer) ByteArrayInputStream(java.io.ByteArrayInputStream) RemoteSerializer(com.google.firebase.firestore.remote.RemoteSerializer) LoadBundleTask(com.google.firebase.firestore.LoadBundleTask) BundleReader(com.google.firebase.firestore.bundle.BundleReader)

Aggregations

LoadBundleTask (com.google.firebase.firestore.LoadBundleTask)1 BundleReader (com.google.firebase.firestore.bundle.BundleReader)1 BundleSerializer (com.google.firebase.firestore.bundle.BundleSerializer)1 RemoteSerializer (com.google.firebase.firestore.remote.RemoteSerializer)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1