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.Resources
private static final TestDatabase
private Throwable
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private boolean
private static android.net.Uri
private static int
private CountDownLatch
private static final int
private static final int
private static final int
private static final int
org.junit.rules.TestName
private static String
private static String
private static final Set<UserStoriesModelTest>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
private void
acceptError
(Throwable ex) private com.google.firebase.Timestamp
after()
private boolean
private void
await
(long timeout) private void
awaitAndContinue
(long timeout) private com.google.firebase.Timestamp
before()
void
static void
clean()
void
cleanUp()
private void
private void
completeTest
(boolean fullComplete) private void
getTestEvent
(Facility f, int dates, boolean geo, boolean freshImage, Consumer<Event> listener) private void
getTestEventAssociation
(User u, Event e, String status, Consumer<EventAssociation> listener, com.google.firebase.firestore.GeoPoint geo) 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) 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) private void
getTestEventFresh
(int dates, boolean geo, boolean freshImage, boolean freshFacImage, boolean freshUsrImage, Consumer<Event> listener) private void
getTestEventWithEventAssociations
(int waitListCount, int enrolledCount, int invitedCount, int canceledCount, Consumer<List<EventAssociation>> listener) private void
getTestFacility
(User u, boolean freshImage, Consumer<Facility> listener) private void
getTestFacilityFresh
(boolean freshFacImage, boolean freshUsrImage, Consumer<Facility> listener) private void
getTestImage
(DatabaseInstance<?> forInst, Consumer<Image> listener) private <T extends DatabaseInstance<T>>
voidgetTestInstances
(int count, BiConsumer<Integer, Consumer<T>> getNext, Consumer<List<T>> listener) private void
getTestNotification
(User send, User rec, Event e, Consumer<Notification> listener) private void
getTestNotificationFresh
(int which, User send, User rec, Event ev, Consumer<Notification> listener) private void
getTestUser
(boolean freshImage, Consumer<User> listener) static void
setUp()
void
testDeletedEvent
(Event e, EventAssociation ea, Notification n, Runnable onComplete) void
testDeletedEventAssociation
(EventAssociation ea, Runnable onComplete) void
testDeletedEventAssociationCascade
(EventAssociation ea, Runnable onComplete) void
testDeletedEventCascade
(Event e, EventAssociation ea, Notification n, Runnable onComplete) void
testDeletedFacilityDeep
(Facility f, Event e, EventAssociation ea, Notification n, Runnable onComplete) void
testDeletedFacilityShallow
(Facility f, Event e, Runnable onComplete) void
testDeletedImage
(Image i, Runnable onComplete) void
testDeletedImageCascade
(Image i, Runnable onComplete) void
testDeletedInstance
(DatabaseInstance<?> instance, Runnable onComplete) void
testDeletedNotification
(Notification n, Runnable onComplete) void
testDeletedUserDeep
(User u, Event e_ofFacility, EventAssociation ea_associated, EventAssociation ea_ofEvent, Notification n_receiver, Notification n_sender, Notification n_event, Runnable onComplete) void
testDeletedUserShallow
(User u, Runnable onComplete) void
US010101()
void
US010102()
void
US010201()
void
US010202()
void
US010301()
void
US010302()
void
US010303()
void
void
void
US010403()
void
US010501()
void
US010502()
void
US010503()
void
US010601()
void
US010602()
void
US010701()
void
US010801()
void
US020101()
void
US020102()
void
US020103()
void
US020201()
void
US020202()
void
US020203()
void
void
void
US020401()
void
US020402()
void
US020502()
void
US020503()
void
US020601()
void
US020602()
void
US020603()
void
US020604()
void
US020701()
void
US020702()
void
US020703()
void
US030101()
void
void
void
void
void
void
void
void
US030302()
void
US030401()
void
US030501()
void
US030601()
void
US030701()
-
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
-