use of com.google.firebase.firestore.model.DocumentKey in project firebase-android-sdk by firebase.
the class LruGarbageCollectorTestCase method markADocumentEligibleForGcInTransaction.
private void markADocumentEligibleForGcInTransaction() {
DocumentKey key = nextTestDocumentKey();
markDocumentEligibleForGcInTransaction(key);
}
use of com.google.firebase.firestore.model.DocumentKey in project firebase-android-sdk by firebase.
the class LruGarbageCollectorTestCase method markADocumentEligibleForGc.
private void markADocumentEligibleForGc() {
DocumentKey key = nextTestDocumentKey();
markDocumentEligibleForGc(key);
}
use of com.google.firebase.firestore.model.DocumentKey in project firebase-android-sdk by firebase.
the class TargetCacheTestCase method testRemoveQueryRemovesMatchingKeysToo.
@Test
public void testRemoveQueryRemovesMatchingKeysToo() {
TargetData rooms = newTargetData(query("rooms"), 1, 1);
addTargetData(rooms);
DocumentKey key1 = key("rooms/foo");
DocumentKey key2 = key("rooms/bar");
addMatchingKey(key1, rooms.getTargetId());
addMatchingKey(key2, rooms.getTargetId());
assertTrue(targetCache.containsKey(key1));
assertTrue(targetCache.containsKey(key2));
removeTargetData(rooms);
assertFalse(targetCache.containsKey(key1));
assertFalse(targetCache.containsKey(key2));
}
use of com.google.firebase.firestore.model.DocumentKey in project firebase-android-sdk by firebase.
the class TargetCacheTestCase method testRemoveMatchingKeysForTargetId.
@Test
public void testRemoveMatchingKeysForTargetId() {
DocumentKey key1 = key("foo/bar");
DocumentKey key2 = key("foo/baz");
DocumentKey key3 = key("foo/blah");
addMatchingKey(key1, 1);
addMatchingKey(key2, 1);
addMatchingKey(key3, 2);
assertTrue(targetCache.containsKey(key1));
assertTrue(targetCache.containsKey(key2));
assertTrue(targetCache.containsKey(key3));
removeMatchingKeysForTargetId(1);
assertFalse(targetCache.containsKey(key1));
assertFalse(targetCache.containsKey(key2));
assertTrue(targetCache.containsKey(key3));
removeMatchingKeysForTargetId(2);
assertFalse(targetCache.containsKey(key1));
assertFalse(targetCache.containsKey(key2));
assertFalse(targetCache.containsKey(key3));
}
use of com.google.firebase.firestore.model.DocumentKey in project firebase-android-sdk by firebase.
the class TargetCacheTestCase method testMatchingKeysForTargetID.
@Test
public void testMatchingKeysForTargetID() {
DocumentKey key1 = key("foo/bar");
DocumentKey key2 = key("foo/baz");
DocumentKey key3 = key("foo/blah");
addMatchingKey(key1, 1);
addMatchingKey(key2, 1);
addMatchingKey(key3, 2);
assertSetEquals(asList(key1, key2), targetCache.getMatchingKeysForTargetId(1));
assertSetEquals(asList(key3), targetCache.getMatchingKeysForTargetId(2));
addMatchingKey(key1, 2);
assertSetEquals(asList(key1, key2), targetCache.getMatchingKeysForTargetId(1));
assertSetEquals(asList(key1, key3), targetCache.getMatchingKeysForTargetId(2));
}
Aggregations