Search in sources :

Example 6 with RemoteSerializer

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

the class LocalSerializerTest method setUp.

@Before
public void setUp() {
    DatabaseId databaseId = DatabaseId.forDatabase("p", "d");
    remoteSerializer = new RemoteSerializer(databaseId);
    serializer = new LocalSerializer(remoteSerializer);
}
Also used : RemoteSerializer(com.google.firebase.firestore.remote.RemoteSerializer) DatabaseId(com.google.firebase.firestore.model.DatabaseId) Before(org.junit.Before)

Example 7 with RemoteSerializer

use of com.google.firebase.firestore.remote.RemoteSerializer 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

RemoteSerializer (com.google.firebase.firestore.remote.RemoteSerializer)7 DatabaseId (com.google.firebase.firestore.model.DatabaseId)5 Context (android.content.Context)2 LocalSerializer (com.google.firebase.firestore.local.LocalSerializer)2 LoadBundleTask (com.google.firebase.firestore.LoadBundleTask)1 BundleReader (com.google.firebase.firestore.bundle.BundleReader)1 BundleSerializer (com.google.firebase.firestore.bundle.BundleSerializer)1 MemoryComponentProvider (com.google.firebase.firestore.core.MemoryComponentProvider)1 LruGarbageCollector (com.google.firebase.firestore.local.LruGarbageCollector)1 SQLitePersistence (com.google.firebase.firestore.local.SQLitePersistence)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 Before (org.junit.Before)1