File tree 3 files changed +19
-2
lines changed
firebase-firestore/src/test/java/com/google/firebase/firestore/spec
3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import com .google .firebase .firestore .local .Persistence ;
4
4
import com .google .firebase .firestore .local .PersistenceTestHelpers ;
5
+ import java .util .Set ;
5
6
import org .junit .runner .RunWith ;
6
7
import org .robolectric .RobolectricTestRunner ;
7
8
import org .robolectric .annotation .Config ;
@@ -14,4 +15,10 @@ public class MemorySpecTest extends SpecTestCase {
14
15
Persistence getPersistence () {
15
16
return PersistenceTestHelpers .createMemoryPersistence ();
16
17
}
18
+
19
+ @ Override
20
+ protected boolean shouldRun (Set <String > tags ) {
21
+ // There are currently no tags which disable memory persistence tests.
22
+ return true ;
23
+ }
17
24
}
Original file line number Diff line number Diff line change 2
2
3
3
import com .google .firebase .firestore .local .Persistence ;
4
4
import com .google .firebase .firestore .local .PersistenceTestHelpers ;
5
+ import java .util .Set ;
5
6
import org .junit .runner .RunWith ;
6
7
import org .robolectric .RobolectricTestRunner ;
7
8
import org .robolectric .annotation .Config ;
10
11
@ Config (manifest = Config .NONE )
11
12
public class SQLiteSpecTest extends SpecTestCase {
12
13
14
+ private static final String NO_LRU_TAG = "no-lru" ;
15
+
13
16
@ Override
14
17
Persistence getPersistence () {
15
18
return PersistenceTestHelpers .createSQLitePersistence ();
16
19
}
20
+
21
+ @ Override
22
+ protected boolean shouldRun (Set <String > tags ) {
23
+ return !tags .contains (NO_LRU_TAG );
24
+ }
17
25
}
Original file line number Diff line number Diff line change @@ -184,6 +184,8 @@ public static void log(String line) {
184
184
185
185
abstract Persistence getPersistence ();
186
186
187
+ protected abstract boolean shouldRun (Set <String > tags );
188
+
187
189
private void specSetUp (JSONObject config ) {
188
190
log (" Clearing all state." );
189
191
@@ -1010,13 +1012,13 @@ private static boolean anyTestsAreMarkedExclusive(JSONObject fileJSON) throws JS
1010
1012
}
1011
1013
1012
1014
/** Called before executing each test to see if it should be run. */
1013
- private static boolean shouldRunTest (Set <String > tags ) throws JSONException {
1015
+ private boolean shouldRunTest (Set <String > tags ) throws JSONException {
1014
1016
for (String tag : tags ) {
1015
1017
if (DISABLED_TAGS .contains (tag )) {
1016
1018
return false ;
1017
1019
}
1018
1020
}
1019
- return true ;
1021
+ return shouldRun ( tags ) ;
1020
1022
}
1021
1023
1022
1024
private static Set <String > getTestTags (JSONObject testJSON ) throws JSONException {
You can’t perform that action at this time.
0 commit comments