Package com.syzygy.events.ModelTests
Class UserStoriesModelTest
java.lang.Object
com.syzygy.events.ModelTests.UserStoriesModelTest
Tests the user stories
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Set<DatabaseInstance<?>>private static android.content.res.Resourcesprivate static final TestDatabaseprivate Throwableprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate booleanprivate static android.net.Uriprivate static intprivate CountDownLatchprivate static final intprivate static final intprivate static final intprivate static final intorg.junit.rules.TestNameprivate static Stringprivate static Stringprivate static final Set<UserStoriesModelTest> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidprivate voidacceptError(Throwable ex) private com.google.firebase.Timestampafter()private booleanprivate voidawait(long timeout) private voidawaitAndContinue(long timeout) private com.google.firebase.Timestampbefore()voidstatic voidclean()voidcleanUp()private voidprivate voidcompleteTest(boolean fullComplete) private voidgetTestEvent(Facility f, int dates, boolean geo, boolean freshImage, Consumer<Event> listener) private voidgetTestEventAssociation(User u, Event e, String status, Consumer<EventAssociation> listener, com.google.firebase.firestore.GeoPoint geo) private voidgetTestEventAssociationFresh(int dates, String status, boolean geo, com.google.firebase.firestore.GeoPoint loc, boolean freshImage, boolean freshAUsrImage, boolean freshFUsrImage, boolean freshFacImage, Consumer<EventAssociation> listener) private voidgetTestEventAssociationFreshUser(User u, int dates, String status, boolean geo, com.google.firebase.firestore.GeoPoint loc, boolean freshImage, boolean freshFacImage, boolean freshFUsrImage, Consumer<EventAssociation> listener) private voidgetTestEventFresh(int dates, boolean geo, boolean freshImage, boolean freshFacImage, boolean freshUsrImage, Consumer<Event> listener) private voidgetTestEventWithEventAssociations(int waitListCount, int enrolledCount, int invitedCount, int canceledCount, Consumer<List<EventAssociation>> listener) private voidgetTestFacility(User u, boolean freshImage, Consumer<Facility> listener) private voidgetTestFacilityFresh(boolean freshFacImage, boolean freshUsrImage, Consumer<Facility> listener) private voidgetTestImage(DatabaseInstance<?> forInst, Consumer<Image> listener) private <T extends DatabaseInstance<T>>
voidgetTestInstances(int count, BiConsumer<Integer, Consumer<T>> getNext, Consumer<List<T>> listener) private voidgetTestNotification(User send, User rec, Event e, Consumer<Notification> listener) private voidgetTestNotificationFresh(int which, User send, User rec, Event ev, Consumer<Notification> listener) private voidgetTestUser(boolean freshImage, Consumer<User> listener) static voidsetUp()voidtestDeletedEvent(Event e, EventAssociation ea, Notification n, Runnable onComplete) voidtestDeletedEventAssociation(EventAssociation ea, Runnable onComplete) voidtestDeletedEventAssociationCascade(EventAssociation ea, Runnable onComplete) voidtestDeletedEventCascade(Event e, EventAssociation ea, Notification n, Runnable onComplete) voidtestDeletedFacilityDeep(Facility f, Event e, EventAssociation ea, Notification n, Runnable onComplete) voidtestDeletedFacilityShallow(Facility f, Event e, Runnable onComplete) voidtestDeletedImage(Image i, Runnable onComplete) voidtestDeletedImageCascade(Image i, Runnable onComplete) voidtestDeletedInstance(DatabaseInstance<?> instance, Runnable onComplete) voidtestDeletedNotification(Notification n, Runnable onComplete) voidtestDeletedUserDeep(User u, Event e_ofFacility, EventAssociation ea_associated, EventAssociation ea_ofEvent, Notification n_receiver, Notification n_sender, Notification n_event, Runnable onComplete) voidtestDeletedUserShallow(User u, Runnable onComplete) voidUS010101()voidUS010102()voidUS010201()voidUS010202()voidUS010301()voidUS010302()voidUS010303()voidvoidvoidUS010403()voidUS010501()voidUS010502()voidUS010503()voidUS010601()voidUS010602()voidUS010701()voidUS010801()voidUS020101()voidUS020102()voidUS020103()voidUS020201()voidUS020202()voidUS020203()voidvoidvoidUS020401()voidUS020402()voidUS020502()voidUS020503()voidUS020601()voidUS020602()voidUS020603()voidUS020604()voidUS020701()voidUS020702()voidUS020703()voidUS030101()voidvoidvoidvoidvoidvoidvoidvoidUS030302()voidUS030401()voidUS030501()voidUS030601()voidUS030701()
-
Field Details
-
db
-
constants
private static android.content.res.Resources constants -
random
-
img
private static android.net.Uri img -
tests
-
runningTest
-
name
public org.junit.rules.TestName name -
instances
private static int instances -
allObjectsUsed
-
error
-
latch
-
ignoreDelete
private boolean ignoreDelete -
EVENT_BEFORE_REG
private static final int EVENT_BEFORE_REG- See Also:
-
EVENT_REG
private static final int EVENT_REG- See Also:
-
EVENT_AFTER_REG
private static final int EVENT_AFTER_REG- See Also:
-
EVENT_BEFORE_START
private static final int EVENT_BEFORE_START- See Also:
-
EVENT_START
private static final int EVENT_START- See Also:
-
EVENT_END
private static final int EVENT_END- See Also:
-
N_FRESH_REC
private static final int N_FRESH_REC- See Also:
-
N_FRESH_SEND
private static final int N_FRESH_SEND- See Also:
-
N_FRESH_EVENT
private static final int N_FRESH_EVENT- See Also:
-
N_FRESH_ALL
private static final int N_FRESH_ALL- See Also:
-
-
Constructor Details
-
UserStoriesModelTest
public UserStoriesModelTest()
-
-
Method Details
-
setUp
- Throws:
Throwable
-
accept
-
cleanUp
- Throws:
Throwable
-
beforeTest
public void beforeTest() -
clean
- Throws:
Throwable
-
acceptError
-
completeTest
private void completeTest(boolean fullComplete) -
completeTest
private void completeTest() -
asserts
-
awaitAndContinue
- Throws:
Throwable
-
await
- Throws:
Throwable
-
getTestUser
-
getTestFacility
-
getTestFacilityFresh
-
after
private com.google.firebase.Timestamp after() -
before
private com.google.firebase.Timestamp before() -
getTestEvent
-
getTestEventFresh
-
getTestEventAssociation
private void getTestEventAssociation(User u, Event e, String status, Consumer<EventAssociation> listener, com.google.firebase.firestore.GeoPoint geo) -
getTestEventAssociationFreshUser
private void getTestEventAssociationFreshUser(User u, int dates, String status, boolean geo, com.google.firebase.firestore.GeoPoint loc, boolean freshImage, boolean freshFacImage, boolean freshFUsrImage, Consumer<EventAssociation> listener) -
getTestEventAssociationFresh
private void getTestEventAssociationFresh(int dates, String status, boolean geo, com.google.firebase.firestore.GeoPoint loc, boolean freshImage, boolean freshAUsrImage, boolean freshFUsrImage, boolean freshFacImage, Consumer<EventAssociation> listener) -
getTestNotification
-
getTestImage
-
getTestNotificationFresh
private void getTestNotificationFresh(int which, User send, User rec, Event ev, Consumer<Notification> listener) -
getTestInstances
private <T extends DatabaseInstance<T>> void getTestInstances(int count, BiConsumer<Integer, Consumer<T>> getNext, Consumer<List<T>> listener) -
getTestEventWithEventAssociations
private void getTestEventWithEventAssociations(int waitListCount, int enrolledCount, int invitedCount, int canceledCount, Consumer<List<EventAssociation>> listener) -
US010101
- Throws:
Throwable
-
US010102
- Throws:
Throwable
-
US010201
- Throws:
Throwable
-
US010202
- Throws:
Throwable
-
US010301
- Throws:
Throwable
-
US010302
- Throws:
Throwable
-
US010303
- Throws:
Throwable
-
US010401_own_pos
- Throws:
Throwable
-
US010401_US010402_US020501
- Throws:
Throwable
-
US010403
- Throws:
Throwable
-
US010501
- Throws:
Throwable
-
US010502
- Throws:
Throwable
-
US010503
- Throws:
Throwable
-
US010601
- Throws:
Throwable
-
US010602
- Throws:
Throwable
-
US010701
public void US010701() -
US010801
- Throws:
Throwable
-
US020101
- Throws:
Throwable
-
US020102
- Throws:
Throwable
-
US020103
- Throws:
Throwable
-
US020201
- Throws:
Throwable
-
US020202
- Throws:
Throwable
-
US020203
- Throws:
Throwable
-
US020301_limit
- Throws:
Throwable
-
US020301_optional
- Throws:
Throwable
-
US020401
- Throws:
Throwable
-
US020402
- Throws:
Throwable
-
US020502
- Throws:
Throwable
-
US020503
- Throws:
Throwable
-
US020601
- Throws:
Throwable
-
US020602
- Throws:
Throwable
-
US020603
- Throws:
Throwable
-
US020604
- Throws:
Throwable
-
US020701
- Throws:
Throwable
-
US020702
- Throws:
Throwable
-
US020703
- Throws:
Throwable
-
testDeletedInstance
-
testDeletedEventAssociation
-
testDeletedEventAssociationCascade
-
testDeletedNotification
-
testDeletedImage
-
testDeletedImageCascade
-
testDeletedEvent
-
testDeletedEventCascade
public void testDeletedEventCascade(Event e, EventAssociation ea, Notification n, Runnable onComplete) -
testDeletedFacilityShallow
-
testDeletedFacilityDeep
public void testDeletedFacilityDeep(Facility f, Event e, EventAssociation ea, Notification n, Runnable onComplete) -
testDeletedUserDeep
public void testDeletedUserDeep(User u, Event e_ofFacility, EventAssociation ea_associated, EventAssociation ea_ofEvent, Notification n_receiver, Notification n_sender, Notification n_event, Runnable onComplete) -
testDeletedUserShallow
-
US030101
- Throws:
Throwable
-
US030201_shallow
- Throws:
Throwable
-
US030201_deep_noNotificationsImages
- Throws:
Throwable
-
US030201_deep_noImages
- Throws:
Throwable
-
US030201_deep
- Throws:
Throwable
-
US030301_user
- Throws:
Throwable
-
US030301_event
- Throws:
Throwable
-
US030301_facility
- Throws:
Throwable
-
US030302
- Throws:
Throwable
-
US030401
- Throws:
Throwable
-
US030501
- Throws:
Throwable
-
US030601
- Throws:
Throwable
-
US030701
- Throws:
Throwable
-