From 43735f64a90860ca8b7d21bde7d3985daaf1df43 Mon Sep 17 00:00:00 2001 From: BoazWu <68446983+BoazWu@users.noreply.github.com> Date: Sat, 10 Jul 2021 19:53:35 -0700 Subject: [PATCH] [#11175] Change most mentions of Datastore to database (#11261) --- docs/design.md | 4 +- docs/e2e-testing.md | 2 +- .../client/connector/DatastoreClient.java | 2 +- .../scripts/EntityScanningBaseScript.java | 2 +- .../statistics/CourseToInstituteCache.java | 2 +- .../e2e/cases/AdminAccountsPageE2ETest.java | 26 +-- .../teammates/e2e/cases/BaseE2ETestCase.java | 6 +- ...FeedbackConstSumOptionQuestionE2ETest.java | 10 +- ...dbackConstSumRecipientQuestionE2ETest.java | 14 +- .../FeedbackContributionQuestionE2ETest.java | 18 +- .../e2e/cases/FeedbackMcqQuestionE2ETest.java | 10 +- .../e2e/cases/FeedbackMsqQuestionE2ETest.java | 10 +- .../FeedbackNumScaleQuestionE2ETest.java | 10 +- .../FeedbackRankOptionQuestionE2ETest.java | 10 +- .../FeedbackRankRecipientQuestionE2ETest.java | 14 +- .../cases/FeedbackRubricQuestionE2ETest.java | 10 +- .../e2e/cases/FeedbackSubmitPageE2ETest.java | 10 +- .../cases/FeedbackTextQuestionE2ETest.java | 10 +- .../InstructorCourseDetailsPageE2ETest.java | 4 +- .../InstructorCourseEditPageE2ETest.java | 8 +- .../InstructorCourseEnrollPageE2ETest.java | 4 +- ...orCourseStudentDetailsEditPageE2ETest.java | 4 +- .../cases/InstructorCoursesPageE2ETest.java | 18 +- .../InstructorFeedbackEditPageE2ETest.java | 14 +- ...InstructorFeedbackSessionsPageE2ETest.java | 12 +- .../e2e/cases/InstructorHomePageE2ETest.java | 6 +- .../cases/InstructorSearchPageE2ETest.java | 2 +- .../InstructorStudentListPageE2ETest.java | 2 +- .../teammates/lnp/cases/BaseLNPTestCase.java | 4 +- src/main/java/teammates/logic/api/Logic.java | 10 +- .../teammates/logic/core/AccountsLogic.java | 2 +- .../teammates/logic/core/CoursesLogic.java | 4 +- .../teammates/logic/core/DataBundleLogic.java | 2 +- .../logic/core/FeedbackQuestionsLogic.java | 2 +- .../logic/core/InstructorsLogic.java | 2 +- .../teammates/logic/core/StudentsLogic.java | 2 +- .../teammates/storage/api/EntitiesDb.java | 10 +- .../teammates/storage/api/InstructorsDb.java | 2 +- .../teammates/storage/api/StudentsDb.java | 2 +- .../teammates/storage/entity/BaseEntity.java | 2 +- .../teammates/storage/entity/Instructor.java | 2 +- .../logic/core/AccountsLogicTest.java | 26 +-- .../logic/core/CoursesLogicTest.java | 116 ++++++------- .../logic/core/DataBundleLogicTest.java | 4 +- .../core/FeedbackQuestionsLogicTest.java | 160 +++++++++--------- .../FeedbackResponseCommentsLogicTest.java | 12 +- .../core/FeedbackResponsesLogicTest.java | 76 ++++----- .../logic/core/FeedbackSessionsLogicTest.java | 36 ++-- .../logic/core/InstructorsLogicTest.java | 4 +- .../logic/core/ProfilesLogicTest.java | 2 +- .../logic/core/StudentsLogicTest.java | 14 +- .../teammates/storage/api/CoursesDbTest.java | 2 +- .../teammates/storage/api/EntitiesDbTest.java | 4 +- .../storage/api/FeedbackQuestionsDbTest.java | 10 +- .../api/FeedbackResponseCommentsDbTest.java | 4 +- .../storage/api/FeedbackResponsesDbTest.java | 8 +- .../storage/api/FeedbackSessionsDbTest.java | 6 +- .../storage/api/InstructorsDbTest.java | 2 +- .../teammates/storage/api/ProfilesDbTest.java | 16 +- .../teammates/storage/api/StudentsDbTest.java | 4 +- .../java/teammates/test/AbstractBackDoor.java | 44 ++--- .../teammates/test/BaseComponentTestCase.java | 2 +- ...va => BaseTestCaseWithDatabaseAccess.java} | 18 +- ...dbackSessionClosedRemindersActionTest.java | 6 +- ...backSessionClosingRemindersActionTest.java | 6 +- ...ckSessionPublishedRemindersActionTest.java | 6 +- 66 files changed, 439 insertions(+), 439 deletions(-) rename src/test/java/teammates/test/{BaseTestCaseWithDatastoreAccess.java => BaseTestCaseWithDatabaseAccess.java} (96%) diff --git a/docs/design.md b/docs/design.md index 1e6d000ae43..134a9efb6bc 100644 --- a/docs/design.md +++ b/docs/design.md @@ -185,7 +185,7 @@ The `Storage` component performs CRUD (Create, Read, Update, Delete) operations It contains minimal logic beyond what is directly relevant to CRUD operations. In particular, it is reponsible for: - Validating data inside entities before creating/updating them, to ensure they are in a valid state. -- Hiding the complexities of datastore from the `Logic` component. All GQL queries are to be contained inside the `Storage` component. +- Hiding the complexities of the database from the `Logic` component. - Hiding the persistable objects: Classes in the `storage::entity` package are not visible outside this component to hide information specific to data persistence. - Instead, a corresponding non-persistent [data transfer object](http://en.wikipedia.org/wiki/Data_transfer_object) named `*Attributes` (e.g., `CourseAttributes` is the data transfer object for `Course` entities) object is returned. These datatransfer classes are in `common::datatransfer` package, to be explained later. @@ -205,7 +205,7 @@ This is because we want to keep the data schema flexible so that new entity type ### Storage API -Represented by the `*Db` classes. These classes act as the bridge to the Google Cloud Datastore. +Represented by the `*Db` classes. These classes act as the bridge to the database. ### Policies diff --git a/docs/e2e-testing.md b/docs/e2e-testing.md index a043cc3595e..e49b8bd381d 100644 --- a/docs/e2e-testing.md +++ b/docs/e2e-testing.md @@ -101,7 +101,7 @@ In TEAMMATES, E2E test cases are organized by page. For each page, we: All E2E test classes inherit from `BaseE2ETestCase` which contains methods that are common to most test cases, such as preparing the `Browser` object used for testing. -To help verify the state of the datastore, `BackDoor` contains methods to create API calls to the back-end without going through the UI. +To help verify the state of the database, `BackDoor` contains methods to create API calls to the back-end without going through the UI. ### Page Object Pattern diff --git a/src/client/java/teammates/client/connector/DatastoreClient.java b/src/client/java/teammates/client/connector/DatastoreClient.java index 39767eb5fde..8e7479c4d97 100644 --- a/src/client/java/teammates/client/connector/DatastoreClient.java +++ b/src/client/java/teammates/client/connector/DatastoreClient.java @@ -13,7 +13,7 @@ import teammates.storage.api.OfyHelper; /** - * Enables access to any Datastore (local/production). + * Enables access to any datastore (local/production). */ public abstract class DatastoreClient { diff --git a/src/client/java/teammates/client/scripts/EntityScanningBaseScript.java b/src/client/java/teammates/client/scripts/EntityScanningBaseScript.java index aeedb4fb81c..db25978175d 100644 --- a/src/client/java/teammates/client/scripts/EntityScanningBaseScript.java +++ b/src/client/java/teammates/client/scripts/EntityScanningBaseScript.java @@ -3,7 +3,7 @@ import teammates.storage.entity.BaseEntity; /** - * Base script to be used as a template to scan entities in the Datastore. + * Base script to be used as a template to scan entities in the database. * * @param The entity to scan. */ diff --git a/src/client/java/teammates/client/scripts/statistics/CourseToInstituteCache.java b/src/client/java/teammates/client/scripts/statistics/CourseToInstituteCache.java index ead788fa2da..eaa7f375ffc 100644 --- a/src/client/java/teammates/client/scripts/statistics/CourseToInstituteCache.java +++ b/src/client/java/teammates/client/scripts/statistics/CourseToInstituteCache.java @@ -65,7 +65,7 @@ public Map asMap() { /** * Gets the institute name associated with the course identified by {@code courseId}. * - *

If the mapping cannot be found in the cache, several Datastore queries are issued to find the mapping. + *

If the mapping cannot be found in the cache, several database queries are issued to find the mapping. */ public String get(String courseId) { return cache.getUnchecked(courseId); diff --git a/src/e2e/java/teammates/e2e/cases/AdminAccountsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/AdminAccountsPageE2ETest.java index 5512b1b89b2..869c73c2fe6 100644 --- a/src/e2e/java/teammates/e2e/cases/AdminAccountsPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/AdminAccountsPageE2ETest.java @@ -40,27 +40,27 @@ public void testAll() { InstructorAttributes instructor = testData.instructors.get("AAccounts.instr2-AAccounts.CS2103"); String courseId = instructor.courseId; - verifyPresentInDatastore(instructor); + verifyPresentInDatabase(instructor); accountsPage.clickRemoveInstructorFromCourse(courseId); accountsPage.verifyStatusMessage("Instructor is successfully deleted from course \"" + courseId + "\""); - verifyAbsentInDatastore(instructor); + verifyAbsentInDatabase(instructor); ______TS("action: remove student from course"); StudentAttributes student = testData.students.get("AAccounts.instr2-student-CS2103"); courseId = student.course; - verifyPresentInDatastore(student); + verifyPresentInDatabase(student); accountsPage.clickRemoveStudentFromCourse(courseId); accountsPage.verifyStatusMessage("Student is successfully deleted from course \"" + courseId + "\""); - verifyAbsentInDatastore(student); + verifyAbsentInDatabase(student); ______TS("action: downgrade instructor account"); InstructorAttributes instructor2 = testData.instructors.get("AAccounts.instr2-AAccounts.CS2104"); InstructorAttributes instructor3 = testData.instructors.get("AAccounts.instr2-AAccounts.CS1101"); - verifyPresentInDatastore(instructor2); - verifyPresentInDatastore(instructor3); + verifyPresentInDatabase(instructor2); + verifyPresentInDatabase(instructor3); accountsPage.clickDowngradeAccount(); accountsPage.verifyStatusMessage("Instructor account is successfully downgraded to student."); @@ -71,24 +71,24 @@ public void testAll() { accountsPage.verifyAccountDetails(account); // instructor entities should also be deleted - verifyAbsentInDatastore(instructor2); - verifyAbsentInDatastore(instructor3); + verifyAbsentInDatabase(instructor2); + verifyAbsentInDatabase(instructor3); ______TS("action: delete account entirely"); StudentAttributes student2 = testData.students.get("AAccounts.instr2-student-CS2104"); StudentAttributes student3 = testData.students.get("AAccounts.instr2-student-CS1101"); - verifyPresentInDatastore(student2); - verifyPresentInDatastore(student3); + verifyPresentInDatabase(student2); + verifyPresentInDatabase(student3); accountsPage.clickDeleteAccount(); accountsPage.verifyStatusMessage("Account \"" + googleId + "\" is successfully deleted."); - verifyAbsentInDatastore(account); + verifyAbsentInDatabase(account); // student entities should be deleted - verifyAbsentInDatastore(student2); - verifyAbsentInDatastore(student3); + verifyAbsentInDatabase(student2); + verifyAbsentInDatabase(student3); } diff --git a/src/e2e/java/teammates/e2e/cases/BaseE2ETestCase.java b/src/e2e/java/teammates/e2e/cases/BaseE2ETestCase.java index 558736f9abf..a0bf80288a3 100644 --- a/src/e2e/java/teammates/e2e/cases/BaseE2ETestCase.java +++ b/src/e2e/java/teammates/e2e/cases/BaseE2ETestCase.java @@ -34,7 +34,7 @@ import teammates.e2e.util.BackDoor; import teammates.e2e.util.EmailAccount; import teammates.e2e.util.TestProperties; -import teammates.test.BaseTestCaseWithDatastoreAccess; +import teammates.test.BaseTestCaseWithDatabaseAccess; import teammates.test.FileHelper; /** @@ -43,7 +43,7 @@ *

This type of test has no knowledge of the workings of the application, * and can only communicate via the UI or via {@link BackDoor} to obtain/transmit data. */ -public abstract class BaseE2ETestCase extends BaseTestCaseWithDatastoreAccess { +public abstract class BaseE2ETestCase extends BaseTestCaseWithDatabaseAccess { static final BackDoor BACKDOOR = BackDoor.getInstance(); @@ -214,7 +214,7 @@ public void setupLocalDatastoreHelper() { @Override @SuppressWarnings("PMD.EmptyMethodInAbstractClassShouldBeAbstract") public void resetLocalDatastoreHelper() { - // Local datastore state should persist across e2e test suites + // Local database state should persist across e2e test suites } @Override diff --git a/src/e2e/java/teammates/e2e/cases/FeedbackConstSumOptionQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/FeedbackConstSumOptionQuestionE2ETest.java index 0b549643433..5a38423f1e9 100644 --- a/src/e2e/java/teammates/e2e/cases/FeedbackConstSumOptionQuestionE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/FeedbackConstSumOptionQuestionE2ETest.java @@ -53,7 +53,7 @@ protected void testEditPage() { feedbackEditPage.addConstSumOptionQuestion(loadedQuestion); feedbackEditPage.verifyConstSumQuestionDetails(2, questionDetails); - verifyPresentInDatastore(loadedQuestion); + verifyPresentInDatabase(loadedQuestion); ______TS("copy question"); FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); @@ -65,7 +65,7 @@ protected void testEditPage() { copiedQuestion.setQuestionNumber(3); feedbackEditPage.verifyConstSumQuestionDetails(3, questionDetails); - verifyPresentInDatastore(copiedQuestion); + verifyPresentInDatabase(copiedQuestion); ______TS("edit question"); questionDetails = (FeedbackConstantSumQuestionDetails) loadedQuestion.getQuestionDetails(); @@ -81,7 +81,7 @@ protected void testEditPage() { feedbackEditPage.waitForPageToLoad(); feedbackEditPage.verifyConstSumQuestionDetails(2, questionDetails); - verifyPresentInDatastore(loadedQuestion); + verifyPresentInDatabase(loadedQuestion); } @Override @@ -98,7 +98,7 @@ protected void testSubmitPage() { FeedbackResponseAttributes response = getResponse(questionId, Arrays.asList(50, 20, 30)); feedbackSubmitPage.submitConstSumOptionResponse(1, "", response); - verifyPresentInDatastore(response); + verifyPresentInDatabase(response); ______TS("check previous response"); feedbackSubmitPage = getFeedbackSubmitPage(); @@ -110,7 +110,7 @@ protected void testSubmitPage() { feedbackSubmitPage = getFeedbackSubmitPage(); feedbackSubmitPage.verifyConstSumOptionResponse(1, "", response); - verifyPresentInDatastore(response); + verifyPresentInDatabase(response); } private FeedbackResponseAttributes getResponse(String questionId, List answers) { diff --git a/src/e2e/java/teammates/e2e/cases/FeedbackConstSumRecipientQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/FeedbackConstSumRecipientQuestionE2ETest.java index 0e507147597..68f0e2da9b4 100644 --- a/src/e2e/java/teammates/e2e/cases/FeedbackConstSumRecipientQuestionE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/FeedbackConstSumRecipientQuestionE2ETest.java @@ -54,7 +54,7 @@ protected void testEditPage() { feedbackEditPage.addConstSumRecipientQuestion(loadedQuestion); feedbackEditPage.verifyConstSumQuestionDetails(2, questionDetails); - verifyPresentInDatastore(loadedQuestion); + verifyPresentInDatabase(loadedQuestion); ______TS("copy question"); FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); @@ -66,7 +66,7 @@ protected void testEditPage() { copiedQuestion.setQuestionNumber(3); feedbackEditPage.verifyConstSumQuestionDetails(3, questionDetails); - verifyPresentInDatastore(copiedQuestion); + verifyPresentInDatabase(copiedQuestion); ______TS("edit question"); questionDetails = (FeedbackConstantSumQuestionDetails) loadedQuestion.getQuestionDetails(); @@ -78,7 +78,7 @@ protected void testEditPage() { feedbackEditPage.waitForPageToLoad(); feedbackEditPage.verifyConstSumQuestionDetails(2, questionDetails); - verifyPresentInDatastore(loadedQuestion); + verifyPresentInDatabase(loadedQuestion); } @Override @@ -99,8 +99,8 @@ protected void testSubmitPage() { List responses = Arrays.asList(response, response2); feedbackSubmitPage.submitConstSumRecipientResponse(1, responses); - verifyPresentInDatastore(response); - verifyPresentInDatastore(response2); + verifyPresentInDatabase(response); + verifyPresentInDatabase(response2); ______TS("check previous response"); feedbackSubmitPage = getFeedbackSubmitPage(); @@ -114,8 +114,8 @@ protected void testSubmitPage() { feedbackSubmitPage = getFeedbackSubmitPage(); feedbackSubmitPage.verifyConstSumRecipientResponse(1, responses); - verifyPresentInDatastore(response); - verifyPresentInDatastore(response2); + verifyPresentInDatabase(response); + verifyPresentInDatabase(response2); } private FeedbackResponseAttributes getResponse(String questionId, StudentAttributes receiver, Integer answer) { diff --git a/src/e2e/java/teammates/e2e/cases/FeedbackContributionQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/FeedbackContributionQuestionE2ETest.java index d25fdf8b341..e4a8a07aa66 100644 --- a/src/e2e/java/teammates/e2e/cases/FeedbackContributionQuestionE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/FeedbackContributionQuestionE2ETest.java @@ -55,7 +55,7 @@ protected void testEditPage() { feedbackEditPage.addContributionQuestion(loadedQuestion); feedbackEditPage.verifyContributionQuestionDetails(2, questionDetails); - verifyPresentInDatastore(loadedQuestion); + verifyPresentInDatabase(loadedQuestion); ______TS("copy question"); FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); @@ -67,7 +67,7 @@ protected void testEditPage() { copiedQuestion.setQuestionNumber(3); feedbackEditPage.verifyContributionQuestionDetails(3, questionDetails); - verifyPresentInDatastore(copiedQuestion); + verifyPresentInDatabase(copiedQuestion); ______TS("edit question"); questionDetails = (FeedbackContributionQuestionDetails) loadedQuestion.getQuestionDetails(); @@ -77,7 +77,7 @@ protected void testEditPage() { feedbackEditPage.waitForPageToLoad(); feedbackEditPage.verifyContributionQuestionDetails(2, questionDetails); - verifyPresentInDatastore(loadedQuestion); + verifyPresentInDatabase(loadedQuestion); } @Override @@ -99,9 +99,9 @@ protected void testSubmitPage() { List responses = Arrays.asList(response, response2, response3); feedbackSubmitPage.submitContributionResponse(1, responses); - verifyPresentInDatastore(response); - verifyPresentInDatastore(response2); - verifyPresentInDatastore(response3); + verifyPresentInDatabase(response); + verifyPresentInDatabase(response2); + verifyPresentInDatabase(response3); ______TS("check previous response"); feedbackSubmitPage = getFeedbackSubmitPage(); @@ -116,9 +116,9 @@ protected void testSubmitPage() { feedbackSubmitPage = getFeedbackSubmitPage(); feedbackSubmitPage.verifyContributionResponse(1, responses); - verifyPresentInDatastore(response); - verifyPresentInDatastore(response2); - verifyPresentInDatastore(response3); + verifyPresentInDatabase(response); + verifyPresentInDatabase(response2); + verifyPresentInDatabase(response3); } private FeedbackResponseAttributes getResponse(String questionId, StudentAttributes receiver, int answer) { diff --git a/src/e2e/java/teammates/e2e/cases/FeedbackMcqQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/FeedbackMcqQuestionE2ETest.java index d2c9bb158de..372b15bb7b4 100644 --- a/src/e2e/java/teammates/e2e/cases/FeedbackMcqQuestionE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/FeedbackMcqQuestionE2ETest.java @@ -53,7 +53,7 @@ protected void testEditPage() { feedbackEditPage.addMcqQuestion(loadedQuestion); feedbackEditPage.verifyMcqQuestionDetails(2, questionDetails); - verifyPresentInDatastore(loadedQuestion); + verifyPresentInDatabase(loadedQuestion); ______TS("copy question"); FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); @@ -65,7 +65,7 @@ protected void testEditPage() { copiedQuestion.setQuestionNumber(3); feedbackEditPage.verifyMcqQuestionDetails(3, questionDetails); - verifyPresentInDatastore(copiedQuestion); + verifyPresentInDatabase(copiedQuestion); ______TS("edit question"); questionDetails = (FeedbackMcqQuestionDetails) loadedQuestion.getQuestionDetails(); @@ -82,7 +82,7 @@ protected void testEditPage() { feedbackEditPage.waitForPageToLoad(); feedbackEditPage.verifyMcqQuestionDetails(2, questionDetails); - verifyPresentInDatastore(loadedQuestion); + verifyPresentInDatabase(loadedQuestion); } @Override @@ -102,7 +102,7 @@ protected void testSubmitPage() { FeedbackResponseAttributes response = getResponse(questionId, false, "UI"); feedbackSubmitPage.submitMcqResponse(1, "", response); - verifyPresentInDatastore(response); + verifyPresentInDatabase(response); ______TS("check previous response"); feedbackSubmitPage = getFeedbackSubmitPage(); @@ -114,7 +114,7 @@ protected void testSubmitPage() { feedbackSubmitPage = getFeedbackSubmitPage(); feedbackSubmitPage.verifyMcqResponse(1, "", response); - verifyPresentInDatastore(response); + verifyPresentInDatabase(response); } private List getGeneratedStudentOptions() { diff --git a/src/e2e/java/teammates/e2e/cases/FeedbackMsqQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/FeedbackMsqQuestionE2ETest.java index ae901fe833f..ebabe6530ef 100644 --- a/src/e2e/java/teammates/e2e/cases/FeedbackMsqQuestionE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/FeedbackMsqQuestionE2ETest.java @@ -56,7 +56,7 @@ protected void testEditPage() { feedbackEditPage.addMsqQuestion(loadedQuestion); feedbackEditPage.verifyMsqQuestionDetails(2, questionDetails); - verifyPresentInDatastore(loadedQuestion); + verifyPresentInDatabase(loadedQuestion); ______TS("copy question"); FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); @@ -68,7 +68,7 @@ protected void testEditPage() { copiedQuestion.setQuestionNumber(3); feedbackEditPage.verifyMsqQuestionDetails(3, questionDetails); - verifyPresentInDatastore(copiedQuestion); + verifyPresentInDatabase(copiedQuestion); ______TS("edit question"); questionDetails = (FeedbackMsqQuestionDetails) loadedQuestion.getQuestionDetails(); @@ -85,7 +85,7 @@ protected void testEditPage() { feedbackEditPage.waitForPageToLoad(); feedbackEditPage.verifyMsqQuestionDetails(2, questionDetails); - verifyPresentInDatastore(loadedQuestion); + verifyPresentInDatabase(loadedQuestion); } @Override @@ -109,7 +109,7 @@ protected void testSubmitPage() { FeedbackResponseAttributes response = getResponse(questionId, receiver, answers.get(answers.size() - 1), answers); feedbackSubmitPage.submitMsqResponse(1, receiver.getName(), response); - verifyPresentInDatastore(response); + verifyPresentInDatabase(response); ______TS("check previous response"); feedbackSubmitPage = getFeedbackSubmitPage(); @@ -122,7 +122,7 @@ protected void testSubmitPage() { feedbackSubmitPage = getFeedbackSubmitPage(); feedbackSubmitPage.verifyMsqResponse(1, receiver.getName(), response); - verifyPresentInDatastore(response); + verifyPresentInDatabase(response); } private List getGeneratedTeams() { diff --git a/src/e2e/java/teammates/e2e/cases/FeedbackNumScaleQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/FeedbackNumScaleQuestionE2ETest.java index d428a413800..67b34b0d895 100644 --- a/src/e2e/java/teammates/e2e/cases/FeedbackNumScaleQuestionE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/FeedbackNumScaleQuestionE2ETest.java @@ -52,7 +52,7 @@ protected void testEditPage() { feedbackEditPage.waitUntilAnimationFinish(); feedbackEditPage.verifyNumScaleQuestionDetails(2, questionDetails); - verifyPresentInDatastore(loadedQuestion); + verifyPresentInDatabase(loadedQuestion); ______TS("copy question"); FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); @@ -64,7 +64,7 @@ protected void testEditPage() { copiedQuestion.setQuestionNumber(3); feedbackEditPage.verifyNumScaleQuestionDetails(3, questionDetails); - verifyPresentInDatastore(copiedQuestion); + verifyPresentInDatabase(copiedQuestion); ______TS("edit question"); questionDetails = (FeedbackNumericalScaleQuestionDetails) loadedQuestion.getQuestionDetails(); @@ -76,7 +76,7 @@ protected void testEditPage() { feedbackEditPage.waitForPageToLoad(); feedbackEditPage.verifyNumScaleQuestionDetails(2, questionDetails); - verifyPresentInDatastore(loadedQuestion); + verifyPresentInDatabase(loadedQuestion); } @Override @@ -94,7 +94,7 @@ protected void testSubmitPage() { FeedbackResponseAttributes response = getResponse(questionId, receiver, 5.4); feedbackSubmitPage.submitNumScaleResponse(1, receiver.getTeam(), response); - verifyPresentInDatastore(response); + verifyPresentInDatabase(response); ______TS("check previous response"); feedbackSubmitPage = getFeedbackSubmitPage(); @@ -106,7 +106,7 @@ protected void testSubmitPage() { feedbackSubmitPage = getFeedbackSubmitPage(); feedbackSubmitPage.verifyNumScaleResponse(1, receiver.getTeam(), response); - verifyPresentInDatastore(response); + verifyPresentInDatabase(response); } private FeedbackResponseAttributes getResponse(String questionId, StudentAttributes receiver, Double answer) { diff --git a/src/e2e/java/teammates/e2e/cases/FeedbackRankOptionQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/FeedbackRankOptionQuestionE2ETest.java index ea163d4b434..08e31aafe44 100644 --- a/src/e2e/java/teammates/e2e/cases/FeedbackRankOptionQuestionE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/FeedbackRankOptionQuestionE2ETest.java @@ -56,7 +56,7 @@ protected void testEditPage() { feedbackEditPage.addRankOptionsQuestion(loadedQuestion); feedbackEditPage.verifyRankQuestionDetails(2, questionDetails); - verifyPresentInDatastore(loadedQuestion); + verifyPresentInDatabase(loadedQuestion); ______TS("copy question"); FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); @@ -68,7 +68,7 @@ protected void testEditPage() { copiedQuestion.setQuestionNumber(3); feedbackEditPage.verifyRankQuestionDetails(3, questionDetails); - verifyPresentInDatastore(copiedQuestion); + verifyPresentInDatabase(copiedQuestion); ______TS("edit question"); questionDetails = (FeedbackRankOptionsQuestionDetails) loadedQuestion.getQuestionDetails(); @@ -84,7 +84,7 @@ protected void testEditPage() { feedbackEditPage.waitForPageToLoad(); feedbackEditPage.verifyRankQuestionDetails(2, questionDetails); - verifyPresentInDatastore(loadedQuestion); + verifyPresentInDatabase(loadedQuestion); } @Override @@ -103,7 +103,7 @@ protected void testSubmitPage() { Const.POINTS_NOT_SUBMITTED)); feedbackSubmitPage.submitRankOptionResponse(1, receiver.getName(), response); - verifyPresentInDatastore(response); + verifyPresentInDatabase(response); ______TS("check previous response"); feedbackSubmitPage = getFeedbackSubmitPage(); @@ -115,7 +115,7 @@ protected void testSubmitPage() { feedbackSubmitPage = getFeedbackSubmitPage(); feedbackSubmitPage.verifyRankOptionResponse(1, receiver.getName(), response); - verifyPresentInDatastore(response); + verifyPresentInDatabase(response); } private FeedbackResponseAttributes getResponse(String questionId, StudentAttributes receiver, List answers) { diff --git a/src/e2e/java/teammates/e2e/cases/FeedbackRankRecipientQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/FeedbackRankRecipientQuestionE2ETest.java index 558b62c0ed3..89a9747b502 100644 --- a/src/e2e/java/teammates/e2e/cases/FeedbackRankRecipientQuestionE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/FeedbackRankRecipientQuestionE2ETest.java @@ -56,7 +56,7 @@ protected void testEditPage() { feedbackEditPage.addRankRecipientsQuestion(loadedQuestion); feedbackEditPage.verifyRankQuestionDetails(2, questionDetails); - verifyPresentInDatastore(loadedQuestion); + verifyPresentInDatabase(loadedQuestion); ______TS("copy question"); FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); @@ -68,7 +68,7 @@ protected void testEditPage() { copiedQuestion.setQuestionNumber(3); feedbackEditPage.verifyRankQuestionDetails(3, questionDetails); - verifyPresentInDatastore(copiedQuestion); + verifyPresentInDatabase(copiedQuestion); ______TS("edit question"); questionDetails = (FeedbackRankRecipientsQuestionDetails) loadedQuestion.getQuestionDetails(); @@ -80,7 +80,7 @@ protected void testEditPage() { feedbackEditPage.waitForPageToLoad(); feedbackEditPage.verifyRankQuestionDetails(2, questionDetails); - verifyPresentInDatastore(loadedQuestion); + verifyPresentInDatabase(loadedQuestion); } @Override @@ -101,8 +101,8 @@ protected void testSubmitPage() { List responses = Arrays.asList(response, response2); feedbackSubmitPage.submitRankRecipientResponse(1, responses); - verifyPresentInDatastore(response); - verifyPresentInDatastore(response2); + verifyPresentInDatabase(response); + verifyPresentInDatabase(response2); ______TS("check previous response"); feedbackSubmitPage = getFeedbackSubmitPage(); @@ -116,8 +116,8 @@ protected void testSubmitPage() { feedbackSubmitPage = getFeedbackSubmitPage(); feedbackSubmitPage.verifyRankRecipientResponse(1, responses); - verifyAbsentInDatastore(response); - verifyPresentInDatastore(response2); + verifyAbsentInDatabase(response); + verifyPresentInDatabase(response2); } private FeedbackResponseAttributes getResponse(String questionId, InstructorAttributes receiver, Integer answer) { diff --git a/src/e2e/java/teammates/e2e/cases/FeedbackRubricQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/FeedbackRubricQuestionE2ETest.java index 46ea12614ff..18f012f3369 100644 --- a/src/e2e/java/teammates/e2e/cases/FeedbackRubricQuestionE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/FeedbackRubricQuestionE2ETest.java @@ -55,7 +55,7 @@ protected void testEditPage() { feedbackEditPage.addRubricQuestion(loadedQuestion); feedbackEditPage.verifyRubricQuestionDetails(2, questionDetails); - verifyPresentInDatastore(loadedQuestion); + verifyPresentInDatabase(loadedQuestion); ______TS("copy question"); FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); @@ -67,7 +67,7 @@ protected void testEditPage() { copiedQuestion.setQuestionNumber(3); feedbackEditPage.verifyRubricQuestionDetails(3, questionDetails); - verifyPresentInDatastore(copiedQuestion); + verifyPresentInDatabase(copiedQuestion); ______TS("edit question"); // add a new choice @@ -96,7 +96,7 @@ protected void testEditPage() { feedbackEditPage.waitForPageToLoad(); feedbackEditPage.verifyRubricQuestionDetails(2, questionDetails); - verifyPresentInDatastore(loadedQuestion); + verifyPresentInDatabase(loadedQuestion); } @Override @@ -114,7 +114,7 @@ protected void testSubmitPage() { FeedbackResponseAttributes response = getResponse(questionId, receiver, Arrays.asList(1, 1)); feedbackSubmitPage.submitRubricResponse(1, receiver.getName(), response); - verifyPresentInDatastore(response); + verifyPresentInDatabase(response); ______TS("check previous response"); feedbackSubmitPage = getFeedbackSubmitPage(); @@ -126,7 +126,7 @@ protected void testSubmitPage() { feedbackSubmitPage = getFeedbackSubmitPage(); feedbackSubmitPage.verifyRubricResponse(1, receiver.getName(), response); - verifyPresentInDatastore(response); + verifyPresentInDatabase(response); } private FeedbackResponseAttributes getResponse(String questionId, StudentAttributes receiver, List answers) { diff --git a/src/e2e/java/teammates/e2e/cases/FeedbackSubmitPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/FeedbackSubmitPageE2ETest.java index bfa8fad056e..add20344c35 100644 --- a/src/e2e/java/teammates/e2e/cases/FeedbackSubmitPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/FeedbackSubmitPageE2ETest.java @@ -99,7 +99,7 @@ public void testAll() { FeedbackResponseAttributes response = getMcqResponse(questionId, recipient, false, "UI"); submitPage.submitMcqResponse(1, recipient, response); - verifyPresentInDatastore(response); + verifyPresentInDatabase(response); ______TS("add comment"); String responseId = getFeedbackResponse(response).getId(); @@ -108,21 +108,21 @@ public void testAll() { submitPage.addComment(qnToComment, recipient, comment); submitPage.verifyComment(qnToComment, recipient, comment); - verifyPresentInDatastore(getFeedbackResponseComment(responseId, comment)); + verifyPresentInDatabase(getFeedbackResponseComment(responseId, comment)); ______TS("edit comment"); comment = "

edited comment

"; submitPage.editComment(qnToComment, recipient, comment); submitPage.verifyComment(qnToComment, recipient, comment); - verifyPresentInDatastore(getFeedbackResponseComment(responseId, comment)); + verifyPresentInDatabase(getFeedbackResponseComment(responseId, comment)); ______TS("delete comment"); submitPage.deleteComment(qnToComment, recipient); submitPage.verifyStatusMessage("Your comment has been deleted!"); submitPage.verifyNoCommentPresent(qnToComment, recipient); - verifyAbsentInDatastore(getFeedbackResponseComment(responseId, comment)); + verifyAbsentInDatabase(getFeedbackResponseComment(responseId, comment)); ______TS("preview as instructor"); logout(); @@ -169,7 +169,7 @@ public void testAll() { response = getMcqResponse(questionId, recipient, false, "Algo"); submitPage.submitMcqResponse(1, recipient, response); - verifyPresentInDatastore(response); + verifyPresentInDatabase(response); } private AppUrl getStudentSubmitPageUrl(StudentAttributes student, FeedbackSessionAttributes session) { diff --git a/src/e2e/java/teammates/e2e/cases/FeedbackTextQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/FeedbackTextQuestionE2ETest.java index af1987064e7..5a972170bd7 100644 --- a/src/e2e/java/teammates/e2e/cases/FeedbackTextQuestionE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/FeedbackTextQuestionE2ETest.java @@ -50,7 +50,7 @@ protected void testEditPage() { feedbackEditPage.addTextQuestion(loadedQuestion); feedbackEditPage.verifyTextQuestionDetails(2, questionDetails); - verifyPresentInDatastore(loadedQuestion); + verifyPresentInDatabase(loadedQuestion); ______TS("copy question"); FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); @@ -62,7 +62,7 @@ protected void testEditPage() { copiedQuestion.setQuestionNumber(3); feedbackEditPage.verifyTextQuestionDetails(3, questionDetails); - verifyPresentInDatastore(copiedQuestion); + verifyPresentInDatabase(copiedQuestion); ______TS("edit question"); questionDetails.setRecommendedLength(200); @@ -70,7 +70,7 @@ protected void testEditPage() { feedbackEditPage.editTextQuestion(3, questionDetails); feedbackEditPage.verifyTextQuestionDetails(3, questionDetails); - verifyPresentInDatastore(copiedQuestion); + verifyPresentInDatabase(copiedQuestion); } @Override @@ -88,7 +88,7 @@ protected void testSubmitPage() { FeedbackResponseAttributes response = getResponse(questionId, receiver, "

This is the response for qn 1

"); feedbackSubmitPage.submitTextResponse(1, receiver.getName(), response); - verifyPresentInDatastore(response); + verifyPresentInDatabase(response); ______TS("check previous response"); feedbackSubmitPage = getFeedbackSubmitPage(); @@ -102,7 +102,7 @@ protected void testSubmitPage() { feedbackSubmitPage = getFeedbackSubmitPage(); feedbackSubmitPage.verifyTextResponse(1, receiver.getName(), response); - verifyPresentInDatastore(response); + verifyPresentInDatabase(response); } private FeedbackResponseAttributes getResponse(String questionId, InstructorAttributes instructor, String answer) { diff --git a/src/e2e/java/teammates/e2e/cases/InstructorCourseDetailsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/InstructorCourseDetailsPageE2ETest.java index 1570f91fb75..05bb7da512e 100644 --- a/src/e2e/java/teammates/e2e/cases/InstructorCourseDetailsPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/InstructorCourseDetailsPageE2ETest.java @@ -124,7 +124,7 @@ public void testAll() { + course.getId() + "\""); detailsPage.verifyNumStudents(studentsAfterDelete.length); detailsPage.verifyStudentDetails(studentsAfterDelete); - verifyAbsentInDatastore(student); + verifyAbsentInDatabase(student); ______TS("delete all students"); detailsPage.deleteAllStudents(); @@ -132,7 +132,7 @@ public void testAll() { detailsPage.verifyStatusMessage("All the students have been removed from the course"); detailsPage.verifyNumStudents(0); for (StudentAttributes student : studentsAfterDelete) { - verifyAbsentInDatastore(student); + verifyAbsentInDatabase(student); } } diff --git a/src/e2e/java/teammates/e2e/cases/InstructorCourseEditPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/InstructorCourseEditPageE2ETest.java index 1faee55af6a..6cc9aeb8d5d 100644 --- a/src/e2e/java/teammates/e2e/cases/InstructorCourseEditPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/InstructorCourseEditPageE2ETest.java @@ -71,7 +71,7 @@ public void testAll() { + "An email containing how to 'join' this course will be sent to " + newInstructor.email + " in a few minutes.\""); editPage.verifyInstructorDetails(newInstructor); - verifyPresentInDatastore(newInstructor); + verifyPresentInDatabase(newInstructor); ______TS("resend invite"); editPage.resendInstructorInvite(newInstructor); @@ -97,7 +97,7 @@ public void testAll() { editPage.verifyStatusMessage("The instructor " + instructors[0].name + " has been updated."); editPage.verifyInstructorDetails(instructors[0]); - // verify in datastore by reloading + // verify in database by reloading editPage.reloadPage(); editPage.verifyInstructorDetails(instructors[0]); @@ -105,7 +105,7 @@ public void testAll() { editPage.deleteInstructor(newInstructor); editPage.verifyStatusMessage("Instructor is successfully deleted."); editPage.verifyNumInstructorsEquals(5); - verifyAbsentInDatastore(newInstructor); + verifyAbsentInDatabase(newInstructor); ______TS("edit course"); String newName = "New Course Name"; @@ -116,7 +116,7 @@ public void testAll() { editPage.editCourse(course); editPage.verifyStatusMessage("The course has been edited."); editPage.verifyCourseDetails(course); - verifyPresentInDatastore(course); + verifyPresentInDatabase(course); ______TS("delete course"); editPage.deleteCourse(); diff --git a/src/e2e/java/teammates/e2e/cases/InstructorCourseEnrollPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/InstructorCourseEnrollPageE2ETest.java index 419f2f13bd5..4b644e2aedb 100644 --- a/src/e2e/java/teammates/e2e/cases/InstructorCourseEnrollPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/InstructorCourseEnrollPageE2ETest.java @@ -48,7 +48,7 @@ public void testAll() { enrollPage = getNewPageInstance(url, InstructorCourseEnrollPage.class); enrollPage.verifyExistingStudentsTableContains(studentsEnrollingToEmptyCourse); - // verify students in datastore + // verify students in database assertEquals(getStudent(student1), student1); assertEquals(getStudent(student2), student2); assertEquals(getStudent(student3), student3); @@ -77,7 +77,7 @@ public void testAll() { enrollPage.verifyResultsPanelContains(newStudentsData, modifiedStudentsData, modifiedWithoutChangeStudentsData, errorStudentsData, unmodifiedStudentsData); - // verify students in datastore + // verify students in database assertEquals(getStudent(student1), student1); assertEquals(getStudent(student2), student2); assertEquals(getStudent(student3), student3); diff --git a/src/e2e/java/teammates/e2e/cases/InstructorCourseStudentDetailsEditPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/InstructorCourseStudentDetailsEditPageE2ETest.java index 88dfe81ce6c..d2cb94cf085 100644 --- a/src/e2e/java/teammates/e2e/cases/InstructorCourseStudentDetailsEditPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/InstructorCourseStudentDetailsEditPageE2ETest.java @@ -48,7 +48,7 @@ public void testAll() { editPage.editStudentDetails(student); editPage.verifyStatusMessage("Student has been updated"); - verifyPresentInDatastore(student); + verifyPresentInDatabase(student); ______TS("cannot edit to an existing email"); editPage = getNewPageInstance(editPageUrl, InstructorCourseStudentDetailsEditPage.class); @@ -63,7 +63,7 @@ public void testAll() { editPage.editStudentEmailAndResendLinks(newEmail); editPage.verifyStatusMessage("Student has been updated and email sent"); - verifyPresentInDatastore(student); + verifyPresentInDatabase(student); verifyEmailSent(newEmail, "TEAMMATES: Summary of course [" + course.getName() + "][Course ID: " + course.getId() + "]"); } diff --git a/src/e2e/java/teammates/e2e/cases/InstructorCoursesPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/InstructorCoursesPageE2ETest.java index 11d7278a78f..f40989cdde7 100644 --- a/src/e2e/java/teammates/e2e/cases/InstructorCoursesPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/InstructorCoursesPageE2ETest.java @@ -71,7 +71,7 @@ public void testAll() { coursesPage.verifyStatusMessage("The course has been added."); coursesPage.sortByCourseId(); coursesPage.verifyActiveCoursesDetails(activeCoursesWithNewCourse); - verifyPresentInDatastore(newCourse); + verifyPresentInDatabase(newCourse); ______TS("archive course"); CourseAttributes[] archivedCoursesWithNewCourse = { newCourse, courses[1] }; @@ -81,7 +81,7 @@ public void testAll() { + "It will not appear on the home page anymore."); coursesPage.verifyNumActiveCourses(1); coursesPage.verifyArchivedCoursesDetails(archivedCoursesWithNewCourse); - verifyCourseArchivedInDatastore(instructorId, newCourse); + verifyCourseArchivedInDatabase(instructorId, newCourse); ______TS("unarchive course"); CourseAttributes[] activeCoursesWithNewCourseSortedByName = { newCourse, courses[0] }; @@ -91,7 +91,7 @@ public void testAll() { coursesPage.verifyNumArchivedCourses(1); coursesPage.sortByCourseName(); coursesPage.verifyActiveCoursesDetails(activeCoursesWithNewCourseSortedByName); - verifyCourseNotArchivedInDatastore(instructorId, newCourse); + verifyCourseNotArchivedInDatabase(instructorId, newCourse); ______TS("move active course to recycle bin"); newCourse.deletedAt = Instant.now(); @@ -136,7 +136,7 @@ public void testAll() { coursesPage.verifyNumDeletedCourses(1); coursesPage.verifyArchivedCoursesDetails(archivedCoursesWithNewCourse); assertFalse(BACKDOOR.isCourseInRecycleBin(newCourse.getId())); - verifyCourseArchivedInDatastore(instructorId, newCourse); + verifyCourseArchivedInDatabase(instructorId, newCourse); ______TS("permanently delete course"); coursesPage.moveArchivedCourseToRecycleBin(newCourse.getId()); @@ -145,7 +145,7 @@ public void testAll() { coursesPage.verifyStatusMessage("The course " + newCourse.getId() + " has been permanently deleted."); coursesPage.verifyNumDeletedCourses(1); - verifyAbsentInDatastore(newCourse); + verifyAbsentInDatabase(newCourse); ______TS("restore all"); coursesPage.moveArchivedCourseToRecycleBin(courses[1].getId()); @@ -170,8 +170,8 @@ public void testAll() { coursesPage.verifyNumActiveCourses(1); coursesPage.verifyNumArchivedCourses(0); coursesPage.verifyNumDeletedCourses(0); - verifyAbsentInDatastore(courses[1]); - verifyAbsentInDatastore(courses[2]); + verifyAbsentInDatabase(courses[1]); + verifyAbsentInDatabase(courses[2]); } private void verifyActiveCourseStatistics(InstructorCoursesPage coursesPage, CourseAttributes course) { @@ -203,7 +203,7 @@ private void verifyActiveCourseStatistics(InstructorCoursesPage coursesPage, Cou Integer.toString(numStudents), Integer.toString(numUnregistered)); } - private void verifyCourseArchivedInDatastore(String instructorId, CourseAttributes course) { + private void verifyCourseArchivedInDatabase(String instructorId, CourseAttributes course) { int retryLimit = 5; CourseAttributes actual = getArchivedCourse(instructorId, course.getId()); while (actual == null && retryLimit > 0) { @@ -214,7 +214,7 @@ private void verifyCourseArchivedInDatastore(String instructorId, CourseAttribut assertEquals(actual, course); } - private void verifyCourseNotArchivedInDatastore(String instructorId, CourseAttributes course) { + private void verifyCourseNotArchivedInDatabase(String instructorId, CourseAttributes course) { int retryLimit = 5; CourseAttributes actual = getArchivedCourse(instructorId, course.getId()); while (actual != null && retryLimit > 0) { diff --git a/src/e2e/java/teammates/e2e/cases/InstructorFeedbackEditPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/InstructorFeedbackEditPageE2ETest.java index 2ceadddc3aa..2f6ee2355e9 100644 --- a/src/e2e/java/teammates/e2e/cases/InstructorFeedbackEditPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/InstructorFeedbackEditPageE2ETest.java @@ -62,7 +62,7 @@ public void testAll() { feedbackEditPage.editSessionDetails(feedbackSession); feedbackEditPage.verifyStatusMessage("The feedback session has been updated."); feedbackEditPage.verifySessionDetails(course, feedbackSession); - verifyPresentInDatastore(feedbackSession); + verifyPresentInDatabase(feedbackSession); ______TS("add template question"); FeedbackQuestionAttributes templateQuestion = getTemplateQuestion(); @@ -71,7 +71,7 @@ public void testAll() { feedbackEditPage.verifyStatusMessage("The question has been added to this feedback session."); feedbackEditPage.verifyNumQuestions(1); feedbackEditPage.verifyQuestionDetails(1, templateQuestion); - verifyPresentInDatastore(templateQuestion); + verifyPresentInDatabase(templateQuestion); ______TS("copy question from other session"); FeedbackQuestionAttributes questionToCopy = testData.feedbackQuestions.get("qn1"); @@ -83,7 +83,7 @@ public void testAll() { feedbackEditPage.verifyStatusMessage("The question has been added to this feedback session."); feedbackEditPage.verifyNumQuestions(2); feedbackEditPage.verifyQuestionDetails(2, questionToCopy); - verifyPresentInDatastore(questionToCopy); + verifyPresentInDatabase(questionToCopy); ______TS("reorder questions"); questionToCopy.setQuestionNumber(1); @@ -106,7 +106,7 @@ public void testAll() { feedbackEditPage.verifyStatusMessage("The changes to the question have been updated."); feedbackEditPage.verifyQuestionDetails(1, editedQuestion); - verifyPresentInDatastore(editedQuestion); + verifyPresentInDatabase(editedQuestion); ______TS("duplicate question"); editedQuestion.setQuestionNumber(3); @@ -115,7 +115,7 @@ public void testAll() { feedbackEditPage.verifyStatusMessage("The question has been duplicated below."); feedbackEditPage.verifyNumQuestions(3); feedbackEditPage.verifyQuestionDetails(3, editedQuestion); - verifyPresentInDatastore(editedQuestion); + verifyPresentInDatabase(editedQuestion); ______TS("delete question"); templateQuestion.setQuestionNumber(1); @@ -124,7 +124,7 @@ public void testAll() { feedbackEditPage.verifyStatusMessage("The question has been deleted."); feedbackEditPage.verifyNumQuestions(2); feedbackEditPage.verifyQuestionDetails(1, templateQuestion); - // verify qn 1 has been replaced in datastore by qn 2 + // verify qn 1 has been replaced in database by qn 2 verifyReorder(templateQuestion); ______TS("preview session as student"); @@ -144,7 +144,7 @@ public void testAll() { feedbackEditPage.verifyStatusMessage("The feedback session has been copied. " + "Please modify settings/questions as necessary."); - verifyPresentInDatastore(feedbackSession); + verifyPresentInDatabase(feedbackSession); ______TS("delete session"); feedbackEditPage.deleteSession(); diff --git a/src/e2e/java/teammates/e2e/cases/InstructorFeedbackSessionsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/InstructorFeedbackSessionsPageE2ETest.java index d387de7e35a..00af840f6ac 100644 --- a/src/e2e/java/teammates/e2e/cases/InstructorFeedbackSessionsPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/InstructorFeedbackSessionsPageE2ETest.java @@ -98,7 +98,7 @@ public void testAll() { InstructorFeedbackSessionsPage.class); feedbackSessionsPage.sortBySessionsName(); feedbackSessionsPage.verifySessionsTable(sessionsForAdded); - verifyPresentInDatastore(newSession); + verifyPresentInDatabase(newSession); ______TS("add new copied session"); String newName = "Copied Name"; @@ -113,7 +113,7 @@ public void testAll() { feedbackSessionsPage = getNewPageInstance(url, InstructorFeedbackSessionsPage.class); feedbackSessionsPage.verifySessionDetails(copiedSession); - verifyPresentInDatastore(copiedSession); + verifyPresentInDatabase(copiedSession); ______TS("copy session"); newName = "Copied Name 2"; @@ -128,7 +128,7 @@ public void testAll() { feedbackSessionsPage = getNewPageInstance(url, InstructorFeedbackSessionsPage.class); feedbackSessionsPage.verifySessionDetails(copiedSession2); - verifyPresentInDatastore(copiedSession2); + verifyPresentInDatabase(copiedSession2); ______TS("publish results"); openSession.setResultsVisibleFromTime(Const.TIME_REPRESENTS_NOW); @@ -214,7 +214,7 @@ public void testAll() { feedbackSessionsPage.sortBySessionsName(); feedbackSessionsPage.verifySessionsTable(sessionsForDelete); feedbackSessionsPage.verifyNumSoftDeleted(0); - verifyAbsentInDatastore(newSession); + verifyAbsentInDatabase(newSession); ______TS("restore all session"); FeedbackSessionAttributes[] sessionsForRestoreAll = { openSession, closedSession, copiedSession2, @@ -242,8 +242,8 @@ public void testAll() { feedbackSessionsPage.sortBySessionsName(); feedbackSessionsPage.verifySessionsTable(sessionsForDeleteAll); feedbackSessionsPage.verifyNumSoftDeleted(0); - verifyAbsentInDatastore(copiedSession); - verifyAbsentInDatastore(copiedSession2); + verifyAbsentInDatabase(copiedSession); + verifyAbsentInDatabase(copiedSession2); } private String getExpectedResponseRate(FeedbackSessionAttributes session) { diff --git a/src/e2e/java/teammates/e2e/cases/InstructorHomePageE2ETest.java b/src/e2e/java/teammates/e2e/cases/InstructorHomePageE2ETest.java index 6267ef33451..8a11c3a99bd 100644 --- a/src/e2e/java/teammates/e2e/cases/InstructorHomePageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/InstructorHomePageE2ETest.java @@ -105,7 +105,7 @@ public void testAll() { otherCourseIndex = 1; FeedbackSessionAttributes[] otherCourseSessionsWithCopy = { copiedSession, otherCourseSession }; homePage.verifyCourseTabDetails(otherCourseIndex, otherCourse, otherCourseSessionsWithCopy); - verifyPresentInDatastore(copiedSession); + verifyPresentInDatabase(copiedSession); ______TS("publish results"); sessionIndex = 0; @@ -175,7 +175,7 @@ public void testAll() { homePage.verifyStatusMessage("The course " + course.getId() + " has been archived. " + "You can retrieve it from the Courses page."); homePage.verifyNumCourses(1); - verifyCourseArchivedInDatastore(instructor.getGoogleId(), course); + verifyCourseArchivedInDatabase(instructor.getGoogleId(), course); ______TS("delete course"); otherCourseIndex = 0; @@ -225,7 +225,7 @@ private void verifySessionPublishedState(FeedbackSessionAttributes feedbackSessi assertEquals(actual.isPublished(), state); } - private void verifyCourseArchivedInDatastore(String instructorId, CourseAttributes course) { + private void verifyCourseArchivedInDatabase(String instructorId, CourseAttributes course) { int retryLimit = 5; CourseAttributes actual = getArchivedCourse(instructorId, course.getId()); while (actual == null && retryLimit > 0) { diff --git a/src/e2e/java/teammates/e2e/cases/InstructorSearchPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/InstructorSearchPageE2ETest.java index ae646abf451..9ac5884a245 100644 --- a/src/e2e/java/teammates/e2e/cases/InstructorSearchPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/InstructorSearchPageE2ETest.java @@ -113,7 +113,7 @@ public void testAll() { }; searchPage.verifyStudentDetails(course2, studentsAfterDelete); - verifyAbsentInDatastore(studentToDelete); + verifyAbsentInDatabase(studentToDelete); } diff --git a/src/e2e/java/teammates/e2e/cases/InstructorStudentListPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/InstructorStudentListPageE2ETest.java index 806570a677e..6a6919dd344 100644 --- a/src/e2e/java/teammates/e2e/cases/InstructorStudentListPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/InstructorStudentListPageE2ETest.java @@ -123,7 +123,7 @@ public void testAll() { }; listPage.verifyStudentDetails(course3, studentsAfterDelete); - verifyAbsentInDatastore(studentToDelete); + verifyAbsentInDatabase(studentToDelete); } diff --git a/src/lnp/java/teammates/lnp/cases/BaseLNPTestCase.java b/src/lnp/java/teammates/lnp/cases/BaseLNPTestCase.java index 03bf1aff9cd..e91320df856 100644 --- a/src/lnp/java/teammates/lnp/cases/BaseLNPTestCase.java +++ b/src/lnp/java/teammates/lnp/cases/BaseLNPTestCase.java @@ -232,7 +232,7 @@ protected void createTestData() { } /** - * Creates the entities in the datastore from the JSON data file. + * Creates the entities in the database from the JSON data file. */ protected void persistTestData() throws IOException, HttpRequestFailedException { DataBundle dataBundle = loadDataBundle(getJsonDataPath()); @@ -297,7 +297,7 @@ protected void runJmeter(boolean shouldCreateJmxFile) throws IOException { } /** - * Deletes the data that was created in the datastore from the JSON data file. + * Deletes the data that was created in the database from the JSON data file. */ protected void deleteTestData() { DataBundle dataBundle = loadDataBundle(getJsonDataPath()); diff --git a/src/main/java/teammates/logic/api/Logic.java b/src/main/java/teammates/logic/api/Logic.java index ec4e2e01bae..9c63f3b5b3d 100644 --- a/src/main/java/teammates/logic/api/Logic.java +++ b/src/main/java/teammates/logic/api/Logic.java @@ -112,7 +112,7 @@ public void deleteAccountCascade(String googleId) { * * @return the created instructor * @throws InvalidParametersException if the instructor is not valid - * @throws EntityAlreadyExistsException if the instructor already exists in the Datastore + * @throws EntityAlreadyExistsException if the instructor already exists in the database */ public InstructorAttributes createInstructor(InstructorAttributes instructor) throws InvalidParametersException, EntityAlreadyExistsException { @@ -626,7 +626,7 @@ public void resetInstructorGoogleId(String originalEmail, String courseId) throw * * @return the created student. * @throws InvalidParametersException if the student is not valid. - * @throws EntityAlreadyExistsException if the student already exists in the Datastore. + * @throws EntityAlreadyExistsException if the student already exists in the database. */ public StudentAttributes createStudent(StudentAttributes student) throws InvalidParametersException, EntityAlreadyExistsException { @@ -1307,7 +1307,7 @@ public String getSectionForTeam(String courseId, String teamName) { } /** - * Persists the given data bundle to the datastore. + * Persists the given data bundle to the database. * * @see DataBundleLogic#persistDataBundle(DataBundle) */ @@ -1316,7 +1316,7 @@ public DataBundle persistDataBundle(DataBundle dataBundle) throws InvalidParamet } /** - * Removes the given data bundle from the datastore. + * Removes the given data bundle from the database. * * @see DataBundleLogic#removeDataBundle(DataBundle) */ @@ -1325,7 +1325,7 @@ public void removeDataBundle(DataBundle dataBundle) { } /** - * Puts searchable documents from the data bundle to the datastore. + * Puts searchable documents from the data bundle to the database. * * @see DataBundleLogic#putDocuments(DataBundle) */ diff --git a/src/main/java/teammates/logic/core/AccountsLogic.java b/src/main/java/teammates/logic/core/AccountsLogic.java index 64f001252a1..ee52b14e68e 100644 --- a/src/main/java/teammates/logic/core/AccountsLogic.java +++ b/src/main/java/teammates/logic/core/AccountsLogic.java @@ -43,7 +43,7 @@ public static AccountsLogic inst() { * * @return the created account * @throws InvalidParametersException if the account is not valid - * @throws EntityAlreadyExistsException if the account already exists in the Datastore. + * @throws EntityAlreadyExistsException if the account already exists in the database. */ AccountAttributes createAccount(AccountAttributes accountData) throws InvalidParametersException, EntityAlreadyExistsException { diff --git a/src/main/java/teammates/logic/core/CoursesLogic.java b/src/main/java/teammates/logic/core/CoursesLogic.java index 113913c2a92..16d3cd9267e 100644 --- a/src/main/java/teammates/logic/core/CoursesLogic.java +++ b/src/main/java/teammates/logic/core/CoursesLogic.java @@ -34,7 +34,7 @@ public final class CoursesLogic { private static CoursesLogic instance = new CoursesLogic(); /* Explanation: This class depends on CoursesDb class but no other *Db classes. - * That is because reading/writing entities from/to the datastore is the + * That is because reading/writing entities from/to the database is the * responsibility of the matching *Logic class. * However, this class can talk to other *Logic classes. That is because * the logic related to one entity type can involve the logic related to @@ -64,7 +64,7 @@ public static CoursesLogic inst() { * * @return the created course * @throws InvalidParametersException if the course is not valid - * @throws EntityAlreadyExistsException if the course already exists in the Datastore. + * @throws EntityAlreadyExistsException if the course already exists in the database. */ CourseAttributes createCourse(CourseAttributes courseToCreate) throws InvalidParametersException, EntityAlreadyExistsException { diff --git a/src/main/java/teammates/logic/core/DataBundleLogic.java b/src/main/java/teammates/logic/core/DataBundleLogic.java index 0e1f9af2a01..3a3d8fe1ff1 100644 --- a/src/main/java/teammates/logic/core/DataBundleLogic.java +++ b/src/main/java/teammates/logic/core/DataBundleLogic.java @@ -61,7 +61,7 @@ public static DataBundleLogic inst() { } /** - * Persists data in the given {@link DataBundle} to the Datastore, including + * Persists data in the given {@link DataBundle} to the database, including * accounts, courses, instructors, students, sessions, questions, responses, and comments. * *

Accounts are generated for students and instructors with Google IDs diff --git a/src/main/java/teammates/logic/core/FeedbackQuestionsLogic.java b/src/main/java/teammates/logic/core/FeedbackQuestionsLogic.java index 06b4faa2b39..ef95287767f 100644 --- a/src/main/java/teammates/logic/core/FeedbackQuestionsLogic.java +++ b/src/main/java/teammates/logic/core/FeedbackQuestionsLogic.java @@ -79,7 +79,7 @@ public FeedbackQuestionAttributes createFeedbackQuestion(FeedbackQuestionAttribu * Gets a single question corresponding to the given parameters.

* Note:
* * This method should only be used if the question already exists in the
- * datastore and has an ID already generated. + * database and has an ID already generated. */ public FeedbackQuestionAttributes getFeedbackQuestion(String feedbackQuestionId) { return fqDb.getFeedbackQuestion(feedbackQuestionId); diff --git a/src/main/java/teammates/logic/core/InstructorsLogic.java b/src/main/java/teammates/logic/core/InstructorsLogic.java index 39ccc20d354..329767ad5bd 100644 --- a/src/main/java/teammates/logic/core/InstructorsLogic.java +++ b/src/main/java/teammates/logic/core/InstructorsLogic.java @@ -74,7 +74,7 @@ public List searchInstructorsInWholeSystem(String queryStr * * @return the created instructor * @throws InvalidParametersException if the instructor is not valid - * @throws EntityAlreadyExistsException if the instructor already exists in the Datastore + * @throws EntityAlreadyExistsException if the instructor already exists in the database */ public InstructorAttributes createInstructor(InstructorAttributes instructorToAdd) throws InvalidParametersException, EntityAlreadyExistsException { diff --git a/src/main/java/teammates/logic/core/StudentsLogic.java b/src/main/java/teammates/logic/core/StudentsLogic.java index 1cd147c052b..1df70383d35 100644 --- a/src/main/java/teammates/logic/core/StudentsLogic.java +++ b/src/main/java/teammates/logic/core/StudentsLogic.java @@ -52,7 +52,7 @@ public static StudentsLogic inst() { * * @return the created student * @throws InvalidParametersException if the student is not valid - * @throws EntityAlreadyExistsException if the student already exists in the Datastore + * @throws EntityAlreadyExistsException if the student already exists in the database */ public StudentAttributes createStudent(StudentAttributes studentData) throws InvalidParametersException, EntityAlreadyExistsException { diff --git a/src/main/java/teammates/storage/api/EntitiesDb.java b/src/main/java/teammates/storage/api/EntitiesDb.java index 7f10ff6c993..f5021b713ac 100644 --- a/src/main/java/teammates/storage/api/EntitiesDb.java +++ b/src/main/java/teammates/storage/api/EntitiesDb.java @@ -21,7 +21,7 @@ import teammates.storage.entity.BaseEntity; /** - * Base class for all classes performing CRUD operations against the Datastore. + * Base class for all classes performing CRUD operations against the database. * * @param Specific entity class * @param Specific attributes class @@ -47,7 +47,7 @@ abstract class EntitiesDb> { static final Logger log = Logger.getLogger(); /** - * Creates the entity in the Datastore. + * Creates the entity in the database. * * @return created entity * @throws InvalidParametersException if the entity to create is invalid @@ -81,12 +81,12 @@ private A createEntity(A entityToAdd, boolean shouldCheckExistence) } /** - * Checks whether there are existing entities in the Datastore. + * Checks whether there are existing entities in the database. */ abstract boolean hasExistingEntities(A entityToCreate); /** - * Puts an entity in the datastore without existence checking. + * Puts an entity in the database without existence checking. * *

The document of the associated entity (if applicable) WILL NOT be updated. * @@ -103,7 +103,7 @@ public A putEntity(A entityToAdd) throws InvalidParametersException { } /** - * Puts a collection of entity in the datastore without existence checking. + * Puts a collection of entity in the database without existence checking. * *

The documents of the associated entities (if applicable) WILL NOT be updated. * diff --git a/src/main/java/teammates/storage/api/InstructorsDb.java b/src/main/java/teammates/storage/api/InstructorsDb.java index c4f9ab56f52..d0b17f67747 100644 --- a/src/main/java/teammates/storage/api/InstructorsDb.java +++ b/src/main/java/teammates/storage/api/InstructorsDb.java @@ -86,7 +86,7 @@ public List searchInstructorsInWholeSystem(String queryStr * * @return the created instructor * @throws InvalidParametersException if the instructor is not valid - * @throws EntityAlreadyExistsException if the instructor already exists in the Datastore + * @throws EntityAlreadyExistsException if the instructor already exists in the database */ @Override public InstructorAttributes createEntity(InstructorAttributes instructorToAdd) diff --git a/src/main/java/teammates/storage/api/StudentsDb.java b/src/main/java/teammates/storage/api/StudentsDb.java index 27a91a5d071..23b327490e4 100644 --- a/src/main/java/teammates/storage/api/StudentsDb.java +++ b/src/main/java/teammates/storage/api/StudentsDb.java @@ -97,7 +97,7 @@ public void deleteDocumentByStudentId(String studentUniqueId) { * * @return the created student * @throws InvalidParametersException if the student is not valid - * @throws EntityAlreadyExistsException if the student already exists in the Datastore + * @throws EntityAlreadyExistsException if the student already exists in the database */ @Override public StudentAttributes createEntity(StudentAttributes student) diff --git a/src/main/java/teammates/storage/entity/BaseEntity.java b/src/main/java/teammates/storage/entity/BaseEntity.java index 140c6dcf0ee..bdc28c18366 100644 --- a/src/main/java/teammates/storage/entity/BaseEntity.java +++ b/src/main/java/teammates/storage/entity/BaseEntity.java @@ -15,7 +15,7 @@ import com.googlecode.objectify.impl.translate.ValueTranslatorFactory; /** - * Base class for all entities persisted to the Datastore. + * Base class for all entities persisted to the database. */ public class BaseEntity { diff --git a/src/main/java/teammates/storage/entity/Instructor.java b/src/main/java/teammates/storage/entity/Instructor.java index 77b654b500b..0bdae167ee5 100644 --- a/src/main/java/teammates/storage/entity/Instructor.java +++ b/src/main/java/teammates/storage/entity/Instructor.java @@ -123,7 +123,7 @@ public void setCourseId(String courseId) { public boolean getIsArchived() { if (isArchived == null) { // the legacy data corresponding to isArchived is stored as a null value (not a missing value) - // in the datastore + // in the database return false; } return isArchived; diff --git a/src/test/java/teammates/logic/core/AccountsLogicTest.java b/src/test/java/teammates/logic/core/AccountsLogicTest.java index 0bba1093142..ea9d3b1324f 100644 --- a/src/test/java/teammates/logic/core/AccountsLogicTest.java +++ b/src/test/java/teammates/logic/core/AccountsLogicTest.java @@ -57,7 +57,7 @@ public void testCreateAccount() throws Exception { .build(); accountsLogic.createAccount(accountToCreate); - verifyPresentInDatastore(accountToCreate); + verifyPresentInDatabase(accountToCreate); accountsLogic.deleteAccountCascade("id"); @@ -127,7 +127,7 @@ public void testJoinCourseForStudent() throws Exception { originalEmail); StudentAttributes finalStudent = studentData; - verifyPresentInDatastore(studentData); + verifyPresentInDatabase(studentData); ______TS("failure: wrong key"); @@ -172,7 +172,7 @@ public void testJoinCourseForStudent() throws Exception { accountsLogic.joinCourseForStudent(StringHelper.encrypt(studentData.key), correctStudentId); studentData.googleId = accountData.googleId; - verifyPresentInDatastore(studentData); + verifyPresentInDatabase(studentData); assertEquals( correctStudentId, studentsLogic.getStudentForEmail(studentData.course, studentData.email).googleId); @@ -208,7 +208,7 @@ public void testJoinCourseForStudent() throws Exception { String encryptedKey = StringHelper.encrypt(studentData.key); accountsLogic.joinCourseForStudent(encryptedKey, correctStudentId); studentData.googleId = correctStudentId; - verifyPresentInDatastore(studentData); + verifyPresentInDatabase(studentData); assertEquals(correctStudentId, studentsLogic.getStudentForEmail(studentData.course, studentData.email).googleId); @@ -217,7 +217,7 @@ public void testJoinCourseForStudent() throws Exception { accountData.email = originalEmail; accountData.name = "name"; accountData.isInstructor = false; - verifyPresentInDatastore(accountData); + verifyPresentInDatabase(accountData); ______TS("success: join course as student does not revoke instructor status"); @@ -456,17 +456,17 @@ public void testDeleteAccountCascade_lastInstructorInCourse_shouldDeleteOrphanCo .withGoogleId(instructor.googleId) .build(); studentsLogic.createStudent(student); - verifyPresentInDatastore(account); - verifyPresentInDatastore(studentProfile); - verifyPresentInDatastore(instructor); - verifyPresentInDatastore(student); + verifyPresentInDatabase(account); + verifyPresentInDatabase(studentProfile); + verifyPresentInDatabase(instructor); + verifyPresentInDatabase(student); accountsLogic.deleteAccountCascade(instructor.googleId); - verifyAbsentInDatastore(account); - verifyAbsentInDatastore(studentProfile); - verifyAbsentInDatastore(instructor); - verifyAbsentInDatastore(student); + verifyAbsentInDatabase(account); + verifyAbsentInDatabase(studentProfile); + verifyAbsentInDatabase(instructor); + verifyAbsentInDatabase(student); // course is deleted because it is the last instructor of the course assertNull(coursesLogic.getCourse(instructor.getCourseId())); } diff --git a/src/test/java/teammates/logic/core/CoursesLogicTest.java b/src/test/java/teammates/logic/core/CoursesLogicTest.java index 007dc370727..6574c04ebb7 100644 --- a/src/test/java/teammates/logic/core/CoursesLogicTest.java +++ b/src/test/java/teammates/logic/core/CoursesLogicTest.java @@ -315,7 +315,7 @@ private void testCreateCourse() throws Exception { .withName(c.getName()) .withTimezone(c.getTimeZone()) .build()); - verifyPresentInDatastore(c); + verifyPresentInDatabase(c); coursesLogic.deleteCourseCascade(c.getId()); ______TS("Null parameter"); @@ -356,8 +356,8 @@ private void testCreateCourseAndInstructor() throws Exception { .withTimezone(c.getTimeZone()) .build())); AssertHelper.assertContains("for a non-existent instructor", ae.getMessage()); - verifyAbsentInDatastore(c); - verifyAbsentInDatastore(i); + verifyAbsentInDatabase(c); + verifyAbsentInDatabase(i); ______TS("fails: account doesn't have instructor privileges"); @@ -376,8 +376,8 @@ private void testCreateCourseAndInstructor() throws Exception { .withTimezone(c.getTimeZone()) .build())); AssertHelper.assertContains("doesn't have instructor privileges", ae.getMessage()); - verifyAbsentInDatastore(c); - verifyAbsentInDatastore(i); + verifyAbsentInDatabase(c); + verifyAbsentInDatabase(i); ______TS("fails: error during course creation"); @@ -402,8 +402,8 @@ private void testCreateCourseAndInstructor() throws Exception { .withTimezone(invalidCourse.getTimeZone()) .build())); assertEquals(expectedError, ipe.getMessage()); - verifyAbsentInDatastore(invalidCourse); - verifyAbsentInDatastore(i); + verifyAbsentInDatabase(invalidCourse); + verifyAbsentInDatabase(i); ______TS("fails: error during instructor creation due to duplicate instructor"); @@ -423,7 +423,7 @@ private void testCreateCourseAndInstructor() throws Exception { AssertHelper.assertContains( "Unexpected exception while trying to create instructor for a new course", ae.getMessage()); - verifyAbsentInDatastore(courseWithDuplicateInstructor); + verifyAbsentInDatabase(courseWithDuplicateInstructor); ______TS("fails: error during instructor creation due to invalid parameters"); @@ -438,13 +438,13 @@ private void testCreateCourseAndInstructor() throws Exception { AssertHelper.assertContains( "Unexpected exception while trying to create instructor for a new course", ae.getMessage()); - verifyAbsentInDatastore(courseWithDuplicateInstructor); + verifyAbsentInDatabase(courseWithDuplicateInstructor); ______TS("success: typical case"); i.email = "ins.for.iccai@gmail.tmt"; - //remove the duplicate instructor object from the datastore. + //remove the duplicate instructor object from the database. instructorsLogic.deleteInstructorCascade(i.courseId, i.email); coursesLogic.createCourseAndInstructor(i.googleId, @@ -452,8 +452,8 @@ private void testCreateCourseAndInstructor() throws Exception { .withName(courseWithDuplicateInstructor.getName()) .withTimezone(courseWithDuplicateInstructor.getTimeZone()) .build()); - verifyPresentInDatastore(courseWithDuplicateInstructor); - verifyPresentInDatastore(i); + verifyPresentInDatabase(courseWithDuplicateInstructor); + verifyPresentInDatabase(i); ______TS("Null parameter"); @@ -471,12 +471,12 @@ private void testMoveCourseToRecycleBin() throws InvalidParametersException, Ent CourseAttributes course1OfInstructor = dataBundle.courses.get("typicalCourse1"); - // Ensure there are entities in the datastore under this course - verifyPresentInDatastore(course1OfInstructor); - verifyPresentInDatastore(dataBundle.students.get("student1InCourse1")); - verifyPresentInDatastore(dataBundle.students.get("student5InCourse1")); - verifyPresentInDatastore(dataBundle.feedbackSessions.get("session1InCourse1")); - verifyPresentInDatastore(dataBundle.feedbackSessions.get("session2InCourse1")); + // Ensure there are entities in the database under this course + verifyPresentInDatabase(course1OfInstructor); + verifyPresentInDatabase(dataBundle.students.get("student1InCourse1")); + verifyPresentInDatabase(dataBundle.students.get("student5InCourse1")); + verifyPresentInDatabase(dataBundle.feedbackSessions.get("session1InCourse1")); + verifyPresentInDatabase(dataBundle.feedbackSessions.get("session2InCourse1")); // Ensure the course is not in Recycle Bin assertFalse(course1OfInstructor.isCourseDeleted()); @@ -484,12 +484,12 @@ private void testMoveCourseToRecycleBin() throws InvalidParametersException, Ent Instant deletedAt = coursesLogic.moveCourseToRecycleBin(course1OfInstructor.getId()); course1OfInstructor.deletedAt = deletedAt; - // Ensure the course and related entities still exist in datastore - verifyPresentInDatastore(course1OfInstructor); - verifyPresentInDatastore(dataBundle.students.get("student1InCourse1")); - verifyPresentInDatastore(dataBundle.students.get("student5InCourse1")); - verifyPresentInDatastore(dataBundle.feedbackSessions.get("session1InCourse1")); - verifyPresentInDatastore(dataBundle.feedbackSessions.get("session2InCourse1")); + // Ensure the course and related entities still exist in database + verifyPresentInDatabase(course1OfInstructor); + verifyPresentInDatabase(dataBundle.students.get("student1InCourse1")); + verifyPresentInDatabase(dataBundle.students.get("student5InCourse1")); + verifyPresentInDatabase(dataBundle.feedbackSessions.get("session1InCourse1")); + verifyPresentInDatabase(dataBundle.feedbackSessions.get("session2InCourse1")); // Ensure the course is moved to Recycle Bin assertTrue(course1OfInstructor.isCourseDeleted()); @@ -505,10 +505,10 @@ private void testRestoreCourseFromRecycleBin() throws InvalidParametersException CourseAttributes course3OfInstructor = dataBundle.courses.get("typicalCourse3"); - // Ensure there are entities in the datastore under this course - verifyPresentInDatastore(course3OfInstructor); - verifyPresentInDatastore(dataBundle.students.get("student1InCourse3")); - verifyPresentInDatastore(dataBundle.feedbackSessions.get("session1InCourse3")); + // Ensure there are entities in the database under this course + verifyPresentInDatabase(course3OfInstructor); + verifyPresentInDatabase(dataBundle.students.get("student1InCourse3")); + verifyPresentInDatabase(dataBundle.feedbackSessions.get("session1InCourse3")); // Ensure the course is currently in Recycle Bin assertTrue(course3OfInstructor.isCourseDeleted()); @@ -516,10 +516,10 @@ private void testRestoreCourseFromRecycleBin() throws InvalidParametersException coursesLogic.restoreCourseFromRecycleBin(course3OfInstructor.getId()); course3OfInstructor.deletedAt = null; - // Ensure the course and related entities still exist in datastore - verifyPresentInDatastore(course3OfInstructor); - verifyPresentInDatastore(dataBundle.students.get("student1InCourse3")); - verifyPresentInDatastore(dataBundle.feedbackSessions.get("session1InCourse3")); + // Ensure the course and related entities still exist in database + verifyPresentInDatabase(course3OfInstructor); + verifyPresentInDatabase(dataBundle.students.get("student1InCourse3")); + verifyPresentInDatabase(dataBundle.feedbackSessions.get("session1InCourse3")); // Ensure the course is restored from Recycle Bin assertFalse(course3OfInstructor.isCourseDeleted()); @@ -544,47 +544,47 @@ public void testDeleteCourseCascade() { CourseAttributes course1OfInstructor = dataBundle.courses.get("typicalCourse1"); StudentAttributes studentInCourse = dataBundle.students.get("student1InCourse1"); - // Ensure there are entities in the datastore under this course + // Ensure there are entities in the database under this course assertFalse(studentsLogic.getStudentsForCourse(course1OfInstructor.getId()).isEmpty()); - verifyPresentInDatastore(course1OfInstructor); - verifyPresentInDatastore(studentInCourse); - verifyPresentInDatastore(dataBundle.instructors.get("instructor1OfCourse1")); - verifyPresentInDatastore(dataBundle.instructors.get("instructor3OfCourse1")); - verifyPresentInDatastore(dataBundle.students.get("student1InCourse1")); - verifyPresentInDatastore(dataBundle.students.get("student5InCourse1")); - verifyPresentInDatastore(dataBundle.feedbackSessions.get("session1InCourse1")); - verifyPresentInDatastore(dataBundle.feedbackSessions.get("session2InCourse1")); - verifyPresentInDatastore(dataBundle.feedbackQuestions.get("qn1InSession1InCourse1")); + verifyPresentInDatabase(course1OfInstructor); + verifyPresentInDatabase(studentInCourse); + verifyPresentInDatabase(dataBundle.instructors.get("instructor1OfCourse1")); + verifyPresentInDatabase(dataBundle.instructors.get("instructor3OfCourse1")); + verifyPresentInDatabase(dataBundle.students.get("student1InCourse1")); + verifyPresentInDatabase(dataBundle.students.get("student5InCourse1")); + verifyPresentInDatabase(dataBundle.feedbackSessions.get("session1InCourse1")); + verifyPresentInDatabase(dataBundle.feedbackSessions.get("session2InCourse1")); + verifyPresentInDatabase(dataBundle.feedbackQuestions.get("qn1InSession1InCourse1")); FeedbackResponseAttributes typicalResponse = dataBundle.feedbackResponses.get("response1ForQ1S1C1"); FeedbackQuestionAttributes typicalQuestion = fqLogic.getFeedbackQuestion(typicalResponse.feedbackSessionName, typicalResponse.courseId, Integer.parseInt(typicalResponse.feedbackQuestionId)); typicalResponse = frLogic .getFeedbackResponse(typicalQuestion.getId(), typicalResponse.giver, typicalResponse.recipient); - verifyPresentInDatastore(typicalResponse); + verifyPresentInDatabase(typicalResponse); FeedbackResponseCommentAttributes typicalComment = dataBundle.feedbackResponseComments.get("comment1FromT1C1ToR1Q1S1C1"); typicalComment = frcLogic .getFeedbackResponseComment(typicalResponse.getId(), typicalComment.commentGiver, typicalComment.createdAt); - verifyPresentInDatastore(typicalComment); + verifyPresentInDatabase(typicalComment); coursesLogic.deleteCourseCascade(course1OfInstructor.getId()); // Ensure the course and related entities are deleted - verifyAbsentInDatastore(course1OfInstructor); - verifyAbsentInDatastore(studentInCourse); - verifyAbsentInDatastore(dataBundle.instructors.get("instructor1OfCourse1")); - verifyAbsentInDatastore(dataBundle.instructors.get("instructor3OfCourse1")); - verifyAbsentInDatastore(dataBundle.students.get("student1InCourse1")); - verifyAbsentInDatastore(dataBundle.students.get("student5InCourse1")); - verifyAbsentInDatastore(dataBundle.feedbackSessions.get("session1InCourse1")); - verifyAbsentInDatastore(dataBundle.feedbackSessions.get("session2InCourse1")); - verifyAbsentInDatastore(dataBundle.feedbackQuestions.get("qn1InSession1InCourse1")); - verifyAbsentInDatastore(typicalQuestion); - verifyAbsentInDatastore(typicalResponse); - verifyAbsentInDatastore(typicalComment); + verifyAbsentInDatabase(course1OfInstructor); + verifyAbsentInDatabase(studentInCourse); + verifyAbsentInDatabase(dataBundle.instructors.get("instructor1OfCourse1")); + verifyAbsentInDatabase(dataBundle.instructors.get("instructor3OfCourse1")); + verifyAbsentInDatabase(dataBundle.students.get("student1InCourse1")); + verifyAbsentInDatabase(dataBundle.students.get("student5InCourse1")); + verifyAbsentInDatabase(dataBundle.feedbackSessions.get("session1InCourse1")); + verifyAbsentInDatabase(dataBundle.feedbackSessions.get("session2InCourse1")); + verifyAbsentInDatabase(dataBundle.feedbackQuestions.get("qn1InSession1InCourse1")); + verifyAbsentInDatabase(typicalQuestion); + verifyAbsentInDatabase(typicalResponse); + verifyAbsentInDatabase(typicalComment); ______TS("null parameter"); @@ -610,7 +610,7 @@ private void testUpdateCourseCascade() throws Exception { ); c.setName(newName); c.setTimeZone(ZoneId.of(validTimeZone)); - verifyPresentInDatastore(c); + verifyPresentInDatabase(c); assertEquals(newName, updateCourse.getName()); assertEquals(validTimeZone, updateCourse.getTimeZone().getId()); @@ -628,7 +628,7 @@ private void testUpdateCourseCascade() throws Exception { FieldValidator.SIZE_CAPPED_NON_EMPTY_STRING_ERROR_MESSAGE_EMPTY_STRING, FieldValidator.COURSE_NAME_FIELD_NAME, FieldValidator.COURSE_NAME_MAX_LENGTH); assertEquals(expectedErrorMessage, ipe.getMessage()); - verifyPresentInDatastore(c); + verifyPresentInDatabase(c); } } diff --git a/src/test/java/teammates/logic/core/DataBundleLogicTest.java b/src/test/java/teammates/logic/core/DataBundleLogicTest.java index 983e28cf3da..19a27db3382 100644 --- a/src/test/java/teammates/logic/core/DataBundleLogicTest.java +++ b/src/test/java/teammates/logic/core/DataBundleLogicTest.java @@ -28,11 +28,11 @@ protected void prepareTestData() { public void testPersistDataBundle() throws Exception { ______TS("empty data bundle"); dataBundleLogic.persistDataBundle(dataBundle); - verifyPresentInDatastore(dataBundle); + verifyPresentInDatabase(dataBundle); ______TS("try to persist while entities exist"); dataBundleLogic.persistDataBundle(loadDataBundle("/FeedbackSessionResultsTest.json")); - verifyPresentInDatastore(loadDataBundle("/FeedbackSessionResultsTest.json")); + verifyPresentInDatabase(loadDataBundle("/FeedbackSessionResultsTest.json")); // Only FeedbackQuestions is tested because currently, it is the only data that has a value // updated only in the server. If there are more in the future, they should be added in this diff --git a/src/test/java/teammates/logic/core/FeedbackQuestionsLogicTest.java b/src/test/java/teammates/logic/core/FeedbackQuestionsLogicTest.java index f75f6ae3321..579b2c542f5 100644 --- a/src/test/java/teammates/logic/core/FeedbackQuestionsLogicTest.java +++ b/src/test/java/teammates/logic/core/FeedbackQuestionsLogicTest.java @@ -91,7 +91,7 @@ private void testGetRecipientsForQuestion() throws Exception { ______TS("response to students, total 5"); - question = getQuestionFromDatastore("qn2InSession1InCourse1"); + question = getQuestionFromDatabase("qn2InSession1InCourse1"); email = dataBundle.students.get("student1InCourse1").email; recipients = fqLogic.getRecipientsForQuestion(question, email); assertEquals(recipients.size(), 4); // 5 students minus giver himself @@ -102,21 +102,21 @@ private void testGetRecipientsForQuestion() throws Exception { ______TS("response to instructors, total 3"); - question = getQuestionFromDatastore("qn2InSession1InCourse2"); + question = getQuestionFromDatabase("qn2InSession1InCourse2"); email = dataBundle.instructors.get("instructor1OfCourse2").email; recipients = fqLogic.getRecipientsForQuestion(question, email); assertEquals(recipients.size(), 2); // 3 - giver = 2 ______TS("empty case: response to team members, but alone"); - question = getQuestionFromDatastore("team.members.feedback"); + question = getQuestionFromDatabase("team.members.feedback"); email = dataBundle.students.get("student5InCourse1").email; recipients = fqLogic.getRecipientsForQuestion(question, email); assertEquals(recipients.size(), 0); ______TS("response from team to itself"); - question = getQuestionFromDatastore("graceperiod.session.feedbackFromTeamToSelf"); + question = getQuestionFromDatabase("graceperiod.session.feedbackFromTeamToSelf"); email = dataBundle.students.get("student1InCourse1").email; String teamName = dataBundle.students.get("student1InCourse1").team; recipients = fqLogic.getRecipientsForQuestion(question, email); @@ -125,7 +125,7 @@ private void testGetRecipientsForQuestion() throws Exception { assertEquals(recipients.get(teamName), teamName); ______TS("special case: response to other team, instructor is also student"); - question = getQuestionFromDatastore("team.feedback"); + question = getQuestionFromDatabase("team.feedback"); email = dataBundle.students.get("student1InCourse1").email; accountsLogic.makeAccountInstructor(dataBundle.students.get("student1InCourse1").googleId); @@ -134,7 +134,7 @@ private void testGetRecipientsForQuestion() throws Exception { assertEquals(recipients.size(), 1); ______TS("to nobody (general feedback)"); - question = getQuestionFromDatastore("qn3InSession1InCourse1"); + question = getQuestionFromDatabase("qn3InSession1InCourse1"); email = dataBundle.students.get("student1InCourse1").email; accountsLogic.makeAccountInstructor(dataBundle.students.get("student1InCourse1").googleId); @@ -143,7 +143,7 @@ private void testGetRecipientsForQuestion() throws Exception { assertEquals(recipients.size(), 1); ______TS("to self"); - question = getQuestionFromDatastore("qn1InSession1InCourse1"); + question = getQuestionFromDatabase("qn1InSession1InCourse1"); email = dataBundle.students.get("student1InCourse1").email; accountsLogic.makeAccountInstructor(dataBundle.students.get("student1InCourse1").googleId); @@ -163,7 +163,7 @@ public void testGetRecipientsOfQuestion() throws Exception { ______TS("response to students, total 5"); - question = getQuestionFromDatastore("qn2InSession1InCourse1"); + question = getQuestionFromDatabase("qn2InSession1InCourse1"); studentGiver = dataBundle.students.get("student1InCourse1"); courseRoster = new CourseRoster( studentsLogic.getStudentsForCourse(studentGiver.getCourse()), @@ -186,7 +186,7 @@ public void testGetRecipientsOfQuestion() throws Exception { ______TS("response to instructors, total 3"); - question = getQuestionFromDatastore("qn2InSession1InCourse2"); + question = getQuestionFromDatabase("qn2InSession1InCourse2"); instructorGiver = dataBundle.instructors.get("instructor1OfCourse2"); courseRoster = new CourseRoster( studentsLogic.getStudentsForCourse(instructorGiver.courseId), @@ -199,7 +199,7 @@ public void testGetRecipientsOfQuestion() throws Exception { ______TS("empty case: response to team members, but alone"); - question = getQuestionFromDatastore("team.members.feedback"); + question = getQuestionFromDatabase("team.members.feedback"); studentGiver = dataBundle.students.get("student5InCourse1"); courseRoster = new CourseRoster( studentsLogic.getStudentsForCourse(studentGiver.getCourse()), @@ -212,7 +212,7 @@ public void testGetRecipientsOfQuestion() throws Exception { ______TS("response from team to itself"); - question = getQuestionFromDatastore("graceperiod.session.feedbackFromTeamToSelf"); + question = getQuestionFromDatabase("graceperiod.session.feedbackFromTeamToSelf"); studentGiver = dataBundle.students.get("student1InCourse1"); courseRoster = new CourseRoster( studentsLogic.getStudentsForCourse(studentGiver.getCourse()), @@ -228,7 +228,7 @@ public void testGetRecipientsOfQuestion() throws Exception { assertEquals(recipients.get(studentGiver.getTeam()), studentGiver.getTeam()); ______TS("response to other teams from instructor"); - question = getQuestionFromDatastore("team.instructor.feedback"); + question = getQuestionFromDatabase("team.instructor.feedback"); instructorGiver = dataBundle.instructors.get("instructor1OfCourse1"); courseRoster = new CourseRoster( studentsLogic.getStudentsForCourse(studentGiver.getCourse()), @@ -240,7 +240,7 @@ public void testGetRecipientsOfQuestion() throws Exception { assertEquals(recipients.size(), 2); ______TS("special case: response to other team, instructor is also student"); - question = getQuestionFromDatastore("team.feedback"); + question = getQuestionFromDatabase("team.feedback"); studentGiver = dataBundle.students.get("student1InCourse1"); accountsLogic.makeAccountInstructor(studentGiver.getGoogleId()); courseRoster = new CourseRoster( @@ -253,7 +253,7 @@ public void testGetRecipientsOfQuestion() throws Exception { assertEquals(recipients.size(), 1); ______TS("to nobody (general feedback)"); - question = getQuestionFromDatastore("qn3InSession1InCourse1"); + question = getQuestionFromDatabase("qn3InSession1InCourse1"); studentGiver = dataBundle.students.get("student1InCourse1"); accountsLogic.makeAccountInstructor(studentGiver.getGoogleId()); courseRoster = new CourseRoster( @@ -268,7 +268,7 @@ public void testGetRecipientsOfQuestion() throws Exception { assertEquals(recipients.size(), 1); ______TS("to self"); - question = getQuestionFromDatastore("qn1InSession1InCourse1"); + question = getQuestionFromDatabase("qn1InSession1InCourse1"); studentGiver = dataBundle.students.get("student1InCourse1"); accountsLogic.makeAccountInstructor(studentGiver.getGoogleId()); courseRoster = new CourseRoster( @@ -287,15 +287,15 @@ public void testGetRecipientsOfQuestion() throws Exception { public void testUpdateQuestionCascade_shouldShiftQuestionNumberCorrectly() throws Exception { ______TS("shift question up"); List expectedList = new ArrayList<>(); - FeedbackQuestionAttributes q1 = getQuestionFromDatastore("qn1InSession1InCourse1"); + FeedbackQuestionAttributes q1 = getQuestionFromDatabase("qn1InSession1InCourse1"); q1.questionNumber = 2; - FeedbackQuestionAttributes q2 = getQuestionFromDatastore("qn2InSession1InCourse1"); + FeedbackQuestionAttributes q2 = getQuestionFromDatabase("qn2InSession1InCourse1"); q2.questionNumber = 3; - FeedbackQuestionAttributes q3 = getQuestionFromDatastore("qn3InSession1InCourse1"); + FeedbackQuestionAttributes q3 = getQuestionFromDatabase("qn3InSession1InCourse1"); q3.questionNumber = 1; - FeedbackQuestionAttributes q4 = getQuestionFromDatastore("qn4InSession1InCourse1"); + FeedbackQuestionAttributes q4 = getQuestionFromDatabase("qn4InSession1InCourse1"); q4.questionNumber = 4; - FeedbackQuestionAttributes q5 = getQuestionFromDatastore("qn5InSession1InCourse1"); + FeedbackQuestionAttributes q5 = getQuestionFromDatabase("qn5InSession1InCourse1"); q5.questionNumber = 5; expectedList.add(q3); @@ -304,7 +304,7 @@ public void testUpdateQuestionCascade_shouldShiftQuestionNumberCorrectly() throw expectedList.add(q4); expectedList.add(q5); - FeedbackQuestionAttributes questionToUpdate = getQuestionFromDatastore("qn3InSession1InCourse1"); + FeedbackQuestionAttributes questionToUpdate = getQuestionFromDatabase("qn3InSession1InCourse1"); questionToUpdate.questionNumber = 1; fqLogic.updateFeedbackQuestionCascade( FeedbackQuestionAttributes.updateOptionsBuilder(questionToUpdate.getId()) @@ -321,15 +321,15 @@ public void testUpdateQuestionCascade_shouldShiftQuestionNumberCorrectly() throw ______TS("shift question down"); expectedList = new ArrayList<>(); - q1 = getQuestionFromDatastore("qn1InSession1InCourse1"); + q1 = getQuestionFromDatabase("qn1InSession1InCourse1"); q1.questionNumber = 1; - q2 = getQuestionFromDatastore("qn2InSession1InCourse1"); + q2 = getQuestionFromDatabase("qn2InSession1InCourse1"); q2.questionNumber = 2; - q3 = getQuestionFromDatastore("qn3InSession1InCourse1"); + q3 = getQuestionFromDatabase("qn3InSession1InCourse1"); q3.questionNumber = 3; - q4 = getQuestionFromDatastore("qn4InSession1InCourse1"); + q4 = getQuestionFromDatabase("qn4InSession1InCourse1"); q4.questionNumber = 4; - q5 = getQuestionFromDatastore("qn5InSession1InCourse1"); + q5 = getQuestionFromDatabase("qn5InSession1InCourse1"); q5.questionNumber = 5; expectedList.add(q1); @@ -338,7 +338,7 @@ public void testUpdateQuestionCascade_shouldShiftQuestionNumberCorrectly() throw expectedList.add(q4); expectedList.add(q5); - questionToUpdate = getQuestionFromDatastore("qn3InSession1InCourse1"); + questionToUpdate = getQuestionFromDatabase("qn3InSession1InCourse1"); questionToUpdate.questionNumber = 3; fqLogic.updateFeedbackQuestionCascade( FeedbackQuestionAttributes.updateOptionsBuilder(questionToUpdate.getId()) @@ -353,7 +353,7 @@ public void testUpdateQuestionCascade_shouldShiftQuestionNumberCorrectly() throw } ______TS("try to shift question up, invalid attributes, questions order remains"); - questionToUpdate = getQuestionFromDatastore("qn3InSession1InCourse1"); + questionToUpdate = getQuestionFromDatabase("qn3InSession1InCourse1"); questionToUpdate.questionNumber = 1; String questionId = questionToUpdate.getId(); assertThrows(InvalidParametersException.class, () -> { @@ -377,17 +377,17 @@ private void testAddQuestion() throws Exception { ______TS("Add questions sequentially"); List expectedList = new ArrayList<>(); - FeedbackQuestionAttributes q1 = getQuestionFromDatastore("qn1InSession1InCourse1"); + FeedbackQuestionAttributes q1 = getQuestionFromDatabase("qn1InSession1InCourse1"); q1.questionNumber = 1; - FeedbackQuestionAttributes q2 = getQuestionFromDatastore("qn2InSession1InCourse1"); + FeedbackQuestionAttributes q2 = getQuestionFromDatabase("qn2InSession1InCourse1"); q2.questionNumber = 2; - FeedbackQuestionAttributes q3 = getQuestionFromDatastore("qn3InSession1InCourse1"); + FeedbackQuestionAttributes q3 = getQuestionFromDatabase("qn3InSession1InCourse1"); q3.questionNumber = 3; - FeedbackQuestionAttributes q4 = getQuestionFromDatastore("qn4InSession1InCourse1"); + FeedbackQuestionAttributes q4 = getQuestionFromDatabase("qn4InSession1InCourse1"); q4.questionNumber = 4; - FeedbackQuestionAttributes q5 = getQuestionFromDatastore("qn5InSession1InCourse1"); + FeedbackQuestionAttributes q5 = getQuestionFromDatabase("qn5InSession1InCourse1"); q5.questionNumber = 5; - FeedbackQuestionAttributes q6 = getQuestionFromDatastore("qn1InSession1InCourse1"); + FeedbackQuestionAttributes q6 = getQuestionFromDatabase("qn1InSession1InCourse1"); q6.questionNumber = 6; expectedList.add(q1); @@ -398,7 +398,7 @@ private void testAddQuestion() throws Exception { expectedList.add(q6); //Appends a question to the back of the current question list - FeedbackQuestionAttributes newQuestion = getQuestionFromDatastore("qn1InSession1InCourse1"); + FeedbackQuestionAttributes newQuestion = getQuestionFromDatabase("qn1InSession1InCourse1"); newQuestion.questionNumber = 6; newQuestion.setId(null); //new question should not have an ID. fqLogic.createFeedbackQuestion(newQuestion); @@ -413,7 +413,7 @@ private void testAddQuestion() throws Exception { ______TS("add new question to the front of the list"); - FeedbackQuestionAttributes q7 = getQuestionFromDatastore("qn4InSession1InCourse1"); + FeedbackQuestionAttributes q7 = getQuestionFromDatabase("qn4InSession1InCourse1"); q7.questionNumber = 1; q1.questionNumber = 2; @@ -426,7 +426,7 @@ private void testAddQuestion() throws Exception { expectedList.add(0, q7); //Add a question to session1course1 and sets its number to 1 - newQuestion = getQuestionFromDatastore("qn4InSession1InCourse1"); + newQuestion = getQuestionFromDatabase("qn4InSession1InCourse1"); newQuestion.questionNumber = 1; newQuestion.setId(null); //new question should not have an ID. fqLogic.createFeedbackQuestion(newQuestion); @@ -440,7 +440,7 @@ private void testAddQuestion() throws Exception { ______TS("add new question inbetween 2 existing questions"); - FeedbackQuestionAttributes q8 = getQuestionFromDatastore("qn4InSession1InCourse1"); + FeedbackQuestionAttributes q8 = getQuestionFromDatabase("qn4InSession1InCourse1"); q8.questionNumber = 3; q2.questionNumber = 4; q3.questionNumber = 5; @@ -451,7 +451,7 @@ private void testAddQuestion() throws Exception { expectedList.add(2, q8); //Add a question to session1course1 and place it between existing question 2 and 3 - newQuestion = getQuestionFromDatastore("qn4InSession1InCourse1"); + newQuestion = getQuestionFromDatabase("qn4InSession1InCourse1"); newQuestion.questionNumber = 3; newQuestion.setId(null); //new question should not have an ID. fqLogic.createFeedbackQuestion(newQuestion); @@ -467,7 +467,7 @@ private void testAddQuestion() throws Exception { @Test public void testUpdateQuestionCascade() throws Exception { ______TS("standard update, no existing responses"); - FeedbackQuestionAttributes questionToUpdate = getQuestionFromDatastore("qn2InSession1InCourse2"); + FeedbackQuestionAttributes questionToUpdate = getQuestionFromDatabase("qn2InSession1InCourse2"); FeedbackQuestionDetails fqd = new FeedbackTextQuestionDetails("new question text"); questionToUpdate.setQuestionDetails(fqd); @@ -489,7 +489,7 @@ public void testUpdateQuestionCascade() throws Exception { assertEquals(questionToUpdate.toString(), updatedQuestion.toString()); ______TS("cascading update, non-destructive changes, existing responses are preserved"); - questionToUpdate = getQuestionFromDatastore("qn2InSession1InCourse1"); + questionToUpdate = getQuestionFromDatabase("qn2InSession1InCourse1"); fqd = new FeedbackTextQuestionDetails("new question text 2"); questionToUpdate.setQuestionDetails(fqd); questionToUpdate.numberOfEntitiesToGiveFeedbackTo = 2; @@ -511,7 +511,7 @@ public void testUpdateQuestionCascade() throws Exception { questionToUpdate.getId()).size(), numberOfResponses); ______TS("cascading update, destructive changes, delete all existing responses"); - questionToUpdate = getQuestionFromDatastore("qn2InSession1InCourse1"); + questionToUpdate = getQuestionFromDatabase("qn2InSession1InCourse1"); fqd = new FeedbackTextQuestionDetails("new question text 3"); questionToUpdate.setQuestionDetails(fqd); questionToUpdate.recipientType = FeedbackParticipantType.INSTRUCTORS; @@ -531,7 +531,7 @@ public void testUpdateQuestionCascade() throws Exception { ______TS("failure: question does not exist"); - questionToUpdate = getQuestionFromDatastore("qn3InSession1InCourse1"); + questionToUpdate = getQuestionFromDatabase("qn3InSession1InCourse1"); FeedbackQuestionAttributes[] finalFq = new FeedbackQuestionAttributes[] { questionToUpdate }; fqLogic.deleteFeedbackQuestionCascade(questionToUpdate.getId()); @@ -544,7 +544,7 @@ public void testUpdateQuestionCascade() throws Exception { ______TS("failure: invalid parameters"); - questionToUpdate = getQuestionFromDatastore("qn3InSession1InCourse1"); + questionToUpdate = getQuestionFromDatabase("qn3InSession1InCourse1"); questionToUpdate.giverType = FeedbackParticipantType.TEAMS; questionToUpdate.recipientType = FeedbackParticipantType.OWN_TEAM_MEMBERS; finalFq[0] = questionToUpdate; @@ -563,9 +563,9 @@ public void testUpdateQuestionCascade() throws Exception { @Test public void testDeleteFeedbackQuestionCascade_existentQuestion_shouldDoCascadeDeletion() { - FeedbackQuestionAttributes typicalQuestion = getQuestionFromDatastore("qn3InSession1InCourse1"); + FeedbackQuestionAttributes typicalQuestion = getQuestionFromDatabase("qn3InSession1InCourse1"); assertEquals(3, typicalQuestion.getQuestionNumber()); - assertEquals(4, getQuestionFromDatastore("qn4InSession1InCourse1").getQuestionNumber()); + assertEquals(4, getQuestionFromDatabase("qn4InSession1InCourse1").getQuestionNumber()); // the question has some responses and comments assertFalse(frLogic.getFeedbackResponsesForQuestion(typicalQuestion.getId()).isEmpty()); @@ -598,7 +598,7 @@ public void testDeleteFeedbackQuestionCascade_nonExistentQuestion_shouldFailSile fqLogic.deleteFeedbackQuestionCascade("non-existent-question-id"); // other questions not get affected - assertNotNull(getQuestionFromDatastore("qn3InSession1InCourse1")); + assertNotNull(getQuestionFromDatabase("qn3InSession1InCourse1")); } @Test @@ -628,7 +628,7 @@ public void testDeleteFeedbackQuestionCascade_cascadeDeleteResponseOfStudent_sho @Test public void testDeleteFeedbackQuestions_byCourseId_shouldDeleteQuestions() { String courseId = "idOfTypicalCourse2"; - FeedbackQuestionAttributes deletedQuestion = getQuestionFromDatastore("qn1InSession1InCourse2"); + FeedbackQuestionAttributes deletedQuestion = getQuestionFromDatabase("qn1InSession1InCourse2"); assertNotNull(deletedQuestion); List questions = @@ -638,15 +638,15 @@ public void testDeleteFeedbackQuestions_byCourseId_shouldDeleteQuestions() { fqLogic.deleteFeedbackQuestions(AttributesDeletionQuery.builder() .withCourseId(courseId) .build()); - deletedQuestion = getQuestionFromDatastore("qn1InSession1InCourse2"); + deletedQuestion = getQuestionFromDatabase("qn1InSession1InCourse2"); assertNull(deletedQuestion); questions = fqLogic.getFeedbackQuestionsForSession("Instructor feedback session", courseId); assertEquals(0, questions.size()); // test that questions in other courses are unaffected - assertNotNull(getQuestionFromDatastore("qn1InSessionInArchivedCourse")); - assertNotNull(getQuestionFromDatastore("qn1InSession4InCourse1")); + assertNotNull(getQuestionFromDatabase("qn1InSessionInArchivedCourse")); + assertNotNull(getQuestionFromDatabase("qn1InSession4InCourse1")); } @Test @@ -872,7 +872,7 @@ public void testBuildCompleteGiverRecipientMap_studentQuestion_shouldBuildMapCor CourseRoster courseRoster = new CourseRoster( studentsLogic.getStudentsForCourse("idOfTypicalCourse1"), instructorsLogic.getInstructorsForCourse("idOfTypicalCourse1")); - FeedbackQuestionAttributes qn1InSession1InCourse1 = getQuestionFromDatastore("qn1InSession1InCourse1"); + FeedbackQuestionAttributes qn1InSession1InCourse1 = getQuestionFromDatabase("qn1InSession1InCourse1"); FeedbackSessionAttributes session1 = fsLogic.getFeedbackSession( qn1InSession1InCourse1.getFeedbackSessionName(), qn1InSession1InCourse1.getCourseId()); @@ -897,7 +897,7 @@ public void testBuildCompleteGiverRecipientMap_instructorQuestion_shouldBuildMap CourseRoster courseRoster = new CourseRoster( studentsLogic.getStudentsForCourse("idOfTypicalCourse1"), instructorsLogic.getInstructorsForCourse("idOfTypicalCourse1")); - FeedbackQuestionAttributes qn4InSession1InCourse1 = getQuestionFromDatastore("qn4InSession1InCourse1"); + FeedbackQuestionAttributes qn4InSession1InCourse1 = getQuestionFromDatabase("qn4InSession1InCourse1"); FeedbackSessionAttributes session1 = fsLogic.getFeedbackSession( qn4InSession1InCourse1.getFeedbackSessionName(), qn4InSession1InCourse1.getCourseId()); @@ -923,7 +923,7 @@ public void testBuildCompleteGiverRecipientMap_selfQuestion_shouldBuildMapCorrec CourseRoster courseRoster = new CourseRoster( studentsLogic.getStudentsForCourse("idOfTypicalCourse1"), instructorsLogic.getInstructorsForCourse("idOfTypicalCourse1")); - FeedbackQuestionAttributes qn3InSession1InCourse1 = getQuestionFromDatastore("qn3InSession1InCourse1"); + FeedbackQuestionAttributes qn3InSession1InCourse1 = getQuestionFromDatabase("qn3InSession1InCourse1"); FeedbackSessionAttributes session1 = fsLogic.getFeedbackSession( qn3InSession1InCourse1.getFeedbackSessionName(), qn3InSession1InCourse1.getCourseId()); @@ -940,7 +940,7 @@ public void testBuildCompleteGiverRecipientMap_teamQuestion_shouldBuildMapCorrec CourseRoster courseRoster = new CourseRoster( studentsLogic.getStudentsForCourse("idOfTypicalCourse1"), instructorsLogic.getInstructorsForCourse("idOfTypicalCourse1")); - FeedbackQuestionAttributes teamFeedbackQuestion = getQuestionFromDatastore("team.feedback"); + FeedbackQuestionAttributes teamFeedbackQuestion = getQuestionFromDatabase("team.feedback"); FeedbackSessionAttributes session2 = fsLogic.getFeedbackSession( teamFeedbackQuestion.getFeedbackSessionName(), teamFeedbackQuestion.getCourseId()); @@ -962,9 +962,9 @@ private void testGetFeedbackQuestionsForInstructor() throws Exception { ______TS("Get questions created for instructors and self"); expectedQuestions = new ArrayList<>(); - expectedQuestions.add(getQuestionFromDatastore("qn3InSession1InCourse1")); - expectedQuestions.add(getQuestionFromDatastore("qn4InSession1InCourse1")); - expectedQuestions.add(getQuestionFromDatastore("qn5InSession1InCourse1")); + expectedQuestions.add(getQuestionFromDatabase("qn3InSession1InCourse1")); + expectedQuestions.add(getQuestionFromDatabase("qn4InSession1InCourse1")); + expectedQuestions.add(getQuestionFromDatabase("qn5InSession1InCourse1")); actualQuestions = fqLogic.getFeedbackQuestionsForInstructor("First feedback session", "idOfTypicalCourse1", "instructor1@course1.tmt"); @@ -974,7 +974,7 @@ private void testGetFeedbackQuestionsForInstructor() throws Exception { ______TS("Get questions created for instructors and self by another instructor"); expectedQuestions = new ArrayList<>(); - expectedQuestions.add(getQuestionFromDatastore("qn4InSession1InCourse1")); + expectedQuestions.add(getQuestionFromDatabase("qn4InSession1InCourse1")); actualQuestions = fqLogic.getFeedbackQuestionsForInstructor("First feedback session", "idOfTypicalCourse1", "instructor2@course1.tmt"); @@ -984,8 +984,8 @@ private void testGetFeedbackQuestionsForInstructor() throws Exception { ______TS("Get questions created for instructors by the creating instructor"); expectedQuestions = new ArrayList<>(); - expectedQuestions.add(getQuestionFromDatastore("qn1InSession1InCourse2")); - expectedQuestions.add(getQuestionFromDatastore("qn2InSession1InCourse2")); + expectedQuestions.add(getQuestionFromDatabase("qn1InSession1InCourse2")); + expectedQuestions.add(getQuestionFromDatabase("qn2InSession1InCourse2")); actualQuestions = fqLogic.getFeedbackQuestionsForInstructor("Instructor feedback session", "idOfTypicalCourse2", @@ -1027,12 +1027,12 @@ private void testGetFeedbackQuestionsForInstructor() throws Exception { ______TS("Get questions created for self from list of all questions"); allQuestions = new ArrayList<>(); - allQuestions.add(getQuestionFromDatastore("qn1InSession1InCourse1")); - allQuestions.add(getQuestionFromDatastore("qn2InSession1InCourse1")); - allQuestions.add(getQuestionFromDatastore("qn3InSession1InCourse1")); + allQuestions.add(getQuestionFromDatabase("qn1InSession1InCourse1")); + allQuestions.add(getQuestionFromDatabase("qn2InSession1InCourse1")); + allQuestions.add(getQuestionFromDatabase("qn3InSession1InCourse1")); expectedQuestions = new ArrayList<>(); - expectedQuestions.add(getQuestionFromDatastore("qn3InSession1InCourse1")); + expectedQuestions.add(getQuestionFromDatabase("qn3InSession1InCourse1")); actualQuestions = fqLogic.getFeedbackQuestionsForInstructor(allQuestions, true); @@ -1047,8 +1047,8 @@ private void testGetFeedbackQuestionsForStudents() { ______TS("Get questions created for students"); expectedQuestions = new ArrayList<>(); - expectedQuestions.add(getQuestionFromDatastore("qn1InSession1InCourse1")); - expectedQuestions.add(getQuestionFromDatastore("qn2InSession1InCourse1")); + expectedQuestions.add(getQuestionFromDatabase("qn1InSession1InCourse1")); + expectedQuestions.add(getQuestionFromDatabase("qn2InSession1InCourse1")); actualQuestions = fqLogic.getFeedbackQuestionsForStudents("First feedback session", "idOfTypicalCourse1"); @@ -1057,8 +1057,8 @@ private void testGetFeedbackQuestionsForStudents() { ______TS("Get questions created for students and teams"); expectedQuestions = new ArrayList<>(); - expectedQuestions.add(getQuestionFromDatastore("team.feedback")); - expectedQuestions.add(getQuestionFromDatastore("team.members.feedback")); + expectedQuestions.add(getQuestionFromDatabase("team.feedback")); + expectedQuestions.add(getQuestionFromDatabase("team.members.feedback")); actualQuestions = fqLogic.getFeedbackQuestionsForStudents("Second feedback session", "idOfTypicalCourse1"); @@ -1067,13 +1067,13 @@ private void testGetFeedbackQuestionsForStudents() { ______TS("Get questions created for students from list of all questions"); allQuestions = new ArrayList<>(); - allQuestions.add(getQuestionFromDatastore("qn1InSession1InCourse1")); - allQuestions.add(getQuestionFromDatastore("qn2InSession1InCourse1")); - allQuestions.add(getQuestionFromDatastore("qn3InSession1InCourse1")); + allQuestions.add(getQuestionFromDatabase("qn1InSession1InCourse1")); + allQuestions.add(getQuestionFromDatabase("qn2InSession1InCourse1")); + allQuestions.add(getQuestionFromDatabase("qn3InSession1InCourse1")); expectedQuestions = new ArrayList<>(); - expectedQuestions.add(getQuestionFromDatastore("qn1InSession1InCourse1")); - expectedQuestions.add(getQuestionFromDatastore("qn2InSession1InCourse1")); + expectedQuestions.add(getQuestionFromDatabase("qn1InSession1InCourse1")); + expectedQuestions.add(getQuestionFromDatabase("qn2InSession1InCourse1")); actualQuestions = fqLogic.getFeedbackQuestionsForStudents(allQuestions); @@ -1082,12 +1082,12 @@ private void testGetFeedbackQuestionsForStudents() { ______TS("Get questions created for students and teams from list of all questions"); allQuestions = new ArrayList<>(); - allQuestions.add(getQuestionFromDatastore("team.feedback")); - allQuestions.add(getQuestionFromDatastore("team.members.feedback")); + allQuestions.add(getQuestionFromDatabase("team.feedback")); + allQuestions.add(getQuestionFromDatabase("team.members.feedback")); expectedQuestions = new ArrayList<>(); - expectedQuestions.add(getQuestionFromDatastore("team.feedback")); - expectedQuestions.add(getQuestionFromDatastore("team.members.feedback")); + expectedQuestions.add(getQuestionFromDatabase("team.feedback")); + expectedQuestions.add(getQuestionFromDatabase("team.members.feedback")); actualQuestions = fqLogic.getFeedbackQuestionsForStudents(allQuestions); @@ -1099,13 +1099,13 @@ private void testIsQuestionAnswered() throws Exception { ______TS("test question is fully answered by user"); - question = getQuestionFromDatastore("qn1InSession1InCourse1"); + question = getQuestionFromDatabase("qn1InSession1InCourse1"); assertTrue(fqLogic.isQuestionFullyAnsweredByUser(question, "student1InCourse1@gmail.tmt")); assertFalse(fqLogic.isQuestionFullyAnsweredByUser(question, "studentWithNoResponses@gmail.tmt")); } - private FeedbackQuestionAttributes getQuestionFromDatastore(String questionKey) { + private FeedbackQuestionAttributes getQuestionFromDatabase(String questionKey) { FeedbackQuestionAttributes question = dataBundle.feedbackQuestions.get(questionKey); question = fqLogic.getFeedbackQuestion( question.feedbackSessionName, question.courseId, question.questionNumber); diff --git a/src/test/java/teammates/logic/core/FeedbackResponseCommentsLogicTest.java b/src/test/java/teammates/logic/core/FeedbackResponseCommentsLogicTest.java index d3112d16502..5621975e1d5 100644 --- a/src/test/java/teammates/logic/core/FeedbackResponseCommentsLogicTest.java +++ b/src/test/java/teammates/logic/core/FeedbackResponseCommentsLogicTest.java @@ -80,7 +80,7 @@ public void testCreateFeedbackResponseComment() throws Exception { frComment.feedbackResponseId = getResponseIdInDataBundle("response2ForQ1S1C1", "qn1InSession1InCourse1"); frcLogic.createFeedbackResponseComment(frComment); - verifyPresentInDatastore(frComment); + verifyPresentInDatabase(frComment); } @Test @@ -201,7 +201,7 @@ public void testUpdateFeedbackResponseComment() throws Exception { .build() ); assertEquals(frComment.commentText, updatedComment.commentText); - verifyPresentInDatastore(frComment); + verifyPresentInDatabase(frComment); List actualFrComments = frcLogic.getFeedbackResponseCommentForSessionInSection( frComment.courseId, frComment.feedbackSessionName, null); @@ -247,9 +247,9 @@ public void testDeleteFeedbackResponseComment() throws Exception { ______TS("typical success case"); - verifyPresentInDatastore(actualFrComment); + verifyPresentInDatabase(actualFrComment); frcLogic.deleteFeedbackResponseComment(actualFrComment.getId()); - verifyAbsentInDatastore(actualFrComment); + verifyAbsentInDatabase(actualFrComment); } @Test @@ -258,12 +258,12 @@ public void testDeleteFeedbackResponseComments_deleteByResponseId() { ______TS("typical success case"); FeedbackResponseCommentAttributes frComment = restoreFrCommentFromDataBundle("comment1FromT1C1ToR1Q3S1C1"); - verifyPresentInDatastore(frComment); + verifyPresentInDatabase(frComment); frcLogic.deleteFeedbackResponseComments( AttributesDeletionQuery.builder() .withResponseId(frComment.feedbackResponseId) .build()); - verifyAbsentInDatastore(frComment); + verifyAbsentInDatabase(frComment); } @Test diff --git a/src/test/java/teammates/logic/core/FeedbackResponsesLogicTest.java b/src/test/java/teammates/logic/core/FeedbackResponsesLogicTest.java index e1363e8fa12..73375cace45 100644 --- a/src/test/java/teammates/logic/core/FeedbackResponsesLogicTest.java +++ b/src/test/java/teammates/logic/core/FeedbackResponsesLogicTest.java @@ -63,12 +63,12 @@ public void testAreThereResponsesForQuestion() { ______TS("Check that a question has some responses"); - questionWithResponse = getQuestionFromDatastore("qn1InSession1InCourse2"); + questionWithResponse = getQuestionFromDatabase("qn1InSession1InCourse2"); assertTrue(frLogic.areThereResponsesForQuestion(questionWithResponse.getId())); ______TS("Check that a question has no responses"); - questionWithoutResponse = getQuestionFromDatastore("qn2InSession1InCourse2"); + questionWithoutResponse = getQuestionFromDatabase("qn2InSession1InCourse2"); assertFalse(frLogic.areThereResponsesForQuestion(questionWithoutResponse.getId())); } @@ -77,7 +77,7 @@ public void testUpdateFeedbackResponseCascade() throws Exception { ______TS("success: standard update"); - FeedbackResponseAttributes responseToUpdate = getResponseFromDatastore("response1ForQ2S1C1"); + FeedbackResponseAttributes responseToUpdate = getResponseFromDatabase("response1ForQ2S1C1"); FeedbackResponseDetails frd = new FeedbackTextResponseDetails("Updated Response"); @@ -86,14 +86,14 @@ public void testUpdateFeedbackResponseCascade() throws Exception { .withResponseDetails(frd) .build()); - responseToUpdate = getResponseFromDatastore("response1ForQ2S1C1"); + responseToUpdate = getResponseFromDatabase("response1ForQ2S1C1"); assertEquals(responseToUpdate.toString(), frLogic.getFeedbackResponse(responseToUpdate.getId()).toString()); ______TS("failure: recipient one that is already exists"); - responseToUpdate = getResponseFromDatastore("response1ForQ2S1C1"); + responseToUpdate = getResponseFromDatabase("response1ForQ2S1C1"); FeedbackResponseAttributes existingResponse = FeedbackResponseAttributes.builder( @@ -132,7 +132,7 @@ public void testUpdateFeedbackResponseCascade() throws Exception { ______TS("success: both giver and recipient changed (teammate changed response)"); - responseToUpdate = getResponseFromDatastore("response1GracePeriodFeedback"); + responseToUpdate = getResponseFromDatabase("response1GracePeriodFeedback"); responseToUpdate.giver = "student5InCourse1@gmail.tmt"; responseToUpdate.recipient = "Team 1.1"; @@ -154,7 +154,7 @@ public void testUpdateFeedbackResponseCascade() throws Exception { ______TS("success: update giver, recipient, giverSection and recipientSection, " + "should do cascade update to comments"); - responseToUpdate = getResponseFromDatastore("response1ForQ1S1C1"); + responseToUpdate = getResponseFromDatabase("response1ForQ1S1C1"); assertFalse(frcLogic.getFeedbackResponseCommentForResponse(responseToUpdate.getId()).isEmpty()); FeedbackResponseAttributes updatedResponse = frLogic.updateFeedbackResponseCascade( @@ -197,14 +197,14 @@ public void testUpdateFeedbackResponsesForChangingTeam_typicalData_shouldDoCasca // Student 4 has 1 responses to him from team members, // 1 response from him a team member, and // 1 team response from him to another team. - FeedbackQuestionAttributes teamQuestion = getQuestionFromDatastore("team.members.feedback"); + FeedbackQuestionAttributes teamQuestion = getQuestionFromDatabase("team.members.feedback"); assertEquals(1, getFeedbackResponsesForReceiverForQuestion( teamQuestion.getId(), studentToUpdate.email).size()); assertEquals(1, frLogic.getFeedbackResponsesFromGiverForQuestion( teamQuestion.getId(), studentToUpdate.email).size()); - teamQuestion = getQuestionFromDatastore("team.feedback"); + teamQuestion = getQuestionFromDatabase("team.feedback"); assertEquals(1, frLogic.getFeedbackResponsesFromGiverForQuestion( teamQuestion.getId(), studentToUpdate.email).size()); @@ -212,7 +212,7 @@ public void testUpdateFeedbackResponsesForChangingTeam_typicalData_shouldDoCasca // Add one more non-team response FeedbackResponseAttributes responseToAdd = FeedbackResponseAttributes.builder( - getQuestionFromDatastore("qn1InSession1InCourse1").getId(), + getQuestionFromDatabase("qn1InSession1InCourse1").getId(), studentToUpdate.email, studentToUpdate.email) .withFeedbackSessionName("First feedback session") .withCourseId("idOfTypicalCourse1") @@ -228,14 +228,14 @@ public void testUpdateFeedbackResponsesForChangingTeam_typicalData_shouldDoCasca frLogic.updateFeedbackResponsesForChangingTeam( studentToUpdate.course, studentToUpdate.email, studentToUpdate.team, "Team 1.2"); - teamQuestion = getQuestionFromDatastore("team.members.feedback"); + teamQuestion = getQuestionFromDatabase("team.members.feedback"); assertEquals(0, getFeedbackResponsesForReceiverForQuestion( teamQuestion.getId(), studentToUpdate.email).size()); assertEquals(0, frLogic.getFeedbackResponsesFromGiverForQuestion( teamQuestion.getId(), studentToUpdate.email).size()); - teamQuestion = getQuestionFromDatastore("team.feedback"); + teamQuestion = getQuestionFromDatabase("team.feedback"); assertEquals(0, getFeedbackResponsesForReceiverForQuestion( teamQuestion.getId(), studentToUpdate.email).size()); @@ -243,7 +243,7 @@ public void testUpdateFeedbackResponsesForChangingTeam_typicalData_shouldDoCasca assertEquals(1, frLogic.getFeedbackResponsesFromGiverForQuestion( - getQuestionFromDatastore("qn1InSession1InCourse1").getId(), + getQuestionFromDatabase("qn1InSession1InCourse1").getId(), studentToUpdate.email).size()); } @@ -262,7 +262,7 @@ private List getFeedbackResponsesForReceiverForQuest public void testUpdateFeedbackResponsesForChangingTeam_deleteLastResponse_decreaseResponseRate() throws Exception { FeedbackResponseAttributes responseShouldBeDeleted = - getResponseFromDatastore(questionTypeBundle, "response1ForQ1ContribSession2Course2"); + getResponseFromDatabase(questionTypeBundle, "response1ForQ1ContribSession2Course2"); // make sure it's the last response by the student assertEquals(1, numResponsesFromGiverInSession(responseShouldBeDeleted.giver, responseShouldBeDeleted.feedbackSessionName, @@ -286,7 +286,7 @@ public void testUpdateFeedbackResponsesForChangingTeam_deleteLastResponse_decrea public void testUpdateFeedbackResponsesForChangingTeam_noResponseShouldBeDeleted_shouldReaminSameResponseRate() throws Exception { FeedbackResponseAttributes responseShouldBeDeleted = - getResponseFromDatastore(questionTypeBundle, "response1ForQ1RankSession"); + getResponseFromDatabase(questionTypeBundle, "response1ForQ1RankSession"); // make sure it's not the last response by the student assertTrue(1 < numResponsesFromGiverInSession(responseShouldBeDeleted.giver, responseShouldBeDeleted.feedbackSessionName, @@ -318,8 +318,8 @@ private int numResponsesFromGiverInSession(String studentEmail, String sessionNa } private int getResponseRate(String sessionName, String courseId) { - FeedbackSessionAttributes sessionFromDataStore = fsLogic.getFeedbackSession(sessionName, courseId); - return fsLogic.getActualTotalSubmission(sessionFromDataStore); + FeedbackSessionAttributes sessionFromDatabase = fsLogic.getFeedbackSession(sessionName, courseId); + return fsLogic.getActualTotalSubmission(sessionFromDatabase); } @Test @@ -342,7 +342,7 @@ public void testUpdateFeedbackResponsesForChangingEmail() throws Exception { responseIdsToAndFromStudent.addAll( responsesFromGiver.stream().map(FeedbackResponseAttributes::getId).collect(Collectors.toList())); List responseCommentsForStudent = - getFeedbackResponseCommentsForResponsesFromDatastore(responseIdsToAndFromStudent); + getFeedbackResponseCommentsForResponsesFromDatabase(responseIdsToAndFromStudent); assertEquals(11, responsesForReceiver.size()); assertEquals(8, responsesFromGiver.size()); @@ -365,7 +365,7 @@ public void testUpdateFeedbackResponsesForChangingEmail() throws Exception { responseIdsToAndFromStudent.addAll( responsesFromGiver.stream().map(FeedbackResponseAttributes::getId).collect(Collectors.toList())); responseCommentsForStudent = - getFeedbackResponseCommentsForResponsesFromDatastore(responseIdsToAndFromStudent); + getFeedbackResponseCommentsForResponsesFromDatabase(responseIdsToAndFromStudent); assertEquals(0, responsesForReceiver.size()); assertEquals(0, responsesFromGiver.size()); @@ -381,7 +381,7 @@ public void testUpdateFeedbackResponsesForChangingEmail() throws Exception { responseIdsToAndFromStudent.addAll( responsesFromGiver.stream().map(FeedbackResponseAttributes::getId).collect(Collectors.toList())); responseCommentsForStudent = - getFeedbackResponseCommentsForResponsesFromDatastore(responseIdsToAndFromStudent); + getFeedbackResponseCommentsForResponsesFromDatabase(responseIdsToAndFromStudent); assertEquals(11, responsesForReceiver.size()); assertEquals(8, responsesFromGiver.size()); @@ -399,8 +399,8 @@ public void testIsNameVisibleTo() { StudentAttributes student3 = dataBundle.students.get("student3InCourse1"); StudentAttributes student5 = dataBundle.students.get("student5InCourse1"); - FeedbackQuestionAttributes fq = getQuestionFromDatastore("qn3InSession1InCourse1"); - FeedbackResponseAttributes fr = getResponseFromDatastore("response1ForQ3S1C1"); + FeedbackQuestionAttributes fq = getQuestionFromDatabase("qn3InSession1InCourse1"); + FeedbackResponseAttributes fr = getResponseFromDatabase("response1ForQ3S1C1"); CourseRoster roster = new CourseRoster( studentsLogic.getStudentsForCourse(fq.courseId), @@ -534,7 +534,7 @@ public void testDeleteFeedbackResponseCascade() { ______TS("standard delete"); - FeedbackResponseAttributes fra = getResponseFromDatastore("response1ForQ1S1C1"); + FeedbackResponseAttributes fra = getResponseFromDatabase("response1ForQ1S1C1"); assertNotNull(fra); // the response has comments assertFalse(frcLogic.getFeedbackResponseCommentForResponse(fra.getId()).isEmpty()); @@ -572,7 +572,7 @@ public void testDeleteFeedbackResponses_byCourseId() { @Test public void testDeleteFeedbackResponsesForQuestionCascade_studentsQuestion_shouldUpdateRespondents() throws Exception { - FeedbackResponseAttributes fra = getResponseFromDatastore("response1ForQ1S1C1"); + FeedbackResponseAttributes fra = getResponseFromDatabase("response1ForQ1S1C1"); // this is the only response the student has given for the session assertEquals(1, frLogic.getFeedbackResponsesFromGiverForCourse(fra.courseId, fra.giver).stream() @@ -594,7 +594,7 @@ public void testDeleteFeedbackResponsesForQuestionCascade_studentsQuestion_shoul @Test public void testDeleteFeedbackResponsesForQuestionCascade_instructorsQuestion_shouldUpdateRespondents() throws Exception { - FeedbackResponseAttributes fra = getResponseFromDatastore("response1ForQ3S1C1"); + FeedbackResponseAttributes fra = getResponseFromDatabase("response1ForQ3S1C1"); // this is the only response the instructor has given for the session assertEquals(1, frLogic.getFeedbackResponsesFromGiverForCourse(fra.courseId, fra.giver).stream() @@ -616,7 +616,7 @@ public void testDeleteFeedbackResponsesForQuestionCascade_instructorsQuestion_sh @Test public void testDeleteFeedbackResponsesInvolvedEntityOfCourseCascade_giverIsStudent_shouldUpdateRespondents() throws Exception { - FeedbackResponseAttributes fra = getResponseFromDatastore("response3ForQ2S1C1"); + FeedbackResponseAttributes fra = getResponseFromDatabase("response3ForQ2S1C1"); StudentAttributes student2InCourse1 = dataBundle.students.get("student2InCourse1"); // giver is student assertEquals(FeedbackParticipantType.STUDENTS, fqLogic.getFeedbackQuestion(fra.feedbackQuestionId).getGiverType()); @@ -645,7 +645,7 @@ public void testDeleteFeedbackResponsesInvolvedEntityOfCourseCascade_giverIsStud @Test public void testDeleteFeedbackResponsesInvolvedEntityOfCourseCascade_giverIsInstructor_shouldUpdateRespondents() throws Exception { - FeedbackResponseAttributes fra = getResponseFromDatastore("response1ForQ1S2C2"); + FeedbackResponseAttributes fra = getResponseFromDatabase("response1ForQ1S2C2"); StudentAttributes student1InCourse2 = dataBundle.students.get("student1InCourse2"); // giver is instructor assertEquals(FeedbackParticipantType.SELF, @@ -677,7 +677,7 @@ public void testDeleteFeedbackResponsesInvolvedEntityOfCourseCascade_shouldDelet throws Exception { InstructorAttributes instructor1OfCourse1 = dataBundle.instructors.get("instructor1OfCourse1"); - FeedbackResponseAttributes fra1ReceivedByTeam = getResponseFromDatastore("response1ForQ1S2C1"); + FeedbackResponseAttributes fra1ReceivedByTeam = getResponseFromDatabase("response1ForQ1S2C1"); frcLogic.createFeedbackResponseComment( FeedbackResponseCommentAttributes .builder() @@ -693,7 +693,7 @@ public void testDeleteFeedbackResponsesInvolvedEntityOfCourseCascade_shouldDelet .withCommentGiverType(FeedbackParticipantType.INSTRUCTORS) .withVisibilityFollowingFeedbackQuestion(false) .build()); - FeedbackResponseAttributes fra2ReceivedByTeam = getResponseFromDatastore("response1GracePeriodFeedback"); + FeedbackResponseAttributes fra2ReceivedByTeam = getResponseFromDatabase("response1GracePeriodFeedback"); frcLogic.createFeedbackResponseComment( FeedbackResponseCommentAttributes .builder() @@ -736,7 +736,7 @@ public void testDeleteFeedbackResponsesInvolvedEntityOfCourseCascade_shouldDelet StudentAttributes student4InCourse1 = dataBundle.students.get("student4InCourse1"); // the following two responses are given by student4InCourse1 as a representative of his team - FeedbackResponseAttributes fra1GivenByTeam = getResponseFromDatastore("response1ForQ1S2C1"); + FeedbackResponseAttributes fra1GivenByTeam = getResponseFromDatabase("response1ForQ1S2C1"); // update the response's giver to the team name fra1GivenByTeam = frLogic.updateFeedbackResponseCascade( FeedbackResponseAttributes.updateOptionsBuilder(fra1GivenByTeam.getId()) @@ -757,7 +757,7 @@ public void testDeleteFeedbackResponsesInvolvedEntityOfCourseCascade_shouldDelet .withCommentGiverType(FeedbackParticipantType.INSTRUCTORS) .withVisibilityFollowingFeedbackQuestion(false) .build()); - FeedbackResponseAttributes fra2GivenByTeam = getResponseFromDatastore("response1GracePeriodFeedback"); + FeedbackResponseAttributes fra2GivenByTeam = getResponseFromDatabase("response1GracePeriodFeedback"); // update the response's giver to the team name fra2GivenByTeam = frLogic.updateFeedbackResponseCascade( FeedbackResponseAttributes.updateOptionsBuilder(fra2GivenByTeam.getId()) @@ -798,7 +798,7 @@ public void testDeleteFeedbackResponsesInvolvedEntityOfCourseCascade_shouldDelet assertTrue(frcLogic.getFeedbackResponseCommentForResponse(fra2GivenByTeam.getId()).isEmpty()); } - private FeedbackQuestionAttributes getQuestionFromDatastore(DataBundle dataBundle, String jsonId) { + private FeedbackQuestionAttributes getQuestionFromDatabase(DataBundle dataBundle, String jsonId) { FeedbackQuestionAttributes questionToGet = dataBundle.feedbackQuestions.get(jsonId); questionToGet = fqLogic.getFeedbackQuestion(questionToGet.feedbackSessionName, questionToGet.courseId, @@ -807,11 +807,11 @@ private FeedbackQuestionAttributes getQuestionFromDatastore(DataBundle dataBundl return questionToGet; } - private FeedbackQuestionAttributes getQuestionFromDatastore(String jsonId) { - return getQuestionFromDatastore(dataBundle, jsonId); + private FeedbackQuestionAttributes getQuestionFromDatabase(String jsonId) { + return getQuestionFromDatabase(dataBundle, jsonId); } - private FeedbackResponseAttributes getResponseFromDatastore(DataBundle dataBundle, String jsonId) { + private FeedbackResponseAttributes getResponseFromDatabase(DataBundle dataBundle, String jsonId) { FeedbackResponseAttributes response = dataBundle.feedbackResponses.get(jsonId); @@ -827,11 +827,11 @@ private FeedbackResponseAttributes getResponseFromDatastore(DataBundle dataBundl qnId, response.giver, response.recipient); } - private FeedbackResponseAttributes getResponseFromDatastore(String jsonId) { - return getResponseFromDatastore(dataBundle, jsonId); + private FeedbackResponseAttributes getResponseFromDatabase(String jsonId) { + return getResponseFromDatabase(dataBundle, jsonId); } - private List getFeedbackResponseCommentsForResponsesFromDatastore( + private List getFeedbackResponseCommentsForResponsesFromDatabase( Set responseIds) { List responseComments = new ArrayList<>(); for (String id : responseIds) { diff --git a/src/test/java/teammates/logic/core/FeedbackSessionsLogicTest.java b/src/test/java/teammates/logic/core/FeedbackSessionsLogicTest.java index a64d4b846d6..63cf7616862 100644 --- a/src/test/java/teammates/logic/core/FeedbackSessionsLogicTest.java +++ b/src/test/java/teammates/logic/core/FeedbackSessionsLogicTest.java @@ -192,7 +192,7 @@ private void testGetSoftDeletedFeedbackSessionsListForInstructors() { } private void testIsFeedbackSessionHasQuestionForStudents() throws Exception { - // no need to removeAndRestoreTypicalDataInDatastore() as the previous test does not change the db + // no need to removeAndRestoreTypicalDataInDatabase() as the previous test does not change the db FeedbackSessionAttributes sessionWithStudents = dataBundle.feedbackSessions.get("gracePeriodSession"); FeedbackSessionAttributes sessionWithoutStudents = dataBundle.feedbackSessions.get("closedSession"); @@ -250,7 +250,7 @@ private void testGetFeedbackSessionsClosingWithinTimeLimit() throws Exception { assertEquals(0, sessionList.size()); // restore the new course from Recycle Bin, and delete the newly added session as - // removeAndRestoreTypicalDataInDatastore() wont do it + // removeAndRestoreTypicalDataInDatabase() wont do it coursesLogic.restoreCourseFromRecycleBin(session.getCourseId()); fsLogic.deleteFeedbackSessionCascade(session.getFeedbackSessionName(), session.getCourseId()); } @@ -282,7 +282,7 @@ private void testGetFeedbackSessionsClosedWithinThePastHour() throws Exception { assertEquals(0, sessionList.size()); // restore the new course from Recycle Bin, and delete the newly added session as - // removeAndRestoreTypicalDataInDatastore() wont do it + // removeAndRestoreTypicalDataInDatabase() wont do it coursesLogic.restoreCourseFromRecycleBin(session.getCourseId()); fsLogic.deleteFeedbackSessionCascade(session.getFeedbackSessionName(), session.getCourseId()); } @@ -369,7 +369,7 @@ private void testGetFeedbackSessionsWhichNeedOpenMailsToBeSent() throws Exceptio assertEquals(0, sessionList.size()); // restore the new course from Recycle Bin, and delete the newly added session as - // removeAndRestoreTypicalDataInDatastore() wont do it + // removeAndRestoreTypicalDataInDatabase() wont do it coursesLogic.restoreCourseFromRecycleBin(session.getCourseId()); fsLogic.deleteFeedbackSessionCascade(session.getFeedbackSessionName(), session.getCourseId()); } @@ -444,7 +444,7 @@ private void testCreateAndDeleteFeedbackSession() throws InvalidParametersExcept FeedbackSessionAttributes fs = getNewFeedbackSession(); fsLogic.createFeedbackSession(fs); - verifyPresentInDatastore(fs); + verifyPresentInDatabase(fs); FeedbackSessionAttributes finalFs = fs; ______TS("test create with invalid session name"); @@ -484,8 +484,8 @@ private void testCreateAndDeleteFeedbackSession() throws InvalidParametersExcept fqLogic.createFeedbackQuestion(fq); fsLogic.deleteFeedbackSessionCascade(fs.getFeedbackSessionName(), fs.getCourseId()); - verifyAbsentInDatastore(fs); - verifyAbsentInDatastore(fq); + verifyAbsentInDatabase(fs); + verifyAbsentInDatabase(fq); } private void testIsFeedbackSessionViewableToStudents() { @@ -778,7 +778,7 @@ private FeedbackSessionAttributes getNewFeedbackSession() { .build(); } - private FeedbackQuestionAttributes getQuestionFromDatastore(String jsonId) { + private FeedbackQuestionAttributes getQuestionFromDatabase(String jsonId) { FeedbackQuestionAttributes questionToGet = dataBundle.feedbackQuestions.get(jsonId); questionToGet = fqLogic.getFeedbackQuestion( questionToGet.feedbackSessionName, @@ -788,12 +788,12 @@ private FeedbackQuestionAttributes getQuestionFromDatastore(String jsonId) { return questionToGet; } - // Extract response id from datastore based on json key. + // Extract response id from database based on json key. private String getResponseId(String jsonId, DataBundle bundle) { - return getResponseFromDatastore(jsonId, bundle).getId(); + return getResponseFromDatabase(jsonId, bundle).getId(); } - private FeedbackResponseAttributes getResponseFromDatastore(String jsonId, DataBundle bundle) { + private FeedbackResponseAttributes getResponseFromDatabase(String jsonId, DataBundle bundle) { FeedbackResponseAttributes response = bundle.feedbackResponses.get(jsonId); String questionId = null; @@ -843,7 +843,7 @@ private void testRestoreFeedbackSessionFromRecycleBin() throws InvalidParameters fsLogic.restoreFeedbackSessionFromRecycleBin(feedbackSessionName, courseId); feedbackSession.setDeletedTime(null); - verifyPresentInDatastore(feedbackSession); + verifyPresentInDatabase(feedbackSession); assertFalse(feedbackSession.isSessionDeleted()); } @@ -921,7 +921,7 @@ public void testGetSessionResultsForUser_studentSpecificQuestion_shouldHaveCorre // no response visible StudentAttributes student = dataBundle.students.get("student1InCourse1"); - FeedbackQuestionAttributes question = getQuestionFromDatastore("qn2InSession1InCourse1"); + FeedbackQuestionAttributes question = getQuestionFromDatabase("qn2InSession1InCourse1"); SessionResultsBundle bundle = fsLogic.getSessionResultsForUser( question.getFeedbackSessionName(), question.getCourseId(), student.getEmail(), UserRole.STUDENT, question.getId(), null); @@ -931,7 +931,7 @@ public void testGetSessionResultsForUser_studentSpecificQuestion_shouldHaveCorre assertEquals(0, bundle.getQuestionMissingResponseMap().size()); // one response visible - question = getQuestionFromDatastore("qn3InSession1InCourse1"); + question = getQuestionFromDatabase("qn3InSession1InCourse1"); bundle = fsLogic.getSessionResultsForUser( question.getFeedbackSessionName(), question.getCourseId(), student.getEmail(), UserRole.STUDENT, question.getId(), null); @@ -1016,7 +1016,7 @@ public void testGetSessionResultsForUser_studentAllQuestions_shouldGenerateCorre @Test public void testGetSessionResultsForUser_instructorSpecificQuestion_shouldHaveCorrectResponsesFiltered() { - FeedbackQuestionAttributes fq = getQuestionFromDatastore("qn3InSession1InCourse1"); + FeedbackQuestionAttributes fq = getQuestionFromDatabase("qn3InSession1InCourse1"); InstructorAttributes instructor = dataBundle.instructors.get("instructor1OfCourse1"); // no section specified @@ -1029,7 +1029,7 @@ public void testGetSessionResultsForUser_instructorSpecificQuestion_shouldHaveCo assertEquals(1, responseForQuestion.size()); // section specified - fq = getQuestionFromDatastore("qn2InSession1InCourse1"); + fq = getQuestionFromDatabase("qn2InSession1InCourse1"); bundle = fsLogic.getSessionResultsForUser( fq.getFeedbackSessionName(), fq.getCourseId(), instructor.getEmail(), UserRole.INSTRUCTOR, fq.getId(), "Section 1"); @@ -1163,8 +1163,8 @@ public void testGetSessionResultsForUser_orphanResponseInDB_shouldStillHandleCor dataBundle = getTypicalDataBundle(); removeAndRestoreDataBundle(dataBundle); - FeedbackQuestionAttributes fq = getQuestionFromDatastore("qn2InSession1InCourse1"); - FeedbackResponseAttributes existingResponse = getResponseFromDatastore("response1ForQ2S1C1", dataBundle); + FeedbackQuestionAttributes fq = getQuestionFromDatabase("qn2InSession1InCourse1"); + FeedbackResponseAttributes existingResponse = getResponseFromDatabase("response1ForQ2S1C1", dataBundle); // create a "null" response to simulate trying to get a null student's response FeedbackResponseAttributes newResponse = FeedbackResponseAttributes.builder( diff --git a/src/test/java/teammates/logic/core/InstructorsLogicTest.java b/src/test/java/teammates/logic/core/InstructorsLogicTest.java index 633f8b90714..3d2fa4a4059 100644 --- a/src/test/java/teammates/logic/core/InstructorsLogicTest.java +++ b/src/test/java/teammates/logic/core/InstructorsLogicTest.java @@ -79,7 +79,7 @@ private void testAddInstructor() throws Exception { instructorsLogic.createInstructor(instr); - verifyPresentInDatastore(instr); + verifyPresentInDatabase(instr); ______TS("failure: instructor already exists"); @@ -489,7 +489,7 @@ public void testDeleteInstructorCascade() throws Exception { instructorsLogic.deleteInstructorCascade(courseId, email); - verifyAbsentInDatastore(instructorDeleted); + verifyAbsentInDatabase(instructorDeleted); // there should be no response of the instructor assertTrue(frLogic.getFeedbackResponsesFromGiverForCourse(courseId, email).isEmpty()); assertTrue(frLogic.getFeedbackResponsesForReceiverForCourse(courseId, email).isEmpty()); diff --git a/src/test/java/teammates/logic/core/ProfilesLogicTest.java b/src/test/java/teammates/logic/core/ProfilesLogicTest.java index cc83f58587c..b6eafac8044 100644 --- a/src/test/java/teammates/logic/core/ProfilesLogicTest.java +++ b/src/test/java/teammates/logic/core/ProfilesLogicTest.java @@ -63,7 +63,7 @@ public void testDeleteStudentProfile() throws Exception { profilesLogic.deleteStudentProfile("sp.logic.test"); // check that profile get deleted and picture get deleted - verifyAbsentInDatastore(savedProfile); + verifyAbsentInDatabase(savedProfile); } } diff --git a/src/test/java/teammates/logic/core/StudentsLogicTest.java b/src/test/java/teammates/logic/core/StudentsLogicTest.java index e93c65d5b24..beb1a1aea66 100644 --- a/src/test/java/teammates/logic/core/StudentsLogicTest.java +++ b/src/test/java/teammates/logic/core/StudentsLogicTest.java @@ -143,7 +143,7 @@ public void testUpdateStudentCascade() throws Exception { ______TS("typical edit"); StudentAttributes student4InCourse1 = dataBundle.students.get("student4InCourse1"); - verifyPresentInDatastore(student4InCourse1); + verifyPresentInDatabase(student4InCourse1); String originalEmail = student4InCourse1.email; student4InCourse1 = studentsLogic.getStudentForEmail(student4InCourse1.course, student4InCourse1.email); student4InCourse1.name = student4InCourse1.name + "y"; @@ -189,7 +189,7 @@ public void testUpdateStudentCascade() throws Exception { .withNewEmail(student4InCourse1.email) .build() ); - verifyPresentInDatastore(student4InCourse1); + verifyPresentInDatabase(student4InCourse1); ______TS("update nothing"); @@ -197,7 +197,7 @@ public void testUpdateStudentCascade() throws Exception { StudentAttributes.updateOptionsBuilder(student4InCourse1.course, student4InCourse1.email) .build() ); - verifyPresentInDatastore(student4InCourse1); + verifyPresentInDatabase(student4InCourse1); ______TS("non-existent student"); @@ -255,7 +255,7 @@ public void testRegenerateStudentRegistrationKey() throws Exception { ______TS("typical regeneration of course student's registration key"); StudentAttributes student1InCourse1 = dataBundle.students.get("student1InCourse1"); - verifyPresentInDatastore(student1InCourse1); + verifyPresentInDatabase(student1InCourse1); StudentAttributes updatedStudent = studentsLogic.regenerateStudentRegistrationKey(student1InCourse1.course, student1InCourse1.email); @@ -536,7 +536,7 @@ public void testDeleteStudentCascade_lastPersonInTeam_shouldDeleteTeamResponses( @Test public void testDeleteStudentCascade() { StudentAttributes student2InCourse1 = dataBundle.students.get("student2InCourse1"); - verifyPresentInDatastore(student2InCourse1); + verifyPresentInDatabase(student2InCourse1); ______TS("delete non-existent student"); @@ -555,7 +555,7 @@ public void testDeleteStudentCascade() { studentsLogic.deleteStudentCascade(student2InCourse1.course, student2InCourse1.email); - verifyAbsentInDatastore(student2InCourse1); + verifyAbsentInDatabase(student2InCourse1); // verify responses of the student are gone assertTrue( frLogic.getFeedbackResponsesFromGiverForCourse( @@ -566,7 +566,7 @@ public void testDeleteStudentCascade() { // verify that other students in the course are intact StudentAttributes student1InCourse1 = dataBundle.students.get("student1InCourse1"); - verifyPresentInDatastore(student1InCourse1); + verifyPresentInDatabase(student1InCourse1); ______TS("null parameters"); diff --git a/src/test/java/teammates/storage/api/CoursesDbTest.java b/src/test/java/teammates/storage/api/CoursesDbTest.java index d74571a975d..3c85a7aae1d 100644 --- a/src/test/java/teammates/storage/api/CoursesDbTest.java +++ b/src/test/java/teammates/storage/api/CoursesDbTest.java @@ -40,7 +40,7 @@ public void testCreateCourse() throws EntityAlreadyExistsException, InvalidParam .withTimezone(ZoneId.of("UTC")) .build(); coursesDb.createEntity(c); - verifyPresentInDatastore(c); + verifyPresentInDatabase(c); ______TS("Failure: create duplicate course"); diff --git a/src/test/java/teammates/storage/api/EntitiesDbTest.java b/src/test/java/teammates/storage/api/EntitiesDbTest.java index 14fe51d96d2..2b2d8dae807 100644 --- a/src/test/java/teammates/storage/api/EntitiesDbTest.java +++ b/src/test/java/teammates/storage/api/EntitiesDbTest.java @@ -36,9 +36,9 @@ public void testCreateEntity() throws Exception { .withTimezone(ZoneId.of("UTC")) .build(); coursesDb.deleteCourse(c.getId()); - verifyAbsentInDatastore(c); + verifyAbsentInDatabase(c); coursesDb.createEntity(c); - verifyPresentInDatastore(c); + verifyPresentInDatabase(c); ______TS("fails: entity already exists"); EntityAlreadyExistsException eaee = assertThrows(EntityAlreadyExistsException.class, diff --git a/src/test/java/teammates/storage/api/FeedbackQuestionsDbTest.java b/src/test/java/teammates/storage/api/FeedbackQuestionsDbTest.java index 2d82367ea2c..0f5d3cf0a7b 100644 --- a/src/test/java/teammates/storage/api/FeedbackQuestionsDbTest.java +++ b/src/test/java/teammates/storage/api/FeedbackQuestionsDbTest.java @@ -39,7 +39,7 @@ public void testTimestamp() throws Exception { deleteFeedbackQuestion(fq); fqDb.createEntity(fq); - verifyPresentInDatastore(fq); + verifyPresentInDatabase(fq); String feedbackSessionName = fq.feedbackSessionName; String courseId = fq.courseId; @@ -221,7 +221,7 @@ public void testCreateDeleteFeedbackQuestion() throws Exception { deleteFeedbackQuestion(fqa); fqDb.createEntity(fqa); - verifyPresentInDatastore(fqa); + verifyPresentInDatabase(fqa); ______TS("duplicate - with same question number."); @@ -448,7 +448,7 @@ public void testUpdateFeedbackQuestion() throws Exception { FeedbackQuestionAttributes modifiedQuestion = getNewFeedbackQuestionAttributes(); deleteFeedbackQuestion(modifiedQuestion); fqDb.createEntity(modifiedQuestion); - verifyPresentInDatastore(modifiedQuestion); + verifyPresentInDatabase(modifiedQuestion); modifiedQuestion = fqDb.getFeedbackQuestion(modifiedQuestion.feedbackSessionName, modifiedQuestion.courseId, @@ -462,7 +462,7 @@ public void testUpdateFeedbackQuestion() throws Exception { .withQuestionDetails(fqd) .build()); - verifyPresentInDatastore(modifiedQuestion); + verifyPresentInDatabase(modifiedQuestion); modifiedQuestion = fqDb.getFeedbackQuestion(modifiedQuestion.feedbackSessionName, modifiedQuestion.courseId, modifiedQuestion.questionNumber); @@ -478,7 +478,7 @@ public void testUpdateFeedbackQuestion_singleFieldUpdate_shouldUpdateCorrectly() FeedbackQuestionAttributes typicalQuestion = getNewFeedbackQuestionAttributes(); deleteFeedbackQuestion(typicalQuestion); typicalQuestion = fqDb.createEntity(typicalQuestion); - verifyPresentInDatastore(typicalQuestion); + verifyPresentInDatabase(typicalQuestion); assertNotEquals("New question text!", typicalQuestion.getQuestionDetails().getQuestionText()); FeedbackQuestionAttributes updatedQuestion = fqDb.updateFeedbackQuestion( diff --git a/src/test/java/teammates/storage/api/FeedbackResponseCommentsDbTest.java b/src/test/java/teammates/storage/api/FeedbackResponseCommentsDbTest.java index c2b872c2038..25a37a97eed 100644 --- a/src/test/java/teammates/storage/api/FeedbackResponseCommentsDbTest.java +++ b/src/test/java/teammates/storage/api/FeedbackResponseCommentsDbTest.java @@ -84,7 +84,7 @@ private void testEntityCreationAndDeletion() throws Exception { ______TS("Entity creation"); frcDb.createEntity(frcaTemp); - verifyPresentInDatastore(frcaTemp); + verifyPresentInDatabase(frcaTemp); ______TS("Entity deletion"); @@ -92,7 +92,7 @@ private void testEntityCreationAndDeletion() throws Exception { frcaTemp.feedbackResponseId, frcaTemp.commentGiver, frcaTemp.createdAt); assertNotNull(frcaTemp); frcDb.deleteFeedbackResponseComment(frcaTemp.getId()); - verifyAbsentInDatastore(frcaTemp); + verifyAbsentInDatabase(frcaTemp); } private void testGetFeedbackResponseCommentFromId() { diff --git a/src/test/java/teammates/storage/api/FeedbackResponsesDbTest.java b/src/test/java/teammates/storage/api/FeedbackResponsesDbTest.java index a8b9d6e0c9c..3e2ad169fa7 100644 --- a/src/test/java/teammates/storage/api/FeedbackResponsesDbTest.java +++ b/src/test/java/teammates/storage/api/FeedbackResponsesDbTest.java @@ -95,7 +95,7 @@ public void testTimestamp() deleteResponse(fra); frDb.createEntity(fra); - verifyPresentInDatastore(fra); + verifyPresentInDatabase(fra); String feedbackQuestionId = fra.feedbackQuestionId; String giverEmail = fra.giver; @@ -289,7 +289,7 @@ public void testCreateFeedbackResponse() throws Exception { frDb.createEntity(fra); // sets the id for fra - verifyPresentInDatastore(fra); + verifyPresentInDatabase(fra); ______TS("duplicate - with same id."); @@ -300,7 +300,7 @@ public void testCreateFeedbackResponse() throws Exception { ______TS("delete - with id specified"); deleteResponse(fra); - verifyAbsentInDatastore(fra); + verifyAbsentInDatabase(fra); ______TS("null params"); @@ -653,7 +653,7 @@ public void testUpdateFeedbackResponse() throws Exception { .withResponseDetails(frd) .build()); - verifyPresentInDatastore(modifiedResponse); + verifyPresentInDatabase(modifiedResponse); modifiedResponse = frDb.getFeedbackResponse(modifiedResponse.feedbackQuestionId, modifiedResponse.giver, modifiedResponse.recipient); diff --git a/src/test/java/teammates/storage/api/FeedbackSessionsDbTest.java b/src/test/java/teammates/storage/api/FeedbackSessionsDbTest.java index 5d2afdd7d17..956a6d0628b 100644 --- a/src/test/java/teammates/storage/api/FeedbackSessionsDbTest.java +++ b/src/test/java/teammates/storage/api/FeedbackSessionsDbTest.java @@ -144,7 +144,7 @@ public void testCreateDeleteFeedbackSession() FeedbackSessionAttributes fsa = getNewFeedbackSession(); fsDb.createEntity(fsa); - verifyPresentInDatastore(fsa); + verifyPresentInDatabase(fsa); ______TS("duplicate"); EntityAlreadyExistsException eaee = assertThrows(EntityAlreadyExistsException.class, () -> fsDb.createEntity(fsa)); @@ -152,7 +152,7 @@ public void testCreateDeleteFeedbackSession() String.format(FeedbackSessionsDb.ERROR_CREATE_ENTITY_ALREADY_EXISTS, fsa.toString()), eaee.getMessage()); fsDb.deleteFeedbackSession(fsa.getFeedbackSessionName(), fsa.getCourseId()); - verifyAbsentInDatastore(fsa); + verifyAbsentInDatabase(fsa); ______TS("null params"); @@ -477,7 +477,7 @@ public void testUpdateFeedbackSession() throws Exception { FeedbackSessionAttributes modifiedSession = getNewFeedbackSession(); fsDb.deleteFeedbackSession(modifiedSession.getFeedbackSessionName(), modifiedSession.getCourseId()); fsDb.createEntity(modifiedSession); - verifyPresentInDatastore(modifiedSession); + verifyPresentInDatabase(modifiedSession); modifiedSession.setInstructions("new instructions"); modifiedSession.setGracePeriodMinutes(0); modifiedSession.setSentOpenEmail(false); diff --git a/src/test/java/teammates/storage/api/InstructorsDbTest.java b/src/test/java/teammates/storage/api/InstructorsDbTest.java index 89a11bb8cee..2d1b81d3ff9 100644 --- a/src/test/java/teammates/storage/api/InstructorsDbTest.java +++ b/src/test/java/teammates/storage/api/InstructorsDbTest.java @@ -69,7 +69,7 @@ public void testCreateInstructor() throws Exception { instructorsDb.deleteInstructor(i.getCourseId(), i.getEmail()); instructorsDb.createEntity(i); - verifyPresentInDatastore(i); + verifyPresentInDatabase(i); ______TS("Failure: create a duplicate instructor"); diff --git a/src/test/java/teammates/storage/api/ProfilesDbTest.java b/src/test/java/teammates/storage/api/ProfilesDbTest.java index 5e503611ee9..722dc36f966 100644 --- a/src/test/java/teammates/storage/api/ProfilesDbTest.java +++ b/src/test/java/teammates/storage/api/ProfilesDbTest.java @@ -39,8 +39,8 @@ public void deleteTypicalData() { // delete entity profilesDb.deleteStudentProfile(typicalProfileWithPicture.googleId); profilesDb.deleteStudentProfile(typicalProfileWithoutPicture.googleId); - verifyAbsentInDatastore(typicalProfileWithPicture); - verifyAbsentInDatastore(typicalProfileWithoutPicture); + verifyAbsentInDatabase(typicalProfileWithPicture); + verifyAbsentInDatabase(typicalProfileWithoutPicture); } @Test @@ -66,7 +66,7 @@ public void testUpdateOrCreateStudentProfile_nonExistentProfile_shouldCreateNewP .withShortName(spa.shortName) .build()); - verifyPresentInDatastore(spa); + verifyPresentInDatabase(spa); assertEquals("non-ExIsTenT", createdSpa.googleId); assertEquals("Test", createdSpa.shortName); @@ -81,7 +81,7 @@ public void testUpdateOrCreateStudentProfile_nonExistentProfile_shouldCreateNewP StudentProfileAttributes.updateOptionsBuilder(emptySpa.getGoogleId()) .build()); - verifyPresentInDatastore(emptySpa); + verifyPresentInDatabase(emptySpa); // tear down profilesDb.deleteStudentProfile(emptySpa.getGoogleId()); @@ -199,7 +199,7 @@ public void testUpdateOrCreateStudentProfile_noChangesToProfile_shouldNotIssueSa StudentProfileAttributes storedProfile = profilesDb.getStudentProfile(typicalProfileWithPicture.googleId); // other fields remain - verifyPresentInDatastore(typicalProfileWithPicture); + verifyPresentInDatabase(typicalProfileWithPicture); // modifiedDate remains assertEquals(typicalProfileWithPicture.modifiedDate, storedProfile.modifiedDate); @@ -210,7 +210,7 @@ public void testUpdateOrCreateStudentProfile_noChangesToProfile_shouldNotIssueSa storedProfile = profilesDb.getStudentProfile(typicalProfileWithPicture.getGoogleId()); // other fields remain - verifyPresentInDatastore(typicalProfileWithPicture); + verifyPresentInDatabase(typicalProfileWithPicture); // modifiedDate remains assertEquals(typicalProfileWithPicture.getModifiedDate(), storedProfile.getModifiedDate()); } @@ -226,7 +226,7 @@ public void testDeleteStudentProfile_nonExistentEntity_shouldFailSilently() { public void testDeleteStudentProfile_profileWithoutPicture_shouldDeleteCorrectly() { profilesDb.deleteStudentProfile(typicalProfileWithoutPicture.googleId); - verifyAbsentInDatastore(typicalProfileWithoutPicture); + verifyAbsentInDatabase(typicalProfileWithoutPicture); } @Test @@ -234,7 +234,7 @@ public void testDeleteStudentProfile_profileWithPicture_shouldDeleteCorrectly() profilesDb.deleteStudentProfile(typicalProfileWithPicture.googleId); // check that profile get deleted and picture get deleted - verifyAbsentInDatastore(typicalProfileWithPicture); + verifyAbsentInDatabase(typicalProfileWithPicture); } } diff --git a/src/test/java/teammates/storage/api/StudentsDbTest.java b/src/test/java/teammates/storage/api/StudentsDbTest.java index a53ccf1c35f..be5f59bb410 100644 --- a/src/test/java/teammates/storage/api/StudentsDbTest.java +++ b/src/test/java/teammates/storage/api/StudentsDbTest.java @@ -76,7 +76,7 @@ public void testCreateStudent() throws Exception { FieldValidator.COURSE_ID_FIELD_NAME, REASON_INCORRECT_FORMAT, FieldValidator.COURSE_ID_MAX_LENGTH), ipe.getMessage()); - verifyAbsentInDatastore(s); + verifyAbsentInDatabase(s); ______TS("success : valid params"); s.course = "valid-course"; @@ -85,7 +85,7 @@ public void testCreateStudent() throws Exception { studentsDb.deleteStudent(s.course, s.email); studentsDb.createEntity(s); - verifyPresentInDatastore(s); + verifyPresentInDatabase(s); StudentAttributes retrievedStudent = studentsDb.getStudentForGoogleId(s.course, s.googleId); assertTrue(isEnrollInfoSameAs(retrievedStudent, s)); assertNull(studentsDb.getStudentForGoogleId(s.course + "not existing", s.googleId)); diff --git a/src/test/java/teammates/test/AbstractBackDoor.java b/src/test/java/teammates/test/AbstractBackDoor.java index 776ac56392c..61ec402b6dc 100644 --- a/src/test/java/teammates/test/AbstractBackDoor.java +++ b/src/test/java/teammates/test/AbstractBackDoor.java @@ -213,24 +213,24 @@ private void addAuthKeys(HttpRequestBase request) { } /** - * Removes and restores given data in the datastore. This method is to be called on test startup. + * Removes and restores given data in the database. This method is to be called on test startup. * *

Note: The data associated with the test accounts have to be manually removed by removing the data * bundle when a test ends because the test accounts are shared across tests. * - *

Test data should never be cleared after test in order to prevent incurring additional datastore costs because the + *

Test data should never be cleared after test in order to prevent incurring additional database costs because the * test's data may not be accessed in another test. Also although unlikely in normal conditions, when a test fail to * remove data bundle on teardown, another test should have no reason to fail. * *

Another reason not to remove associated data after a test is that in case of test failures, it helps to have the - * associated data in the datastore to debug the failure. + * associated data in the database to debug the failure. * *

This means that removing the data bundle on startup is not always sufficient because a test only knows how * to remove its associated data. * This is why some tests would fail when they use the same account and use different data. * Extending this method to remove data outside its associated data would introduce * unnecessary complications such as extra costs and knowing exactly how much data to remove. Removing too much data - * would not just incur higher datastore costs but we can make tests unexpectedly pass(fail) when the data is expected to + * would not just incur higher database costs but we can make tests unexpectedly pass(fail) when the data is expected to * be not present(present) in another test. * *

TODO: Hence, we need to explicitly remove the data bundle in tests on teardown to avoid instability of tests. @@ -249,7 +249,7 @@ public String removeAndRestoreDataBundle(DataBundle dataBundle) throws HttpReque } /** - * Removes given data from the datastore. + * Removes given data from the database. * *

If given entities have already been deleted, it fails silently. */ @@ -258,7 +258,7 @@ public void removeDataBundle(DataBundle dataBundle) { } /** - * Puts searchable documents in data bundle into the datastore. + * Puts searchable documents in data bundle into the database. */ public String putDocuments(DataBundle dataBundle) throws HttpRequestFailedException { ResponseBodyAndCode putRequestOutput = @@ -271,7 +271,7 @@ public String putDocuments(DataBundle dataBundle) throws HttpRequestFailedExcept } /** - * Gets an account from the datastore. + * Gets an account from the database. */ public AccountAttributes getAccount(String googleId) { Map params = new HashMap<>(); @@ -291,7 +291,7 @@ public AccountAttributes getAccount(String googleId) { } /** - * Gets course data from the datastore. + * Gets course data from the database. */ public CourseData getCourseData(String courseId) { Map params = new HashMap<>(); @@ -306,7 +306,7 @@ public CourseData getCourseData(String courseId) { } /** - * Gets a course from the datastore. + * Gets a course from the database. */ public CourseAttributes getCourse(String courseId) { CourseData courseData = getCourseData(courseId); @@ -320,7 +320,7 @@ public CourseAttributes getCourse(String courseId) { } /** - * Gets archived course data from the datastore. + * Gets archived course data from the database. */ public CourseData getArchivedCourseData(String instructorId, String courseId) { Map params = new HashMap<>(); @@ -349,7 +349,7 @@ public CourseData getArchivedCourseData(String instructorId, String courseId) { } /** - * Gets a archived course from the datastore. + * Gets a archived course from the database. */ public CourseAttributes getArchivedCourse(String instructorId, String courseId) { CourseData courseData = getArchivedCourseData(instructorId, courseId); @@ -374,7 +374,7 @@ public boolean isCourseInRecycleBin(String courseId) { } /** - * Gets instructor data from the datastore. + * Gets instructor data from the database. */ public InstructorData getInstructorData(String courseId, String email) { Map params = new HashMap<>(); @@ -400,7 +400,7 @@ public InstructorData getInstructorData(String courseId, String email) { } /** - * Get instructor from datastore. Does not include certain fields like InstructorPrivileges. + * Get instructor from database. Does not include certain fields like InstructorPrivileges. */ public InstructorAttributes getInstructor(String courseId, String instructorEmail) { InstructorData instructorData = getInstructorData(courseId, instructorEmail); @@ -432,7 +432,7 @@ public InstructorAttributes getInstructor(String courseId, String instructorEmai } /** - * Gets student data from the datastore. + * Gets student data from the database. */ public StudentData getStudentData(String courseId, String studentEmail) { Map params = new HashMap<>(); @@ -446,7 +446,7 @@ public StudentData getStudentData(String courseId, String studentEmail) { } /** - * Get student from datastore. + * Get student from database. */ public StudentAttributes getStudent(String courseId, String studentEmail) { StudentData studentData = getStudentData(courseId, studentEmail); @@ -481,7 +481,7 @@ public StudentAttributes getStudent(String courseId, String studentEmail) { } /** - * Get feedback session data from datastore. + * Get feedback session data from database. */ public FeedbackSessionData getFeedbackSessionData(String courseId, String feedbackSessionName) { Map params = new HashMap<>(); @@ -496,7 +496,7 @@ public FeedbackSessionData getFeedbackSessionData(String courseId, String feedba } /** - * Get feedback session from datastore. + * Get feedback session from database. */ public FeedbackSessionAttributes getFeedbackSession(String courseId, String feedbackSessionName) { FeedbackSessionData sessionData = getFeedbackSessionData(courseId, feedbackSessionName); @@ -537,7 +537,7 @@ public FeedbackSessionAttributes getFeedbackSession(String courseId, String feed } /** - * Get soft deleted feedback session from datastore. + * Get soft deleted feedback session from database. */ public FeedbackSessionAttributes getSoftDeletedSession(String feedbackSessionName, String instructorId) { Map params = new HashMap<>(); @@ -566,7 +566,7 @@ public FeedbackSessionAttributes getSoftDeletedSession(String feedbackSessionNam } /** - * Get feedback question from datastore. + * Get feedback question from database. */ public FeedbackQuestionAttributes getFeedbackQuestion(String courseId, String feedbackSessionName, int qnNumber) { @@ -639,7 +639,7 @@ private static List convertToFeedbackParticipantType( } /** - * Get feedback response from datastore. + * Get feedback response from database. */ public FeedbackResponseAttributes getFeedbackResponse(String feedbackQuestionId, String giver, String recipient) { @@ -674,7 +674,7 @@ public FeedbackResponseAttributes getFeedbackResponse(String feedbackQuestionId, } /** - * Get feedback response comment from datastore. + * Get feedback response comment from database. */ public FeedbackResponseCommentAttributes getFeedbackResponseComment(String feedbackResponseId) { Map params = new HashMap<>(); @@ -698,7 +698,7 @@ public FeedbackResponseCommentAttributes getFeedbackResponseComment(String feedb } /** - * Deletes a course from the datastore. + * Deletes a course from the database. */ public void deleteCourse(String courseId) { Map params = new HashMap<>(); diff --git a/src/test/java/teammates/test/BaseComponentTestCase.java b/src/test/java/teammates/test/BaseComponentTestCase.java index a8e3691ac50..3e17fa055a0 100644 --- a/src/test/java/teammates/test/BaseComponentTestCase.java +++ b/src/test/java/teammates/test/BaseComponentTestCase.java @@ -19,7 +19,7 @@ * Base class for all component tests. */ @Test(singleThreaded = true) -public class BaseComponentTestCase extends BaseTestCaseWithDatastoreAccess { +public class BaseComponentTestCase extends BaseTestCaseWithDatabaseAccess { protected static final LogicExtension logic = new LogicExtension(); diff --git a/src/test/java/teammates/test/BaseTestCaseWithDatastoreAccess.java b/src/test/java/teammates/test/BaseTestCaseWithDatabaseAccess.java similarity index 96% rename from src/test/java/teammates/test/BaseTestCaseWithDatastoreAccess.java rename to src/test/java/teammates/test/BaseTestCaseWithDatabaseAccess.java index 6737ae2e3a3..fa573fd9ebe 100644 --- a/src/test/java/teammates/test/BaseTestCaseWithDatastoreAccess.java +++ b/src/test/java/teammates/test/BaseTestCaseWithDatabaseAccess.java @@ -16,28 +16,28 @@ import teammates.common.util.ThreadHelper; /** - * Base class for all test cases which are allowed to access the Datastore. + * Base class for all test cases which are allowed to access the database. */ -public abstract class BaseTestCaseWithDatastoreAccess extends BaseTestCaseWithObjectifyAccess { +public abstract class BaseTestCaseWithDatabaseAccess extends BaseTestCaseWithObjectifyAccess { private static final int VERIFICATION_RETRY_COUNT = 5; private static final int VERIFICATION_RETRY_DELAY_IN_MS = 1000; private static final int OPERATION_RETRY_COUNT = 5; private static final int OPERATION_RETRY_DELAY_IN_MS = 1000; - protected void verifyPresentInDatastore(DataBundle data) { - data.accounts.values().forEach(this::verifyPresentInDatastore); + protected void verifyPresentInDatabase(DataBundle data) { + data.accounts.values().forEach(this::verifyPresentInDatabase); - data.instructors.values().forEach(this::verifyPresentInDatastore); + data.instructors.values().forEach(this::verifyPresentInDatabase); data.courses.values().stream() .filter(course -> !course.isCourseDeleted()) - .forEach(this::verifyPresentInDatastore); + .forEach(this::verifyPresentInDatabase); - data.students.values().forEach(this::verifyPresentInDatastore); + data.students.values().forEach(this::verifyPresentInDatabase); } - protected void verifyPresentInDatastore(EntityAttributes expected) { + protected void verifyPresentInDatabase(EntityAttributes expected) { int retryLimit = VERIFICATION_RETRY_COUNT; EntityAttributes actual = getEntity(expected); while (actual == null && retryLimit > 0) { @@ -81,7 +81,7 @@ private EntityAttributes getEntity(EntityAttributes expected) { } } - protected void verifyAbsentInDatastore(EntityAttributes entity) { + protected void verifyAbsentInDatabase(EntityAttributes entity) { int retryLimit = VERIFICATION_RETRY_COUNT; EntityAttributes actual = getEntity(entity); while (actual != null && retryLimit > 0) { diff --git a/src/test/java/teammates/ui/webapi/FeedbackSessionClosedRemindersActionTest.java b/src/test/java/teammates/ui/webapi/FeedbackSessionClosedRemindersActionTest.java index dcd2ced4a2c..fe4762d8ad9 100644 --- a/src/test/java/teammates/ui/webapi/FeedbackSessionClosedRemindersActionTest.java +++ b/src/test/java/teammates/ui/webapi/FeedbackSessionClosedRemindersActionTest.java @@ -65,7 +65,7 @@ public void testExecute() throws Exception { .withEndTime(session1.getEndTime()) .build()); session1.setSentOpenEmail(false); // fsLogic will set the flag to false - verifyPresentInDatastore(session1); + verifyPresentInDatabase(session1); // Ditto, but with disabled closed reminder @@ -83,7 +83,7 @@ public void testExecute() throws Exception { .withIsClosingEmailEnabled(session2.isClosingEmailEnabled()) .build()); session2.setSentOpenEmail(false); // fsLogic will set the flag to false - verifyPresentInDatastore(session2); + verifyPresentInDatabase(session2); // Still in grace period; closed reminder should not be sent @@ -99,7 +99,7 @@ public void testExecute() throws Exception { .withEndTime(session3.getEndTime()) .build()); session3.setSentOpenEmail(false); // fsLogic will set the flag to false - verifyPresentInDatastore(session3); + verifyPresentInDatabase(session3); action = getAction(); action.execute(); diff --git a/src/test/java/teammates/ui/webapi/FeedbackSessionClosingRemindersActionTest.java b/src/test/java/teammates/ui/webapi/FeedbackSessionClosingRemindersActionTest.java index 943a0d04cf9..3dc4cc0df27 100644 --- a/src/test/java/teammates/ui/webapi/FeedbackSessionClosingRemindersActionTest.java +++ b/src/test/java/teammates/ui/webapi/FeedbackSessionClosingRemindersActionTest.java @@ -65,7 +65,7 @@ public void testExecute() throws Exception { .withEndTime(session1.getEndTime()) .build()); session1.setSentOpenEmail(true); // fsLogic will set the flag to true - verifyPresentInDatastore(session1); + verifyPresentInDatabase(session1); // Ditto, but disable the closing reminder @@ -83,7 +83,7 @@ public void testExecute() throws Exception { .withIsClosingEmailEnabled(session2.isClosingEmailEnabled()) .build()); session1.setSentOpenEmail(true); // fsLogic will set the flag to true - verifyPresentInDatastore(session2); + verifyPresentInDatabase(session2); // 1 session not yet opened; do not send the closing reminder @@ -99,7 +99,7 @@ public void testExecute() throws Exception { .withEndTime(session3.getEndTime()) .build()); session3.setSentOpenEmail(false); // fsLogic will set the flag to true - verifyPresentInDatastore(session3); + verifyPresentInDatabase(session3); // wait for very briefly so that the above session will be within the time limit ThreadHelper.waitFor(5); diff --git a/src/test/java/teammates/ui/webapi/FeedbackSessionPublishedRemindersActionTest.java b/src/test/java/teammates/ui/webapi/FeedbackSessionPublishedRemindersActionTest.java index ed95fa5f8b4..4a0fbcebffe 100644 --- a/src/test/java/teammates/ui/webapi/FeedbackSessionPublishedRemindersActionTest.java +++ b/src/test/java/teammates/ui/webapi/FeedbackSessionPublishedRemindersActionTest.java @@ -52,7 +52,7 @@ public void testExecute() throws Exception { .updateOptionsBuilder(session1.getFeedbackSessionName(), session1.getCourseId()) .withResultsVisibleFromTime(session1.getResultsVisibleFromTime()) .build()); - verifyPresentInDatastore(session1); + verifyPresentInDatabase(session1); // Publish session by moving automated publish time and disable publish reminder @@ -65,7 +65,7 @@ public void testExecute() throws Exception { .withResultsVisibleFromTime(session2.getResultsVisibleFromTime()) .withIsPublishedEmailEnabled(session2.isPublishedEmailEnabled()) .build()); - verifyPresentInDatastore(session2); + verifyPresentInDatabase(session2); // Do a manual publish @@ -79,7 +79,7 @@ public void testExecute() throws Exception { session3.setResultsVisibleFromTime( logic.getFeedbackSession(session3.getFeedbackSessionName(), session3.getCourseId()) .getResultsVisibleFromTime()); - verifyPresentInDatastore(session3); + verifyPresentInDatabase(session3); action = getAction(); action.execute();