From 7e767248eae123e8fcefd28de803d12608033c1b Mon Sep 17 00:00:00 2001 From: CC-3636 Date: Fri, 2 Dec 2022 18:16:33 -0500 Subject: [PATCH 01/15] added logout interactor stuff to main because I forgot to add it before ugh --- src/main/java/Main.java | 11 +++++++++++ src/main/java/data/courses.csv | 1 + src/main/java/screens/InstructorMain.java | 1 + .../java/screens/login_registration/LogoutFailed.java | 8 ++++++++ 4 files changed, 21 insertions(+) create mode 100644 src/main/java/data/courses.csv create mode 100644 src/main/java/screens/login_registration/LogoutFailed.java diff --git a/src/main/java/Main.java b/src/main/java/Main.java index a222b32..3556f61 100644 --- a/src/main/java/Main.java +++ b/src/main/java/Main.java @@ -15,6 +15,10 @@ import use_cases.login_registration.login_usecase.LoginInputBoundary; import use_cases.login_registration.login_usecase.LoginInteractor; import use_cases.login_registration.login_usecase.LoginPresenter; +import use_cases.login_registration.logout_usecase.LogoutGateway; +import use_cases.login_registration.logout_usecase.LogoutInputBoundary; +import use_cases.login_registration.logout_usecase.LogoutInteractor; +import use_cases.login_registration.logout_usecase.LogoutPresenter; import use_cases.login_registration.user_register_usecase.*; import use_cases.task_management.event_creation_use_case.*; @@ -91,6 +95,13 @@ public static void main(String[] args) throws IOException, ClassNotFoundExceptio CourseCreationInputBoundary interactor = new CourseCreationInteractor(course, presenter, courseMap); CourseCreationController courseCreationController = new CourseCreationController(interactor); + // Adding in logout use case + LogoutGateway logoutUser = new FileUser("src/main/java/data/users.ser"); + LogoutPresenter logoutPresenter = new LogoutResponseFormatter(); + LogoutInputBoundary logoutInteractor = new LogoutInteractor(logoutUser, logoutPresenter, user); + LogoutController logoutController = new LogoutController(logoutInteractor); + // + // Build the GUI EventCreationScreen taskScreen = new EventCreationScreen(eventCreationController, screens, cardLayout); screens.add("toDoList", taskScreen); diff --git a/src/main/java/data/courses.csv b/src/main/java/data/courses.csv new file mode 100644 index 0000000..122444c --- /dev/null +++ b/src/main/java/data/courses.csv @@ -0,0 +1 @@ +course_name,course_instructor,tasks? diff --git a/src/main/java/screens/InstructorMain.java b/src/main/java/screens/InstructorMain.java index ca37401..d3c1195 100644 --- a/src/main/java/screens/InstructorMain.java +++ b/src/main/java/screens/InstructorMain.java @@ -81,6 +81,7 @@ public void actionPerformed(ActionEvent evt) { // cardLayout.show(screens, "scheduleCT"); // } if (evt.getSource() == logout) { + cardLayout.show(screens, "welcome"); } diff --git a/src/main/java/screens/login_registration/LogoutFailed.java b/src/main/java/screens/login_registration/LogoutFailed.java new file mode 100644 index 0000000..2934fb8 --- /dev/null +++ b/src/main/java/screens/login_registration/LogoutFailed.java @@ -0,0 +1,8 @@ +package screens.login_registration; + +public class LogoutFailed extends Throwable { + + public LogoutFailed(String error) { + super(error); + } +} \ No newline at end of file From c116c491e0a5d8f2c422fcdd59231dbd7bad50ba Mon Sep 17 00:00:00 2001 From: CC-3636 Date: Fri, 2 Dec 2022 18:18:57 -0500 Subject: [PATCH 02/15] added logoutController parameters to StudentMainScreen and InstructorMainScreen --- src/main/java/Main.java | 4 ++-- src/main/java/screens/InstructorMain.java | 4 +++- src/main/java/screens/StudentMainScreen.java | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/Main.java b/src/main/java/Main.java index 3556f61..16cc7c5 100644 --- a/src/main/java/Main.java +++ b/src/main/java/Main.java @@ -118,7 +118,7 @@ public static void main(String[] args) throws IOException, ClassNotFoundExceptio CourseCreationScreen courseCreationScreen = new CourseCreationScreen(courseCreationController, screens, cardLayout); screens.add("course", courseCreationScreen); - StudentMainScreen studentMainScreen = new StudentMainScreen(screens, cardLayout); + StudentMainScreen studentMainScreen = new StudentMainScreen(screens, cardLayout, logoutController); screens.add("main", studentMainScreen); RegisterScreen registerScreen = new RegisterScreen(userRegisterController, cardLayout, screens); @@ -127,7 +127,7 @@ public static void main(String[] args) throws IOException, ClassNotFoundExceptio LoginScreen loginScreen = new LoginScreen(loginController, cardLayout, screens); screens.add("login", loginScreen); - InstructorMain instructorMainScreen = new InstructorMain(screens, cardLayout); + InstructorMain instructorMainScreen = new InstructorMain(screens, cardLayout, logoutController); screens.add("InstructorMain", instructorMainScreen); WelcomeScreen welcomeScreen = new WelcomeScreen(cardLayout, screens); diff --git a/src/main/java/screens/InstructorMain.java b/src/main/java/screens/InstructorMain.java index d3c1195..19460eb 100644 --- a/src/main/java/screens/InstructorMain.java +++ b/src/main/java/screens/InstructorMain.java @@ -1,5 +1,7 @@ package screens; +import screens.login_registration.LogoutController; + import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; @@ -27,7 +29,7 @@ public class InstructorMain extends JPanel implements ActionListener { /** * The window of the main screen with buttons connecting to each use case */ - public InstructorMain(JPanel screens, CardLayout cardLayout) { + public InstructorMain(JPanel screens, CardLayout cardLayout, LogoutController controller) { this.cardLayout = cardLayout; this.screens = screens; diff --git a/src/main/java/screens/StudentMainScreen.java b/src/main/java/screens/StudentMainScreen.java index b63d03c..0198d94 100644 --- a/src/main/java/screens/StudentMainScreen.java +++ b/src/main/java/screens/StudentMainScreen.java @@ -1,5 +1,7 @@ package screens; +import screens.login_registration.LogoutController; + import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; @@ -27,7 +29,7 @@ public class StudentMainScreen extends JPanel implements ActionListener { /** * The window of the main screen with buttons connecting to each use case */ - public StudentMainScreen(JPanel screens, CardLayout cardLayout) { + public StudentMainScreen(JPanel screens, CardLayout cardLayout, LogoutController controller) { this.cardLayout = cardLayout; this.screens = screens; From b8f325fd1d206a59dd99e597f4e9fe44080aa595 Mon Sep 17 00:00:00 2001 From: CC-3636 Date: Fri, 2 Dec 2022 18:20:48 -0500 Subject: [PATCH 03/15] added logoutController attributes to StudentMainScreen and InstructorMainScreen --- src/main/java/screens/InstructorMain.java | 3 +++ src/main/java/screens/StudentMainScreen.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/main/java/screens/InstructorMain.java b/src/main/java/screens/InstructorMain.java index 19460eb..927eab7 100644 --- a/src/main/java/screens/InstructorMain.java +++ b/src/main/java/screens/InstructorMain.java @@ -26,6 +26,8 @@ public class InstructorMain extends JPanel implements ActionListener { CardLayout cardLayout; JPanel screens; + LogoutController logoutController; + /** * The window of the main screen with buttons connecting to each use case */ @@ -33,6 +35,7 @@ public InstructorMain(JPanel screens, CardLayout cardLayout, LogoutController co this.cardLayout = cardLayout; this.screens = screens; + this.logoutController = controller; // Create label for title of screen JLabel title = new JLabel("32 Things To Do"); diff --git a/src/main/java/screens/StudentMainScreen.java b/src/main/java/screens/StudentMainScreen.java index 0198d94..2a294b7 100644 --- a/src/main/java/screens/StudentMainScreen.java +++ b/src/main/java/screens/StudentMainScreen.java @@ -26,6 +26,8 @@ public class StudentMainScreen extends JPanel implements ActionListener { CardLayout cardLayout; JPanel screens; + LogoutController logoutController; + /** * The window of the main screen with buttons connecting to each use case */ @@ -33,6 +35,7 @@ public StudentMainScreen(JPanel screens, CardLayout cardLayout, LogoutController this.cardLayout = cardLayout; this.screens = screens; + this.logoutController = controller; // Create label for title of screen JLabel title = new JLabel("32 Things To Do"); From 798446ac1bb1693a0f2e5eb107445014b13dfa19 Mon Sep 17 00:00:00 2001 From: CC-3636 Date: Fri, 2 Dec 2022 20:25:10 -0500 Subject: [PATCH 04/15] finished integrating logout use case --- src/main/java/Main.java | 6 +--- src/main/java/data/users.ser | Bin 1015 -> 1272 bytes .../java/screens/InstructorMainScreen.java | 27 ++++++++++++------ src/main/java/screens/StudentMainScreen.java | 10 ++++++- .../login_registration/LoginScreen.java | 2 +- .../login_registration/LogoutController.java | 10 +++---- .../login_registration/RegisterScreen.java | 2 +- .../logout_usecase/LogoutInputBoundary.java | 6 ++-- .../logout_usecase/LogoutInteractor.java | 21 ++++---------- .../UserRegInteractor.java | 5 +--- .../logout_usecase/LogoutInteractorTest.java | 8 ++---- 11 files changed, 46 insertions(+), 51 deletions(-) diff --git a/src/main/java/Main.java b/src/main/java/Main.java index ab41fb1..f2c4943 100644 --- a/src/main/java/Main.java +++ b/src/main/java/Main.java @@ -97,8 +97,7 @@ public static void main(String[] args) throws IOException, ClassNotFoundExceptio // Adding in logout use case LogoutGateway logoutUser = new FileUser("src/main/java/data/users.ser"); - LogoutPresenter logoutPresenter = new LogoutResponseFormatter(); - LogoutInputBoundary logoutInteractor = new LogoutInteractor(logoutUser, logoutPresenter, user); + LogoutInputBoundary logoutInteractor = new LogoutInteractor(logoutUser); LogoutController logoutController = new LogoutController(logoutInteractor); // @@ -119,8 +118,6 @@ public static void main(String[] args) throws IOException, ClassNotFoundExceptio screens.add("course", courseCreationScreen); StudentMainScreen studentMainScreen = new StudentMainScreen(screens, cardLayout, logoutController); - screens.add("main", studentMainScreen); - StudentMainScreen studentMainScreen = new StudentMainScreen(screens, cardLayout); screens.add("StudentMain", studentMainScreen); RegisterScreen registerScreen = new RegisterScreen(userRegisterController, cardLayout, screens); @@ -130,7 +127,6 @@ public static void main(String[] args) throws IOException, ClassNotFoundExceptio screens.add("login", loginScreen); InstructorMainScreen instructorMainScreen = new InstructorMainScreen(screens, cardLayout, logoutController); -// InstructorMainScreen instructorMainScreen = new InstructorMain(screens, cardLayout, logoutController); screens.add("InstructorMain", instructorMainScreen); WelcomeScreen welcomeScreen = new WelcomeScreen(cardLayout, screens); diff --git a/src/main/java/data/users.ser b/src/main/java/data/users.ser index 8f6702e427ac07231145c6fb60234f6adaa3f098..fcbfbba557f5b969ff62c78d3028e15596fb09f5 100644 GIT binary patch delta 200 zcmey){)2Nu03++h!2gWwA`-HkF~w&#hcnG*)GT3ODM&2MDK2EFV-N+CT;+VM3=Hhg zc$h>)twt9CPN4riLr$XEdYh~Wt5 diff --git a/src/main/java/screens/InstructorMainScreen.java b/src/main/java/screens/InstructorMainScreen.java index e731e21..6800d90 100644 --- a/src/main/java/screens/InstructorMainScreen.java +++ b/src/main/java/screens/InstructorMainScreen.java @@ -1,12 +1,18 @@ package screens; +import screens.login_registration.LoginFailed; import screens.login_registration.LogoutController; +import screens.login_registration.LogoutFailed; +import use_cases.login_registration.login_usecase.LoginResponseModel; +import use_cases.login_registration.logout_usecase.LogoutResponseModel; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import static javax.swing.JOptionPane.showMessageDialog; + public class InstructorMainScreen extends JPanel implements ActionListener { @@ -26,13 +32,16 @@ public class InstructorMainScreen extends JPanel implements ActionListener { CardLayout cardLayout; JPanel screens; + LogoutController logoutController; + /** * The window of the main screen with buttons connecting to each use case */ - public InstructorMain(JPanel screens, CardLayout cardLayout) { + public InstructorMainScreen(JPanel screens, CardLayout cardLayout, LogoutController controller) { this.cardLayout = cardLayout; this.screens = screens; + this.logoutController = controller; // Create label for title of screen JLabel title = new JLabel("32 Things To Do"); @@ -42,13 +51,11 @@ public InstructorMain(JPanel screens, CardLayout cardLayout) { taskCreate = new JButton("New Task"); calendar = new JButton("Calendar"); courses = new JButton("Courses"); -// scheduleCT = new JButton("Schedule Collaborative Task"); logout = new JButton("Logout"); taskCreate.addActionListener(this); calendar.addActionListener(this); courses.addActionListener(this); -// scheduleCT.addActionListener(this); logout.addActionListener(this); // Create panel for buttons @@ -56,7 +63,6 @@ public InstructorMain(JPanel screens, CardLayout cardLayout) { buttons.add(taskCreate); buttons.add(calendar); buttons.add(courses); -// buttons.add(scheduleCT); buttons.add(logout); // Add all components to the panel @@ -79,11 +85,16 @@ public void actionPerformed(ActionEvent evt) { if (evt.getSource() == courses) { cardLayout.show(screens, "course"); } -// if (evt.getSource() == scheduleCT) { -// cardLayout.show(screens, "scheduleCT"); -// } + if (evt.getSource() == logout) { - cardLayout.show(screens, "welcome"); + try { + logoutController.create(); + showMessageDialog(this, "Successfully logged out"); + cardLayout.show(screens, "welcome"); + } catch (Exception e) { + showMessageDialog(this, "Logout failed"); + } + } } diff --git a/src/main/java/screens/StudentMainScreen.java b/src/main/java/screens/StudentMainScreen.java index 2a294b7..d087c34 100644 --- a/src/main/java/screens/StudentMainScreen.java +++ b/src/main/java/screens/StudentMainScreen.java @@ -7,6 +7,8 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import static javax.swing.JOptionPane.showMessageDialog; + public class StudentMainScreen extends JPanel implements ActionListener { /** @@ -91,7 +93,13 @@ public void actionPerformed(ActionEvent evt) { cardLayout.show(screens, "scheduleCT"); } if (evt.getSource() == logout) { - cardLayout.show(screens, "welcome"); + try { + logoutController.create(); + showMessageDialog(this, "Successfully logged out"); + cardLayout.show(screens, "welcome"); + } catch (Exception e) { + showMessageDialog(this, "Logout failed"); + } } } diff --git a/src/main/java/screens/login_registration/LoginScreen.java b/src/main/java/screens/login_registration/LoginScreen.java index 802a2a5..b9afac1 100644 --- a/src/main/java/screens/login_registration/LoginScreen.java +++ b/src/main/java/screens/login_registration/LoginScreen.java @@ -73,7 +73,7 @@ public void actionPerformed(ActionEvent evt) { try { LoginResponseModel l = loginController.create(username.getText(), String.valueOf(password.getPassword())); - showMessageDialog(this, "% logged in.".format(username.getText())); + showMessageDialog(this, "Successfully logged in."); if (l.getTypeOfUser().equals("Instructor")) { cardLayout.show(screens, "InstructorMain"); } else { diff --git a/src/main/java/screens/login_registration/LogoutController.java b/src/main/java/screens/login_registration/LogoutController.java index ab42e48..67609bc 100644 --- a/src/main/java/screens/login_registration/LogoutController.java +++ b/src/main/java/screens/login_registration/LogoutController.java @@ -8,15 +8,13 @@ public class LogoutController { - final LogoutInputBoundary userInput; + final LogoutInputBoundary interactor; public LogoutController(LogoutInputBoundary accGateway) { - this.userInput = accGateway; + this.interactor = accGateway; } - LogoutResponseModel create(String name, String timeOfLogout) throws IOException { - LogoutRequestModel request = new LogoutRequestModel(); - - return userInput.create(request); + public void create() throws IOException { + interactor.create(); } } diff --git a/src/main/java/screens/login_registration/RegisterScreen.java b/src/main/java/screens/login_registration/RegisterScreen.java index 4bd5fcc..91c532b 100644 --- a/src/main/java/screens/login_registration/RegisterScreen.java +++ b/src/main/java/screens/login_registration/RegisterScreen.java @@ -110,7 +110,7 @@ public void actionPerformed(ActionEvent evt) { String.valueOf(password.getPassword()), String.valueOf(repeatPassword.getPassword()), String.valueOf(typeOfUser.getText())); - showMessageDialog(this, "%s created.".format(username.getText())); + showMessageDialog(this, "Registration successful and logged in"); if (String.valueOf(typeOfUser.getText()).equals("Student")) { cardLayout.show(screens, "StudentMain"); } else if (String.valueOf(typeOfUser.getText()).equals("Instructor")) { diff --git a/src/main/java/use_cases/login_registration/logout_usecase/LogoutInputBoundary.java b/src/main/java/use_cases/login_registration/logout_usecase/LogoutInputBoundary.java index e1f79c7..393ce4e 100644 --- a/src/main/java/use_cases/login_registration/logout_usecase/LogoutInputBoundary.java +++ b/src/main/java/use_cases/login_registration/logout_usecase/LogoutInputBoundary.java @@ -4,10 +4,8 @@ public interface LogoutInputBoundary { - /** - * @param request the request to logout - * @return the logout response + /** Save a User's information into the database before they log out * @throws IOException */ - LogoutResponseModel create(LogoutRequestModel request) throws IOException; + void create() throws IOException; } diff --git a/src/main/java/use_cases/login_registration/logout_usecase/LogoutInteractor.java b/src/main/java/use_cases/login_registration/logout_usecase/LogoutInteractor.java index 4470846..327f8a1 100644 --- a/src/main/java/use_cases/login_registration/logout_usecase/LogoutInteractor.java +++ b/src/main/java/use_cases/login_registration/logout_usecase/LogoutInteractor.java @@ -1,5 +1,6 @@ package use_cases.login_registration.logout_usecase; +import entities.CurrentUser; import entities.InstructorUser; import entities.StudentUser; import entities.User; @@ -18,31 +19,24 @@ public class LogoutInteractor implements LogoutInputBoundary { */ final LogoutGateway userGateway; - final LogoutPresenter userPresenter; - - final User user; + private User user; /** * @param gateway the logout gateway (which interacts with the User database) - * @param logoutPresenter the logout presenter - * @param u the User that is logging out */ - public LogoutInteractor(LogoutGateway gateway, LogoutPresenter logoutPresenter, User u) { + public LogoutInteractor(LogoutGateway gateway) { this.userGateway = gateway; - this.userPresenter = logoutPresenter; - this.user = u; + this.user = CurrentUser.getCurrentUser(); } /** * Save a new UserRegSaveRequest which contains all of the information in the User that is trying to * log out into the User database. - * @param request the request to logout - * @return the logout response * @throws IOException if logout fails */ @Override - public LogoutResponseModel create(LogoutRequestModel request) throws IOException { - + public void create() throws IOException { + this.user = CurrentUser.getCurrentUser(); LocalDateTime now = LocalDateTime.now(); UserRegSaveRequest userModel; @@ -58,8 +52,5 @@ public LogoutResponseModel create(LogoutRequestModel request) throws IOException } userGateway.save(userModel); - - LogoutResponseModel accResponseModel = new LogoutResponseModel(user.getName(), now.toString()); - return userPresenter.prepareSuccessView(accResponseModel); } } diff --git a/src/main/java/use_cases/login_registration/user_register_usecase/UserRegInteractor.java b/src/main/java/use_cases/login_registration/user_register_usecase/UserRegInteractor.java index 2050604..e730a2e 100644 --- a/src/main/java/use_cases/login_registration/user_register_usecase/UserRegInteractor.java +++ b/src/main/java/use_cases/login_registration/user_register_usecase/UserRegInteractor.java @@ -52,13 +52,10 @@ public UserRegResponse create(UserRegRequest request) throws IOException { if (request.getTypeOfUser().equals("Instructor")) { this.user = userFactory.createInstructor(request.getName(), request.getPassword()); - } else //if (request.getTypeOfUser().equals("Student")) + } else // initialize a StudentUser { this.user = userFactory.createStudent(request.getName(), request.getPassword()); } -// else { -// this.user = null; -// } if (!user.checkPassword()) { return userPresenter.prepareFailView("Password must be at least 9 characters long"); diff --git a/src/test/java/logout_usecase/LogoutInteractorTest.java b/src/test/java/logout_usecase/LogoutInteractorTest.java index be88ba4..b34f6e5 100644 --- a/src/test/java/logout_usecase/LogoutInteractorTest.java +++ b/src/test/java/logout_usecase/LogoutInteractorTest.java @@ -43,14 +43,10 @@ public LogoutResponseModel prepareFailView(String error) { }; User u = new InstructorUser("paul", "123456789"); - LogoutInputBoundary interactor = new LogoutInteractor(userRepository, presenter, u); - - // 2) Input data — we can make this up for the test. Normally it would - // be created by the Controller. - LogoutRequestModel request = new LogoutRequestModel(); + LogoutInputBoundary interactor = new LogoutInteractor(userRepository); // 3) Run the use case - interactor.create(request); + interactor.create(); // was the user saved after logout? assert ((InMemoryUser) userRepository).existsByName("paul"); From b96197d4623b147e67fa0b5897a51b6881d79724 Mon Sep 17 00:00:00 2001 From: CC-3636 Date: Fri, 2 Dec 2022 20:26:58 -0500 Subject: [PATCH 05/15] changed logout interactor test to suit changes --- .../logout_usecase/LogoutInteractorTest.java | 25 ++----------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/src/test/java/logout_usecase/LogoutInteractorTest.java b/src/test/java/logout_usecase/LogoutInteractorTest.java index b34f6e5..f80acaf 100644 --- a/src/test/java/logout_usecase/LogoutInteractorTest.java +++ b/src/test/java/logout_usecase/LogoutInteractorTest.java @@ -1,9 +1,6 @@ package logout_usecase; -import entities.GeneralUserFactory; -import entities.InstructorUser; -import entities.User; -import entities.UserFactory; +import entities.*; import org.junit.jupiter.api.Test; import screens.login_registration.InMemoryUser; import screens.login_registration.LogoutResponseFormatter; @@ -23,26 +20,8 @@ void create() throws IOException { LogoutGateway userRepository = new InMemoryUser(); - // This creates an anonymous implementing class for the Output Boundary. - LogoutPresenter presenter = new LogoutResponseFormatter() { - - @Override - public LogoutResponseModel prepareSuccessView(LogoutResponseModel logout) { - // 4) Check that the Output Data and associated changes - // are correct - assertEquals("paul", logout.getName()); - assertNotNull(logout.getLogoutTime()); // any creation time is fine. - return null; - } - - public LogoutResponseModel prepareFailView(String error) { - fail("Use case failure is unexpected."); - return null; - } - - }; - User u = new InstructorUser("paul", "123456789"); + CurrentUser.setCurrentUser(u); LogoutInputBoundary interactor = new LogoutInteractor(userRepository); // 3) Run the use case From 346afbf2d115021ac5adcbc808f96d382954fe67 Mon Sep 17 00:00:00 2001 From: CC-3636 Date: Fri, 2 Dec 2022 20:37:22 -0500 Subject: [PATCH 06/15] removed unused imports, etc. to fix checks --- .../screens/login_registration/LoginScreen.java | 6 ------ .../login_registration/LogoutController.java | 2 -- .../LogoutResponseFormatter.java | 17 ----------------- .../login_registration/RegisterScreen.java | 14 -------------- .../logout_usecase/LogoutInputBoundary.java | 2 +- .../logout_usecase/LogoutRequestModel.java | 4 ---- .../logout_usecase/LogoutResponseModel.java | 8 -------- .../logout_usecase/LogoutInteractorTest.java | 13 ++++--------- 8 files changed, 5 insertions(+), 61 deletions(-) delete mode 100644 src/main/java/screens/login_registration/LogoutResponseFormatter.java delete mode 100644 src/main/java/use_cases/login_registration/logout_usecase/LogoutRequestModel.java diff --git a/src/main/java/screens/login_registration/LoginScreen.java b/src/main/java/screens/login_registration/LoginScreen.java index b9afac1..777d9e1 100644 --- a/src/main/java/screens/login_registration/LoginScreen.java +++ b/src/main/java/screens/login_registration/LoginScreen.java @@ -49,17 +49,11 @@ public LoginScreen(LoginController controller, CardLayout cardLayout, JPanel scr logIn.addActionListener(this); cancel.addActionListener(this); -// JPanel main = new JPanel(); -// main.setLayout(new BoxLayout(main, BoxLayout.Y_AXIS)); this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); -// this.add(title); this.add(usernameInfo); this.add(passwordInfo); this.add(buttons); -// this.setContentPane(main); -// -// this.pack(); } /** diff --git a/src/main/java/screens/login_registration/LogoutController.java b/src/main/java/screens/login_registration/LogoutController.java index 67609bc..8e82009 100644 --- a/src/main/java/screens/login_registration/LogoutController.java +++ b/src/main/java/screens/login_registration/LogoutController.java @@ -1,8 +1,6 @@ package screens.login_registration; import use_cases.login_registration.logout_usecase.LogoutInputBoundary; -import use_cases.login_registration.logout_usecase.LogoutRequestModel; -import use_cases.login_registration.logout_usecase.LogoutResponseModel; import java.io.IOException; diff --git a/src/main/java/screens/login_registration/LogoutResponseFormatter.java b/src/main/java/screens/login_registration/LogoutResponseFormatter.java deleted file mode 100644 index c625e26..0000000 --- a/src/main/java/screens/login_registration/LogoutResponseFormatter.java +++ /dev/null @@ -1,17 +0,0 @@ -package screens.login_registration; - -import use_cases.login_registration.logout_usecase.LogoutPresenter; -import use_cases.login_registration.logout_usecase.LogoutResponseModel; - -public class LogoutResponseFormatter implements LogoutPresenter { - - /** - * @param logout the logout response - * @return the successful logout view - */ - @Override - public LogoutResponseModel prepareSuccessView(LogoutResponseModel logout) { - return logout; - } - -} diff --git a/src/main/java/screens/login_registration/RegisterScreen.java b/src/main/java/screens/login_registration/RegisterScreen.java index 91c532b..06ec28b 100644 --- a/src/main/java/screens/login_registration/RegisterScreen.java +++ b/src/main/java/screens/login_registration/RegisterScreen.java @@ -53,10 +53,6 @@ public RegisterScreen(UserRegController controller, CardLayout cardLayout, JPane JLabel title = new JLabel("Register Screen"); title.setAlignmentX(Component.CENTER_ALIGNMENT); -// JPanel userButtons = new JPanel(); -// userButtons.add(instructor); -// userButtons.add(student); - LabelTextPanel usernameInfo = new LabelTextPanel( new JLabel("Choose username"), username); LabelTextPanel passwordInfo = new LabelTextPanel( @@ -65,8 +61,6 @@ public RegisterScreen(UserRegController controller, CardLayout cardLayout, JPane new JLabel("Enter password again"), repeatPassword); LabelTextPanel chooseTypeOfUser = new LabelTextPanel( new JLabel("I am a (type 'Instructor' or 'Student')") , typeOfUser); -// JLabel chooseTypeOfUser = new JLabel("I am a:"); -// userButtons.add(chooseTypeOfUser); JButton signUp = new JButton("Sign up"); JButton cancel = new JButton("Cancel"); @@ -75,11 +69,8 @@ public RegisterScreen(UserRegController controller, CardLayout cardLayout, JPane buttons.add(signUp); buttons.add(cancel); -// typeOfUser.addActionListener(this); signUp.addActionListener(this); cancel.addActionListener(this); -// instructor.addActionListener(this); -// student.addActionListener(this); this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); @@ -89,13 +80,8 @@ public RegisterScreen(UserRegController controller, CardLayout cardLayout, JPane this.add(repeatPasswordInfo); this.add(chooseTypeOfUser); this.add(buttons); -// this.add(userButtons); - } -// private void add(LabelTextPanel usernameInfo) { -// } - /** * React to a button click that results in event. */ diff --git a/src/main/java/use_cases/login_registration/logout_usecase/LogoutInputBoundary.java b/src/main/java/use_cases/login_registration/logout_usecase/LogoutInputBoundary.java index 393ce4e..ef5b3d0 100644 --- a/src/main/java/use_cases/login_registration/logout_usecase/LogoutInputBoundary.java +++ b/src/main/java/use_cases/login_registration/logout_usecase/LogoutInputBoundary.java @@ -5,7 +5,7 @@ public interface LogoutInputBoundary { /** Save a User's information into the database before they log out - * @throws IOException + * @throws IOException if saving not successful */ void create() throws IOException; } diff --git a/src/main/java/use_cases/login_registration/logout_usecase/LogoutRequestModel.java b/src/main/java/use_cases/login_registration/logout_usecase/LogoutRequestModel.java deleted file mode 100644 index 7fbeeb2..0000000 --- a/src/main/java/use_cases/login_registration/logout_usecase/LogoutRequestModel.java +++ /dev/null @@ -1,4 +0,0 @@ -package use_cases.login_registration.logout_usecase; - -public class LogoutRequestModel { -} diff --git a/src/main/java/use_cases/login_registration/logout_usecase/LogoutResponseModel.java b/src/main/java/use_cases/login_registration/logout_usecase/LogoutResponseModel.java index 02129bc..2b9cb07 100644 --- a/src/main/java/use_cases/login_registration/logout_usecase/LogoutResponseModel.java +++ b/src/main/java/use_cases/login_registration/logout_usecase/LogoutResponseModel.java @@ -22,12 +22,4 @@ public LogoutResponseModel(String name, String timeOfLogout) { public void setName(String username) { this.name = username; } - public String getLogoutTime() { - return logoutTime; - } - - public void setLogoutTime(String TimeOfLogout) { - this.logoutTime = TimeOfLogout; - } - } diff --git a/src/test/java/logout_usecase/LogoutInteractorTest.java b/src/test/java/logout_usecase/LogoutInteractorTest.java index f80acaf..c797386 100644 --- a/src/test/java/logout_usecase/LogoutInteractorTest.java +++ b/src/test/java/logout_usecase/LogoutInteractorTest.java @@ -3,31 +3,26 @@ import entities.*; import org.junit.jupiter.api.Test; import screens.login_registration.InMemoryUser; -import screens.login_registration.LogoutResponseFormatter; -import screens.login_registration.UserRegResponseFormatter; import use_cases.login_registration.logout_usecase.*; -import use_cases.login_registration.user_register_usecase.*; import java.io.IOException; -import static org.junit.jupiter.api.Assertions.*; -import static org.junit.jupiter.api.Assertions.fail; - public class LogoutInteractorTest { @Test void create() throws IOException { - LogoutGateway userRepository = new InMemoryUser(); + InMemoryUser userRepository = new InMemoryUser(); - User u = new InstructorUser("paul", "123456789"); + User u = new InstructorUser("jallope", "123456789"); CurrentUser.setCurrentUser(u); + LogoutInputBoundary interactor = new LogoutInteractor(userRepository); // 3) Run the use case interactor.create(); // was the user saved after logout? - assert ((InMemoryUser) userRepository).existsByName("paul"); + assert userRepository.existsByName("jallope"); } } From d3cc55de8c76a1dd40791dd8ed6df2634c29a8e4 Mon Sep 17 00:00:00 2001 From: CC-3636 Date: Fri, 2 Dec 2022 21:20:25 -0500 Subject: [PATCH 07/15] commented out parts that still pull user from main and into their interactors (please change these to use CurrentUser) --- src/main/java/Main.java | 62 +++++++++++++++++------------------ src/main/java/data/users.ser | Bin 1272 -> 1272 bytes 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/main/java/Main.java b/src/main/java/Main.java index f2c4943..0f6cb62 100644 --- a/src/main/java/Main.java +++ b/src/main/java/Main.java @@ -58,31 +58,31 @@ public static void main(String[] args) throws IOException, ClassNotFoundExceptio // initialize User based on whether they log in or register // if you don't register, then you are logging in: - User user; - if ((((UserRegInteractor) userInteractor).getUser() instanceof StudentUser) | - (((UserRegInteractor) userInteractor).getUser() instanceof InstructorUser)) { - user = ((UserRegInteractor) userInteractor).getUser(); - } else { - user = ((LoginInteractor) loginInteractor).getUser(); - } +// User user; +// if ((((UserRegInteractor) userInteractor).getUser() instanceof StudentUser) | +// (((UserRegInteractor) userInteractor).getUser() instanceof InstructorUser)) { +// user = ((UserRegInteractor) userInteractor).getUser(); +// } else { +// user = ((LoginInteractor) loginInteractor).getUser(); +// } SchedulerPresenter schedulerPresenter = new SchedulerResponseFormatter(); ScheduleConflictPresenter scheduleConflictPresenter = new ScheduleConflictResponseFormatter(); - EventCreationPresenter eventPresenter = new EventCreationResponseFormatter(); - EventCreationInputBoundary eventInteractor = new EventCreationInteractor(eventPresenter, (StudentUser) user, - schedulerPresenter, scheduleConflictPresenter); - EventCreationController eventCreationController = new EventCreationController(eventInteractor); - - ProgressTrackerOutputBoundary trackerPresenter = new ProgressTrackerPresenter(); - ProgressTrackerInputBoundary trackerInteractor = new ProgressTrackerInteractor(trackerPresenter); - ProgressTrackerController trackerController = new ProgressTrackerController(trackerInteractor, user, "", allTasks, allUsers, allCourses); - - ScheduleCTViewInterface presentOutputInterface = new ScheduleCTView(cardLayout, screens); - ScheduleCTOutputBoundary scheduleCTOutputBoundary = new ScheduleCTPresenter(presentOutputInterface); - ScheduleCTInputBoundary scheduleCTInputBoundary = new ScheduleCTInteractor(scheduleCTOutputBoundary); - ScheduleCTController scheduleCTController = new ScheduleCTController(scheduleCTInputBoundary, allTasks, (StudentUser) user); +// EventCreationPresenter eventPresenter = new EventCreationResponseFormatter(); +// EventCreationInputBoundary eventInteractor = new EventCreationInteractor(eventPresenter, (StudentUser) user, +// schedulerPresenter, scheduleConflictPresenter); +// EventCreationController eventCreationController = new EventCreationController(eventInteractor); +// +// ProgressTrackerOutputBoundary trackerPresenter = new ProgressTrackerPresenter(); +// ProgressTrackerInputBoundary trackerInteractor = new ProgressTrackerInteractor(trackerPresenter); +// ProgressTrackerController trackerController = new ProgressTrackerController(trackerInteractor, user, "", allTasks, allUsers, allCourses); +// +// ScheduleCTViewInterface presentOutputInterface = new ScheduleCTView(cardLayout, screens); +// ScheduleCTOutputBoundary scheduleCTOutputBoundary = new ScheduleCTPresenter(presentOutputInterface); +// ScheduleCTInputBoundary scheduleCTInputBoundary = new ScheduleCTInteractor(scheduleCTOutputBoundary); +// ScheduleCTController scheduleCTController = new ScheduleCTController(scheduleCTInputBoundary, allTasks, (StudentUser) user); CourseCreationDsGateway course; try { @@ -102,17 +102,17 @@ public static void main(String[] args) throws IOException, ClassNotFoundExceptio // // Build the GUI - EventCreationScreen taskScreen = new EventCreationScreen(eventCreationController, screens, cardLayout); - screens.add("toDoList", taskScreen); - - CalendarScreen calendarScreen = new CalendarScreen((StudentUser) user, allTasks, screens, cardLayout); - screens.add("calendar", calendarScreen); - - ScheduleCTScreen scheduleCTScreen = new ScheduleCTScreen(scheduleCTController, screens, cardLayout); - screens.add("scheduleCT", scheduleCTScreen); - - ProgressTrackerScreen progressTrackerScreen = new ProgressTrackerScreen(trackerController); - screens.add("tracker", progressTrackerScreen); +// EventCreationScreen taskScreen = new EventCreationScreen(eventCreationController, screens, cardLayout); +// screens.add("toDoList", taskScreen); +// +// CalendarScreen calendarScreen = new CalendarScreen((StudentUser) user, allTasks, screens, cardLayout); +// screens.add("calendar", calendarScreen); +// +// ScheduleCTScreen scheduleCTScreen = new ScheduleCTScreen(scheduleCTController, screens, cardLayout); +// screens.add("scheduleCT", scheduleCTScreen); +// +// ProgressTrackerScreen progressTrackerScreen = new ProgressTrackerScreen(trackerController); +// screens.add("tracker", progressTrackerScreen); CourseCreationScreen courseCreationScreen = new CourseCreationScreen(courseCreationController, screens, cardLayout); screens.add("course", courseCreationScreen); diff --git a/src/main/java/data/users.ser b/src/main/java/data/users.ser index fcbfbba557f5b969ff62c78d3028e15596fb09f5..47fa50d4c7323f5089dc89b539b2249d184f21d7 100644 GIT binary patch delta 20 ccmeyt`Ga#q028|?uPML5f;F4NnHDku07`%cod5s; delta 20 bcmeyt`Ga#q028~2ge+%F@tMuxObeL+N~{K` From 88eb1f676aa5a0afa5605d437279fe3b09a28b5c Mon Sep 17 00:00:00 2001 From: CC-3636 Date: Fri, 2 Dec 2022 23:21:02 -0500 Subject: [PATCH 08/15] got rid of unnecessary lines in main (the lines 60-62 part) and commented out the parts that don't work because they require a user to be initialized --- src/main/java/Main.java | 11 ----------- src/main/java/data/users.ser | Bin 1272 -> 1272 bytes src/test/java/data/userstest.ser | Bin 1304 -> 1304 bytes 3 files changed, 11 deletions(-) diff --git a/src/main/java/Main.java b/src/main/java/Main.java index 0f6cb62..647e379 100644 --- a/src/main/java/Main.java +++ b/src/main/java/Main.java @@ -54,17 +54,6 @@ public static void main(String[] args) throws IOException, ClassNotFoundExceptio LoginPresenter loginPresenter = new LoginResponseFormatter(); LoginInputBoundary loginInteractor = new LoginInteractor(loginUser, loginPresenter); LoginController loginController = new LoginController(loginInteractor); - // - - // initialize User based on whether they log in or register - // if you don't register, then you are logging in: -// User user; -// if ((((UserRegInteractor) userInteractor).getUser() instanceof StudentUser) | -// (((UserRegInteractor) userInteractor).getUser() instanceof InstructorUser)) { -// user = ((UserRegInteractor) userInteractor).getUser(); -// } else { -// user = ((LoginInteractor) loginInteractor).getUser(); -// } SchedulerPresenter schedulerPresenter = new SchedulerResponseFormatter(); diff --git a/src/main/java/data/users.ser b/src/main/java/data/users.ser index 47fa50d4c7323f5089dc89b539b2249d184f21d7..af552fa7d7582f07dc442596ce2e90a5846b9a21 100644 GIT binary patch delta 20 bcmeyt`Ga#q028~o2n!?c)rigEObeL+M&Je| delta 20 ccmeyt`Ga#q028|?uPML5f;F4NnHDku07`%cod5s; diff --git a/src/test/java/data/userstest.ser b/src/test/java/data/userstest.ser index 4adea51d75d1eb0833fed45216c949ed6987c094..cf350da4b900db982da0c29697e808aea341cbd0 100644 GIT binary patch delta 56 zcmbQiHG^xzHAZ%EVRg$TY(F;NWo(CYCTBBm1xZ-^obhC`I?E;y+tmLA$K(er762C! B643wv delta 56 zcmbQiHG^xzHAZ$mX*MzT?Nc`2Wo(CYCTBBm1xbj8)Et?t&aw%_7Vw;ZW%2_S3jozP B5Z3?z From 2628e387333a3ee7dcc929515f56c343a57828d7 Mon Sep 17 00:00:00 2001 From: alyson647 Date: Sat, 3 Dec 2022 01:48:41 -0500 Subject: [PATCH 09/15] Removed all tasks parameter, added screen to main, changed references to main to StudentMain and InstructorMain --- src/main/java/Main.java | 11 +- .../ScheduleCTController.java | 26 ++-- .../ScheduleCTFormatter.java | 23 --- .../ScheduleCTPresenter.java | 12 +- .../ScheduleCTScreen.java | 1 + .../ScheduleCTView.java | 18 ++- .../ScheduleCTViewInterface.java | 7 +- .../ChooseTaskCreateScreen.java | 2 +- .../AssignmentCreationScreen.java | 4 +- .../InstructorAssignmentCreationScreen.java | 4 +- .../EventCreationScreen.java | 2 +- .../InstructorTestCreationScreen.java | 4 +- .../TestCreationScreen.java | 4 +- .../AssignmentEditDeleteScreen.java | 4 +- .../EventEditDeleteScreen.java | 4 +- .../TestEditDeleteScreen.java | 4 +- .../ScheduleCTInputBoundary.java | 6 +- .../ScheduleCTInteractor.java | 139 ++++++++++-------- .../ScheduleCTRequestModel.java | 12 +- .../ScheduleCTResponseModel.java | 7 +- 20 files changed, 135 insertions(+), 159 deletions(-) delete mode 100644 src/main/java/screens/collaborative_task_scheduling/ScheduleCTFormatter.java diff --git a/src/main/java/Main.java b/src/main/java/Main.java index 08c3e18..9ef09ba 100644 --- a/src/main/java/Main.java +++ b/src/main/java/Main.java @@ -78,10 +78,10 @@ public static void main(String[] args) throws IOException, ClassNotFoundExceptio ProgressTrackerInputBoundary trackerInteractor = new ProgressTrackerInteractor(trackerPresenter); ProgressTrackerController trackerController = new ProgressTrackerController(trackerInteractor, user, "", TaskMap.getTaskMap(), allUsers, allCourses); - ScheduleCTViewInterface presentOutputInterface = new ScheduleCTView(cardLayout, screens); - ScheduleCTOutputBoundary scheduleCTOutputBoundary = new ScheduleCTPresenter(presentOutputInterface); - ScheduleCTInputBoundary scheduleCTInputBoundary = new ScheduleCTInteractor(scheduleCTOutputBoundary); - ScheduleCTController scheduleCTController = new ScheduleCTController(scheduleCTInputBoundary, TaskMap.getTaskMap(), (StudentUser) user); + ScheduleCTViewInterface scheduleCTOutputView = new ScheduleCTView(cardLayout, screens); + ScheduleCTOutputBoundary scheduleCTPresenter = new ScheduleCTPresenter(scheduleCTOutputView); + ScheduleCTInputBoundary scheduleCTInteractor = new ScheduleCTInteractor(scheduleCTPresenter); + ScheduleCTController scheduleCTController = new ScheduleCTController(scheduleCTInteractor, user); CourseCreationDsGateway course; try { @@ -107,6 +107,7 @@ public static void main(String[] args) throws IOException, ClassNotFoundExceptio ScheduleCTScreen scheduleCTScreen = new ScheduleCTScreen(scheduleCTController, screens, cardLayout); screens.add("scheduleCT", scheduleCTScreen); + screens.add("scheduleCTView", (Component) scheduleCTOutputView); ProgressTrackerScreen progressTrackerScreen = new ProgressTrackerScreen(trackerController); screens.add("tracker", progressTrackerScreen); @@ -115,7 +116,7 @@ public static void main(String[] args) throws IOException, ClassNotFoundExceptio screens.add("course", courseCreationScreen); StudentMainScreen studentMainScreen = new StudentMainScreen((StudentUser)user, screens, cardLayout); - screens.add("main", studentMainScreen); + screens.add("StudentMain", studentMainScreen); RegisterScreen registerScreen = new RegisterScreen(userRegisterController, cardLayout, screens); screens.add("register", registerScreen); diff --git a/src/main/java/screens/collaborative_task_scheduling/ScheduleCTController.java b/src/main/java/screens/collaborative_task_scheduling/ScheduleCTController.java index 2b85a3b..60371e4 100644 --- a/src/main/java/screens/collaborative_task_scheduling/ScheduleCTController.java +++ b/src/main/java/screens/collaborative_task_scheduling/ScheduleCTController.java @@ -1,11 +1,8 @@ package screens.collaborative_task_scheduling; -import entities.StudentUser; -import entities.Task; + import use_cases.collaborative_task_scheduling.scheduling_ct_use_case.ScheduleCTInputBoundary; import use_cases.collaborative_task_scheduling.scheduling_ct_use_case.ScheduleCTRequestModel; -import use_cases.collaborative_task_scheduling.scheduling_ct_use_case.ScheduleCTResponseModel; -import java.util.HashMap; /** * Controller for the Scheduling Collaborative Tasks Use Case @@ -16,33 +13,28 @@ public class ScheduleCTController { final ScheduleCTInputBoundary scheduleInput; - private final HashMap hashMap; - - private final StudentUser studentUser; + private final Object studentUser; /** * Constructor for ScheduleCTController * @param scheduleInput - the scheduleCTInputBoundary - * @param hashMap - a hash map of all task ids mapped to the task object * @param studentUser - the current student user logged in */ - public ScheduleCTController(ScheduleCTInputBoundary scheduleInput, HashMap hashMap, StudentUser studentUser) { + public ScheduleCTController(ScheduleCTInputBoundary scheduleInput, Object studentUser) { this.scheduleInput = scheduleInput; - this.hashMap = hashMap; this.studentUser = studentUser; } /** * Bundles information given by user as well as ScheduleCTController instance variables into a * ScheduleCTRequestModel, scheduling that input - * @param taskName - the string title/name of the task + * + * @param taskName - the string title/name of the task * @param startTime - the string representation of the start date and time the user wants to schedule - * @param endTime - the string representation of the end date and time the user wants to schedule - * @return a scheduleCTResponseModel + * @param endTime - the string representation of the end date and time the user wants to schedule */ - public ScheduleCTResponseModel isConflict(String taskName, String startTime, String endTime) { + public void isConflict(String taskName, String startTime, String endTime) { ScheduleCTRequestModel inputData = new ScheduleCTRequestModel(taskName, startTime, endTime, studentUser); - return scheduleInput.schedule(inputData, this.hashMap); + scheduleInput.schedule(inputData); } - -} +} \ No newline at end of file diff --git a/src/main/java/screens/collaborative_task_scheduling/ScheduleCTFormatter.java b/src/main/java/screens/collaborative_task_scheduling/ScheduleCTFormatter.java deleted file mode 100644 index e3ebf91..0000000 --- a/src/main/java/screens/collaborative_task_scheduling/ScheduleCTFormatter.java +++ /dev/null @@ -1,23 +0,0 @@ -package screens.collaborative_task_scheduling; - -import java.util.ArrayList; - -/** - * Model for passing information from ScheduleCTPresenter to ScheduleCTView - */ -public class ScheduleCTFormatter { - - /** - * The dates and times that will be presented to the user - */ - private final ArrayList scheduledDateTimes; - - public ScheduleCTFormatter(ArrayList scheduledDateTimes) { - this.scheduledDateTimes = scheduledDateTimes; - } - - public ArrayList getScheduledDateTimes() { - return scheduledDateTimes; - } - -} diff --git a/src/main/java/screens/collaborative_task_scheduling/ScheduleCTPresenter.java b/src/main/java/screens/collaborative_task_scheduling/ScheduleCTPresenter.java index 2b9e133..288f26f 100644 --- a/src/main/java/screens/collaborative_task_scheduling/ScheduleCTPresenter.java +++ b/src/main/java/screens/collaborative_task_scheduling/ScheduleCTPresenter.java @@ -2,7 +2,6 @@ import use_cases.collaborative_task_scheduling.scheduling_ct_use_case.ScheduleCTOutputBoundary; import use_cases.collaborative_task_scheduling.scheduling_ct_use_case.ScheduleCTResponseModel; -import java.util.ArrayList; /** * Presenter for the Collaborative Scheduling Use Case @@ -25,14 +24,9 @@ public ScheduleCTPresenter(ScheduleCTViewInterface scheduleCTViewInterface) { @Override public ScheduleCTResponseModel prepareNoConflictView(ScheduleCTResponseModel responseModel) { - ArrayList availableDates = responseModel.getScheduledTimes(); + scheduleCTViewInterface.present(responseModel); - // making an instance of a class between presenter and view that can communicate information - ScheduleCTFormatter scheduleCTFormatter = new ScheduleCTFormatter(availableDates); - - scheduleCTViewInterface.present(scheduleCTFormatter); - - return responseModel; + return null; } /** @@ -44,4 +38,4 @@ public ScheduleCTResponseModel prepareNoConflictView(ScheduleCTResponseModel res public ScheduleCTResponseModel prepareFailView(String error) { throw new SchedulingTimesFailed(error); } -} +} \ No newline at end of file diff --git a/src/main/java/screens/collaborative_task_scheduling/ScheduleCTScreen.java b/src/main/java/screens/collaborative_task_scheduling/ScheduleCTScreen.java index a077d94..fbe582e 100644 --- a/src/main/java/screens/collaborative_task_scheduling/ScheduleCTScreen.java +++ b/src/main/java/screens/collaborative_task_scheduling/ScheduleCTScreen.java @@ -86,6 +86,7 @@ public void actionPerformed(ActionEvent evt) { } else if (evt.getActionCommand().equals("Schedule")) { try { scheduleCTController.isConflict(taskTitle.getText(), startTime.getText(), endTime.getText()); + screenLayout.show(screens, "scheduleCTView"); } catch (Exception e) { JOptionPane.showMessageDialog(this, e.getMessage()); } diff --git a/src/main/java/screens/collaborative_task_scheduling/ScheduleCTView.java b/src/main/java/screens/collaborative_task_scheduling/ScheduleCTView.java index 3f955a3..9b8a7ed 100644 --- a/src/main/java/screens/collaborative_task_scheduling/ScheduleCTView.java +++ b/src/main/java/screens/collaborative_task_scheduling/ScheduleCTView.java @@ -1,5 +1,7 @@ package screens.collaborative_task_scheduling; +import use_cases.collaborative_task_scheduling.scheduling_ct_use_case.ScheduleCTResponseModel; + import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; @@ -26,20 +28,22 @@ public ScheduleCTView(CardLayout screenLayout, JPanel screens) { /** * Method implemented from PresentOutputInterface which presents the dates the user wishes to schedule - * @param scheduleCTFormatter - a ScheduleCTFormatter which stores the dates to present + * @param responseModel - a ScheduleCTResponseModel which stores the dates to present */ @Override - public void present(ScheduleCTFormatter scheduleCTFormatter) { - ArrayList dateTimes = scheduleCTFormatter.getScheduledDateTimes(); + public void present(ScheduleCTResponseModel responseModel) { + ArrayList dateTimes = responseModel.getScheduledTimes(); JLabel title = new JLabel("Scheduled Times"); title.setAlignmentX(Component.CENTER_ALIGNMENT); - JPanel labels = new JPanel(); + this.add(title); for (String timeBlock : dateTimes) { + JPanel timeLabel = new JPanel(); JLabel time = new JLabel(timeBlock); - labels.add(time); + timeLabel.add(time); + this.add(timeLabel); } JPanel separateNote = new JPanel(); @@ -55,8 +59,6 @@ public void present(ScheduleCTFormatter scheduleCTFormatter) { this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); - this.add(title); - this.add(labels); this.add(separateNote); this.add(buttons); } @@ -68,4 +70,4 @@ public void actionPerformed(ActionEvent evt) { JOptionPane.showMessageDialog(this, e.getMessage()); } } -} +} \ No newline at end of file diff --git a/src/main/java/screens/collaborative_task_scheduling/ScheduleCTViewInterface.java b/src/main/java/screens/collaborative_task_scheduling/ScheduleCTViewInterface.java index ac2ecac..090b836 100644 --- a/src/main/java/screens/collaborative_task_scheduling/ScheduleCTViewInterface.java +++ b/src/main/java/screens/collaborative_task_scheduling/ScheduleCTViewInterface.java @@ -1,4 +1,5 @@ package screens.collaborative_task_scheduling; +import use_cases.collaborative_task_scheduling.scheduling_ct_use_case.ScheduleCTResponseModel; /** @@ -9,7 +10,7 @@ public interface ScheduleCTViewInterface { /** * The method implemented in the view that prepares a screen showing the dates that were scheduled - * @param scheduleCTFormatter - a scheduleCTFormatter + * @param responseModel - a scheduleCTFormatter */ - void present(ScheduleCTFormatter scheduleCTFormatter); -} + void present(ScheduleCTResponseModel responseModel); +} \ No newline at end of file diff --git a/src/main/java/screens/task_management/task_creation_screens/ChooseTaskCreateScreen.java b/src/main/java/screens/task_management/task_creation_screens/ChooseTaskCreateScreen.java index 17cd5a2..22421e4 100644 --- a/src/main/java/screens/task_management/task_creation_screens/ChooseTaskCreateScreen.java +++ b/src/main/java/screens/task_management/task_creation_screens/ChooseTaskCreateScreen.java @@ -75,7 +75,7 @@ public ChooseTaskCreateScreen(User user, SchedulerPresenter schedulerPresenter, @Override public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("Cancel")) { // go back to main - cardLayout.show(screens, "main"); + cardLayout.show(screens, "StudentMain"); } // create use case components for task creation TaskCreationOutputBoundary taskCreationOutputBoundary = new TaskCreationResponseFormatter(); diff --git a/src/main/java/screens/task_management/task_creation_screens/assignment_creation_screens/AssignmentCreationScreen.java b/src/main/java/screens/task_management/task_creation_screens/assignment_creation_screens/AssignmentCreationScreen.java index 18b7523..c231107 100644 --- a/src/main/java/screens/task_management/task_creation_screens/assignment_creation_screens/AssignmentCreationScreen.java +++ b/src/main/java/screens/task_management/task_creation_screens/assignment_creation_screens/AssignmentCreationScreen.java @@ -88,14 +88,14 @@ public void actionPerformed(ActionEvent evt) { assignmentController.create(title.getText(), valPriority, dueDate, valWeightage); showMessageDialog(this, "Assignment Created Successfully"); - screenLayout.show(screens, "main"); + screenLayout.show(screens, "StudentMain"); } catch (Exception e) { showMessageDialog(this, e.getMessage()); } } // if "Cancel" button pressed else if (evt.getActionCommand().equals("Cancel")) { - screenLayout.show(screens, "main"); + screenLayout.show(screens, "StudentMain"); } } } diff --git a/src/main/java/screens/task_management/task_creation_screens/assignment_creation_screens/InstructorAssignmentCreationScreen.java b/src/main/java/screens/task_management/task_creation_screens/assignment_creation_screens/InstructorAssignmentCreationScreen.java index 1517c90..0d17245 100644 --- a/src/main/java/screens/task_management/task_creation_screens/assignment_creation_screens/InstructorAssignmentCreationScreen.java +++ b/src/main/java/screens/task_management/task_creation_screens/assignment_creation_screens/InstructorAssignmentCreationScreen.java @@ -84,14 +84,14 @@ public void actionPerformed(ActionEvent evt) { assignmentController.create(title.getText(), 0, dueDate, valWeightage); showMessageDialog(this, "Assignment Created Successfully"); - screenLayout.show(screens, "main"); + screenLayout.show(screens, "InstructorMain"); } catch (Exception e) { showMessageDialog(this, e.getMessage()); } } // if "Cancel" button pressed else if (evt.getActionCommand().equals("Cancel")) { - screenLayout.show(screens, "main"); + screenLayout.show(screens, "InstructorMain"); } } } diff --git a/src/main/java/screens/task_management/task_creation_screens/event_creation_screens/EventCreationScreen.java b/src/main/java/screens/task_management/task_creation_screens/event_creation_screens/EventCreationScreen.java index b96705b..737d392 100644 --- a/src/main/java/screens/task_management/task_creation_screens/event_creation_screens/EventCreationScreen.java +++ b/src/main/java/screens/task_management/task_creation_screens/event_creation_screens/EventCreationScreen.java @@ -102,7 +102,7 @@ public void actionPerformed(ActionEvent evt) { startDate, endDate, valRecurring, valFrequency); showMessageDialog(this, "Event Created Successfully"); - screenLayout.show(screens, "main"); + screenLayout.show(screens, "StudentMain"); } catch (Exception e) { showMessageDialog(this, e.getMessage()); } diff --git a/src/main/java/screens/task_management/task_creation_screens/test_creation_screens/InstructorTestCreationScreen.java b/src/main/java/screens/task_management/task_creation_screens/test_creation_screens/InstructorTestCreationScreen.java index 9d631d7..42ac06e 100644 --- a/src/main/java/screens/task_management/task_creation_screens/test_creation_screens/InstructorTestCreationScreen.java +++ b/src/main/java/screens/task_management/task_creation_screens/test_creation_screens/InstructorTestCreationScreen.java @@ -89,14 +89,14 @@ public void actionPerformed(ActionEvent evt) { testController.create(title.getText(), 0, startDate, endDate, valWeightage); showMessageDialog(this, "Test Created Successfully"); - screenLayout.show(screens, "main"); + screenLayout.show(screens, "InstructorMain"); } catch (Exception e) { showMessageDialog(this, e.getMessage()); } } // if "Cancel" button pressed else if (evt.getActionCommand().equals("Cancel")) { - screenLayout.show(screens, "main"); + screenLayout.show(screens, "InstructorMain"); } } } diff --git a/src/main/java/screens/task_management/task_creation_screens/test_creation_screens/TestCreationScreen.java b/src/main/java/screens/task_management/task_creation_screens/test_creation_screens/TestCreationScreen.java index cb641b6..813c983 100644 --- a/src/main/java/screens/task_management/task_creation_screens/test_creation_screens/TestCreationScreen.java +++ b/src/main/java/screens/task_management/task_creation_screens/test_creation_screens/TestCreationScreen.java @@ -93,14 +93,14 @@ public void actionPerformed(ActionEvent evt) { testController.create(title.getText(), valPriority, startDate, endDate, valWeightage); showMessageDialog(this, "Test Created Successfully"); - screenLayout.show(screens, "main"); + screenLayout.show(screens, "StudentMain"); } catch (Exception e) { showMessageDialog(this, e.getMessage()); } } // if "Cancel" button pressed else if (evt.getActionCommand().equals("Cancel")) { - screenLayout.show(screens, "main"); + screenLayout.show(screens, "StudentMain"); } } } diff --git a/src/main/java/screens/task_management/task_edit_delete_screens/assignment_edit_delete_screens/AssignmentEditDeleteScreen.java b/src/main/java/screens/task_management/task_edit_delete_screens/assignment_edit_delete_screens/AssignmentEditDeleteScreen.java index c917017..d902c17 100644 --- a/src/main/java/screens/task_management/task_edit_delete_screens/assignment_edit_delete_screens/AssignmentEditDeleteScreen.java +++ b/src/main/java/screens/task_management/task_edit_delete_screens/assignment_edit_delete_screens/AssignmentEditDeleteScreen.java @@ -131,14 +131,14 @@ public void actionPerformed(ActionEvent e) { valTimeNeeded, valTimeSpent); showMessageDialog(this, "Assignment edited successfully"); // todo customize this message - screenLayout.show(screens, "main"); + screenLayout.show(screens, "StudentMain"); } // Assignment being deleted else if (e.getActionCommand().equals("Delete")) { taskDeletionController.delete(student, assignmentInfo.getId()); showMessageDialog(this, "Assignment deleted successfully"); - screenLayout.show(screens, "main"); + screenLayout.show(screens, "StudentMain"); } // Cancel button pressed else { diff --git a/src/main/java/screens/task_management/task_edit_delete_screens/event_edit_delete_screens/EventEditDeleteScreen.java b/src/main/java/screens/task_management/task_edit_delete_screens/event_edit_delete_screens/EventEditDeleteScreen.java index 67e0e69..ce615c4 100644 --- a/src/main/java/screens/task_management/task_edit_delete_screens/event_edit_delete_screens/EventEditDeleteScreen.java +++ b/src/main/java/screens/task_management/task_edit_delete_screens/event_edit_delete_screens/EventEditDeleteScreen.java @@ -129,13 +129,13 @@ public void actionPerformed(ActionEvent e) { // update user and return to main screen showMessageDialog(this, "Event edited successfully"); - screenLayout.show(screens, "main"); + screenLayout.show(screens, "StudentMain"); } else if (e.getActionCommand().equals("Delete")) { // delete Event taskDeletionController.delete(student, eventInfo.getId()); // update user and return to main screen showMessageDialog(this, "Event deleted successfully"); - screenLayout.show(screens, "main"); + screenLayout.show(screens, "StudentMain"); } else if (e.getActionCommand().equals("Cancel")) { // Edit cancelled screenLayout.show(screens, "toDoList"); } else { // checkbox pressed diff --git a/src/main/java/screens/task_management/task_edit_delete_screens/test_edit_delete_screens/TestEditDeleteScreen.java b/src/main/java/screens/task_management/task_edit_delete_screens/test_edit_delete_screens/TestEditDeleteScreen.java index 9caf987..ab94247 100644 --- a/src/main/java/screens/task_management/task_edit_delete_screens/test_edit_delete_screens/TestEditDeleteScreen.java +++ b/src/main/java/screens/task_management/task_edit_delete_screens/test_edit_delete_screens/TestEditDeleteScreen.java @@ -133,7 +133,7 @@ public void actionPerformed(ActionEvent e) { // update user and return to main list page showMessageDialog(this, "Test edited successfully."); // todo customize this message - screenLayout.show(screens, "main"); + screenLayout.show(screens, "StudentMain"); } else if (e.getActionCommand().equals("Delete")) { // Test being deleted taskDeletionController.delete(student, testInfo.getId()); @@ -141,7 +141,7 @@ public void actionPerformed(ActionEvent e) { showMessageDialog(this, "Test deleted successfully."); screenLayout.show(screens, "toDoList"); } else { // Test is racist - screenLayout.show(screens, "main"); + screenLayout.show(screens, "StudentMain"); } } catch (Exception ex) { showMessageDialog(this, ex.getMessage()); diff --git a/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTInputBoundary.java b/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTInputBoundary.java index 06dd107..3a9e7d4 100644 --- a/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTInputBoundary.java +++ b/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTInputBoundary.java @@ -1,8 +1,5 @@ package use_cases.collaborative_task_scheduling.scheduling_ct_use_case; -import entities.Task; - -import java.util.HashMap; /** * Input Boundary interface for the Scheduling Collaborative Tasks Use Case @@ -14,8 +11,7 @@ public interface ScheduleCTInputBoundary { /** * The method implemented in ScheduleCTInteractor that schedules the task given the inputs * @param scheduleCTRequestModel - the scheduleCTRequestModel (i.e. information given from the user) - * @param hashMap - hash map of task ids mapped to Task objects * @return a scheduleCTResponseModel */ - ScheduleCTResponseModel schedule(ScheduleCTRequestModel scheduleCTRequestModel, HashMap hashMap); + ScheduleCTResponseModel schedule(ScheduleCTRequestModel scheduleCTRequestModel); } \ No newline at end of file diff --git a/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTInteractor.java b/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTInteractor.java index 2b54fd3..96c5681 100644 --- a/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTInteractor.java +++ b/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTInteractor.java @@ -24,11 +24,15 @@ public ScheduleCTInteractor(ScheduleCTOutputBoundary scheduleCTOutputBoundary) { * The main controller of this interactor that calls the helper methods */ @Override - public ScheduleCTResponseModel schedule(ScheduleCTRequestModel requestModel, HashMap hashMap) { + public ScheduleCTResponseModel schedule(ScheduleCTRequestModel requestModel) { - CollaborativeTask task = getTaskObjectFromName(requestModel.getTaskName(), hashMap); + HashMap taskHashMap = TaskMap.getTaskMap(); - if (requestModel.getStudentUser() != task.getLeader()) { + CollaborativeTask task = getTaskObjectFromName(requestModel.getTaskName(), taskHashMap); + + StudentUser currentUser = (StudentUser) requestModel.getStudentUser(); + + if (currentUser != task.getLeader()) { return scheduleCTOutputBoundary.prepareFailView("User is not the leader. " + "You do not have scheduling access"); } @@ -42,7 +46,7 @@ public ScheduleCTResponseModel schedule(ScheduleCTRequestModel requestModel, Has LocalDateTime endTime = convertStringToLocalDateTime(requestModel.getEndTime()); for (StudentUser user : users) { - ArrayList userTasks = getAllTaskFromIdExceptOne(task, user, hashMap); + ArrayList userTasks = getAllTaskFromIdExceptOne(task, user, taskHashMap); // isUserAvailableAtDateTime returns false if not available // if isUserAvailableAtDateTime is false, add it to the list of unavailable users if (!isUserAvailableAtDateTime(user, userTasks, startTime, endTime)) { @@ -64,7 +68,7 @@ public ScheduleCTResponseModel schedule(ScheduleCTRequestModel requestModel, Has formattedDateTimes.add(formattedTimeBlock); } - ScheduleCTResponseModel scheduleCTResponseModel = new ScheduleCTResponseModel(false, formattedDateTimes); + ScheduleCTResponseModel scheduleCTResponseModel = new ScheduleCTResponseModel(formattedDateTimes); scheduleCTResponseModel.setTimesToSchedule(dates); task.setTimeBlocks(dates); @@ -95,36 +99,40 @@ public ArrayList> getDates(String frequency, LocalDateT LocalDateTime currStart = startTime; LocalDateTime currEnd = endTime; - if (frequency.equals("daily")) { - while (currEnd.plusDays(1).isBefore(deadline)) { - ArrayList date = new ArrayList<>(); - currStart = currStart.plusDays(1); - currEnd = currEnd.plusDays(1); + switch (frequency) { + case "daily": + while (currEnd.plusDays(1).isBefore(deadline)) { + ArrayList date = new ArrayList<>(); + currStart = currStart.plusDays(1); + currEnd = currEnd.plusDays(1); - date.add(currStart); - date.add(currEnd); - times.add(date); - } - } else if (frequency.equals("weekly")) { - while (currEnd.plusWeeks(1).isBefore(deadline)) { - ArrayList date = new ArrayList<>(); - currStart = currStart.plusWeeks(1); - currEnd = currEnd.plusWeeks(1); - - date.add(currStart); - date.add(currEnd); - times.add(date); - } - } else if (frequency.equals("monthly")) { - while (currEnd.plusMonths(1).isBefore(deadline)) { - ArrayList date = new ArrayList<>(); - currStart = currStart.plusMonths(1); - currEnd = currEnd.plusMonths(1); - - date.add(currStart); - date.add(currEnd); - times.add(date); - } + date.add(currStart); + date.add(currEnd); + times.add(date); + } + break; + case "weekly": + while (currEnd.plusWeeks(1).isBefore(deadline)) { + ArrayList date = new ArrayList<>(); + currStart = currStart.plusWeeks(1); + currEnd = currEnd.plusWeeks(1); + + date.add(currStart); + date.add(currEnd); + times.add(date); + } + break; + case "monthly": + while (currEnd.plusMonths(1).isBefore(deadline)) { + ArrayList date = new ArrayList<>(); + currStart = currStart.plusMonths(1); + currEnd = currEnd.plusMonths(1); + + date.add(currStart); + date.add(currEnd); + times.add(date); + } + break; } return times; } @@ -208,20 +216,31 @@ public boolean testFree(Test test, LocalDateTime start, LocalDateTime end) { boolean is_test_free = givenTime(timeBlockStart, timeBlockEnd, start, end); - ArrayList> prepTime = test.getPrepTimeScheduled(); + return prepTimeFree(start, end, is_test_free, test.getPrepTimeScheduled()); + } - if (prepTime != null){ - for (ArrayList prep : prepTime) { + /** + * Helper method to help determine if task is free + * @param start - the start date and time of the time the user wants to schedule + * @param end - the end date and time of the time the user wants to schedule + * @param is_free - whether the task conflicts or not + * @param prepTimeScheduled - the associated time blocks with a task + * @return whether the time blocks conflict or not + */ + private boolean prepTimeFree(LocalDateTime start, LocalDateTime end, boolean is_free, ArrayList> prepTimeScheduled) { + + if (prepTimeScheduled != null){ + for (ArrayList prep : prepTimeScheduled) { LocalDateTime prepStart = prep.get(0); LocalDateTime prepEnd = prep.get(1); // if there is a conflict if (!givenTime(prepStart, prepEnd, start, end)) { - is_test_free = false; + is_free = false; } } } - return is_test_free; + return is_free; } /** @@ -235,18 +254,7 @@ public boolean testFree(Test test, LocalDateTime start, LocalDateTime end) { public boolean assignmentFree(Assignment assignment, LocalDateTime start, LocalDateTime end) { boolean is_assignment_free = true; - ArrayList> prepTime = assignment.getPrepTimeScheduled(); - - if (prepTime != null) { - for (ArrayList prep : prepTime) { - LocalDateTime prepStart = prep.get(0); - LocalDateTime prepEnd = prep.get(1); - if (!givenTime(prepStart, prepEnd, start, end)) { - is_assignment_free = false; - } - } - } - return is_assignment_free; + return prepTimeFree(start, end, is_assignment_free, assignment.getPrepTimeScheduled()); } /** @@ -260,17 +268,7 @@ public boolean assignmentFree(Assignment assignment, LocalDateTime start, LocalD public boolean collaborativeTaskFree(CollaborativeTask collaborativeTask, LocalDateTime start, LocalDateTime end) { boolean is_collaborative_task_free = true; - ArrayList> meetingTimes = collaborativeTask.getTimeBlocks(); - if (meetingTimes != null) { - for (ArrayList timeBlock : meetingTimes) { - LocalDateTime timeStart = timeBlock.get(0); - LocalDateTime timeEnd = timeBlock.get(1); - if (!givenTime(timeStart, timeEnd, start, end)) { - is_collaborative_task_free = false; - } - } - } - return is_collaborative_task_free; + return prepTimeFree(start, end, is_collaborative_task_free, collaborativeTask.getTimeBlocks()); } /** @@ -306,7 +304,7 @@ public boolean workingHoursFree(LocalDateTime timeBlockStart, LocalDateTime time // if timeBlockEnd is equal to workingHoursEnd } else if (timeBlockEnd.getHour() == workingHoursEnd.getHour()) { return false; - // if timeBlockStart is equal to workingHoursStart + // if timeBlockStart is equal to workingHoursStart } else return timeBlockStart.getHour() != workingHoursStart.getHour(); } @@ -399,4 +397,19 @@ public String convertLocalDateTimeToString(LocalDateTime start, LocalDateTime en return formattedStart + " to " + formattedEnd; } + /** + * Turn all objects into tasks (by casting them) in the hash map + * @param objectHashMap - the hash map that maps strings to objects + * @return the same hash map but they are task objects instead + */ + public HashMap objectToTask(HashMap objectHashMap) { + + HashMap taskHashMap = new HashMap<>(); + + for (String key: objectHashMap.keySet()) { + Task task = (Task) objectHashMap.get(key); + taskHashMap.put(key, task); + } + return taskHashMap; + } } \ No newline at end of file diff --git a/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTRequestModel.java b/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTRequestModel.java index 4d1b1bb..be50027 100644 --- a/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTRequestModel.java +++ b/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTRequestModel.java @@ -1,6 +1,9 @@ package use_cases.collaborative_task_scheduling.scheduling_ct_use_case; -import entities.StudentUser; + +import entities.Task; + +import java.util.HashMap; /** * Request Model for the Scheduling Collaborative Tasks Use Case @@ -15,9 +18,9 @@ public class ScheduleCTRequestModel { private final String endTime; - private final StudentUser studentUser; + private final Object studentUser; - public ScheduleCTRequestModel(String taskName, String startTime, String endTime, StudentUser studentUser) { + public ScheduleCTRequestModel(String taskName, String startTime, String endTime, Object studentUser) { this.taskName = taskName; this.startTime = startTime; this.endTime = endTime; @@ -34,6 +37,5 @@ public String getEndTime() { return endTime; } - public StudentUser getStudentUser() { return studentUser; } - + public Object getStudentUser() { return studentUser; } } \ No newline at end of file diff --git a/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTResponseModel.java b/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTResponseModel.java index d029926..3de2b12 100644 --- a/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTResponseModel.java +++ b/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTResponseModel.java @@ -10,13 +10,10 @@ public class ScheduleCTResponseModel { - private final boolean isConflict; private final ArrayList scheduledTimes; ArrayList> timesToSchedule; - public ScheduleCTResponseModel(boolean isConflict, ArrayList scheduledTimes) { - - this.isConflict = isConflict; + public ScheduleCTResponseModel(ArrayList scheduledTimes) { this.scheduledTimes = scheduledTimes; } @@ -27,4 +24,4 @@ public ArrayList getScheduledTimes() { public void setTimesToSchedule(ArrayList> timesToSchedule) { this.timesToSchedule = timesToSchedule; } -} +} \ No newline at end of file From afa5a8814aaf01537685a0665a33bc2deb11f7f9 Mon Sep 17 00:00:00 2001 From: alyson647 Date: Sat, 3 Dec 2022 01:59:24 -0500 Subject: [PATCH 10/15] Added tests --- .../ScheduleCTInteractorTest.java | 180 +++ .../ScheduleCTInteractorUnitTest.java | 1010 +++++++++++++++++ 2 files changed, 1190 insertions(+) create mode 100644 src/test/java/scheduling_ct_use_case/ScheduleCTInteractorTest.java create mode 100644 src/test/java/scheduling_ct_use_case/ScheduleCTInteractorUnitTest.java diff --git a/src/test/java/scheduling_ct_use_case/ScheduleCTInteractorTest.java b/src/test/java/scheduling_ct_use_case/ScheduleCTInteractorTest.java new file mode 100644 index 0000000..d745bfe --- /dev/null +++ b/src/test/java/scheduling_ct_use_case/ScheduleCTInteractorTest.java @@ -0,0 +1,180 @@ +package scheduling_ct_use_case; + +import org.junit.jupiter.api.Test; +import screens.collaborative_task_scheduling.*; +import use_cases.collaborative_task_scheduling.scheduling_ct_use_case.*; +import entities.*; + +import javax.swing.*; +import java.awt.*; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.ArrayList; +import java.util.HashMap; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; + +class ScheduleCTInteractorTest { + + // CHANGED USE CASE TO CALL TASK MAP INSTEAD OF BRINGING IN ALL TASKS + // NEED TO TEST DIFFERENTLY +// +// @Test +// void schedule() { +// +// // CREATING DATES IT SHOULD EQUAL TO +// // Wed, Dec 7, from 10-11 am +// // Wed, Dec 14, from 10-11 am +// // Wed, Dec 21, from 10-11 am +// ArrayList formattedDates = new ArrayList<>(); +// String date1 = "2022-12-07 10:00 to 2022-12-07 11:00"; +// String date2 = "2022-12-14 10:00 to 2022-12-14 11:00"; +// String date3 = "2022-12-21 10:00 to 2022-12-21 11:00"; +// formattedDates.add(date1); +// formattedDates.add(date2); +// formattedDates.add(date3); +// +// CardLayout cardLayout = new CardLayout(); +// JPanel screens = new JPanel(); +// ScheduleCTViewInterface view = new ScheduleCTView(cardLayout, screens); +// +// // This creates an anonymous implementing class for the Output Boundary. +// ScheduleCTOutputBoundary presenter = new ScheduleCTPresenter(view) { +// @Override +// public ScheduleCTResponseModel prepareNoConflictView(ScheduleCTResponseModel responseModel) { +// assertEquals(formattedDates, responseModel.getScheduledTimes()); +// return null; +// } +// // 4) Check that the Output Data and associated changes +// // are correct +// @Override +// public ScheduleCTResponseModel prepareFailView(String error) { +// fail("Use case failure is unexpected."); +// return null; +// } +// }; +// +// ScheduleCTInteractor interactor = new ScheduleCTInteractor(presenter); +// +// // CREATING THE STUDENT USERS +// // USER 1: TAYLOR +// StudentUser taylorUser = new StudentUser("Taylor", "TaylorPassword"); +// // TO DO LIST +// ArrayList taylorToDoList = new ArrayList<>(); +// taylorToDoList.add("TaylorTask1"); +// taylorToDoList.add("TaylorTask2"); +// taylorUser.setToDoList(taylorToDoList); +// // WORKING HOURS +// ArrayList taylorWorkingHours = new ArrayList<>(); +// LocalTime taylorStartWorkingHours = LocalTime.of(1, 0); +// LocalTime taylorEndWorkingHours = LocalTime.of(6, 0); +// taylorWorkingHours.add(taylorStartWorkingHours); +// taylorWorkingHours.add(taylorEndWorkingHours); +// taylorUser.setWorkingHours(taylorWorkingHours); +// +// // USER 2: PHOEBE +// StudentUser phoebeUser = new StudentUser("Phoebe", "PhoebePassword"); +// // TO DO LIST +// ArrayList phoebeToDoList = new ArrayList<>(); +// phoebeToDoList.add("PhoebeTask1"); +// phoebeToDoList.add("PhoebeTask2"); +// phoebeUser.setToDoList(phoebeToDoList); +// // WORKING HOURS +// ArrayList phoebeWorkingHours = new ArrayList<>(); +// LocalTime phoebeStartWorkingHours = LocalTime.of(1, 0); +// LocalTime phoebeEndWorkingHours = LocalTime.of(6, 0); +// phoebeWorkingHours.add(phoebeStartWorkingHours); +// phoebeWorkingHours.add(phoebeEndWorkingHours); +// phoebeUser.setWorkingHours(phoebeWorkingHours); +// +// // CREATING USER TASKS +// // TAYLOR TASK 1 +// entities.Event taylorTask1 = new entities.Event("Networking Event", "TaylorTask1", 1, +// LocalDateTime.of(2022, 12, 9, 17, 0), +// LocalDateTime.of(2022, 12, 9, 19, 0), +// false, ""); +// // TAYLOR TASK 2 +// entities.Test taylorTask2 = new entities.Test("Biology Term Test", "TaylorTask2", +// LocalDateTime.of(2022, 12, 14, 16, 0), +// LocalDateTime.of(2022, 12, 14, 17, 0), +// 10); +// // TAYLOR TASK 2 PREP TIME +// ArrayList> taylorTask2PrepTime = new ArrayList<>(); +// ArrayList taylorPrepTime1 = new ArrayList<>(); +// LocalDateTime taylorPrepTime1Start = LocalDateTime.of(2022, 12, 12, 15, 0); +// LocalDateTime taylorPrepTime1End = LocalDateTime.of(2022, 12, 12, 16, 0); +// taylorPrepTime1.add(taylorPrepTime1Start); +// taylorPrepTime1.add(taylorPrepTime1End); +// +// ArrayList taylorPrepTime2 = new ArrayList<>(); +// LocalDateTime taylorPrepTime2Start = LocalDateTime.of(2022, 12, 13, 15, 0); +// LocalDateTime taylorPrepTime2End = LocalDateTime.of(2022, 12, 13, 16, 0); +// taylorPrepTime2.add(taylorPrepTime2Start); +// taylorPrepTime2.add(taylorPrepTime2End); +// +// taylorTask2PrepTime.add(taylorPrepTime1); +// taylorTask2PrepTime.add(taylorPrepTime2); +// taylorTask2.setPrepTimeScheduled(taylorTask2PrepTime); +// +// // PHOEBE TASK 1 +// entities.Assignment phoebeTask1 = new entities.Assignment("Math Problem Set", "PhoebeTask1", +// LocalDateTime.of(2022, 12, 9, 20, 0), +// 5); +// // PHOEBE TASK 2 PREP TIME +// ArrayList> phoebeTask1PrepTime = new ArrayList<>(); +// ArrayList phoebePrepTime1 = new ArrayList<>(); +// LocalDateTime phoebePrepTime1Start = LocalDateTime.of(2022, 12, 12, 15, 0); +// LocalDateTime phoebePrepTime1End = LocalDateTime.of(2022, 12, 12, 16, 0); +// phoebePrepTime1.add(phoebePrepTime1Start); +// phoebePrepTime1.add(phoebePrepTime1End); +// +// ArrayList phoebePrepTime2 = new ArrayList<>(); +// LocalDateTime phoebePrepTime2Start = LocalDateTime.of(2022, 12, 13, 15, 0); +// LocalDateTime phoebePrepTime2End = LocalDateTime.of(2022, 12, 13, 16, 0); +// phoebePrepTime2.add(phoebePrepTime2Start); +// phoebePrepTime2.add(phoebePrepTime2End); +// +// phoebeTask1PrepTime.add(phoebePrepTime1); +// phoebeTask1PrepTime.add(phoebePrepTime2); +// phoebeTask1.setPrepTimeScheduled(phoebeTask1PrepTime); +// +// // PHOEBE TASK 2 +// entities.Event phoebeTask2 = new entities.Event("Meet with friends", "PhoebeTask2", 1, +// LocalDateTime.of(2022, 12, 15, 18, 0), +// LocalDateTime.of(2022, 12, 15, 19, 0), +// false, ""); +// +// // CREATING COLLABORATIVE TASK +// CollaborativeTask collaborativeTask = new CollaborativeTask("Work on project", "CollaborativeTask1", +// 1, true, "weekly", +// LocalDateTime.of(2022, 12, 7, 10, 0), +// LocalDateTime.of(2022, 12, 7, 11, 0), +// LocalDateTime.of(2022, 12, 22, 12, 0), +// taylorUser); +// // SETTING TEAMMATES +// ArrayList teammates = new ArrayList<>(); +// teammates.add(phoebeUser); +// collaborativeTask.setTeammates(teammates); +// +// // CREATING HASH MAP +// HashMap hashMap = new HashMap<>(); +// hashMap.put("TaylorTask1", taylorTask1); +// hashMap.put("TaylorTask2", taylorTask2); +// hashMap.put("PhoebeTask1", phoebeTask1); +// hashMap.put("PhoebeTask2", phoebeTask2); +// hashMap.put("CollaborativeTask1", collaborativeTask); +// +// +// // MAKING INPUT DATA +// // INPUT INTO THE USER INTERFACE SCREEN +// String taskName = "Work on project"; +// String startTime = "2022-12-07 10:00"; +// String endTime = "2022-12-07 11:00"; +// ScheduleCTRequestModel inputData = new ScheduleCTRequestModel(taskName, startTime, endTime, taylorUser); +// +// // RUNNING THE TEST +// interactor.schedule(inputData); +// +// } +} \ No newline at end of file diff --git a/src/test/java/scheduling_ct_use_case/ScheduleCTInteractorUnitTest.java b/src/test/java/scheduling_ct_use_case/ScheduleCTInteractorUnitTest.java new file mode 100644 index 0000000..dcd70d8 --- /dev/null +++ b/src/test/java/scheduling_ct_use_case/ScheduleCTInteractorUnitTest.java @@ -0,0 +1,1010 @@ +package scheduling_ct_use_case; + +import entities.Event; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import screens.collaborative_task_scheduling.ScheduleCTPresenter; +import screens.collaborative_task_scheduling.ScheduleCTView; +import screens.collaborative_task_scheduling.ScheduleCTViewInterface; +import use_cases.collaborative_task_scheduling.scheduling_ct_use_case.*; +import entities.*; + +import javax.swing.*; +import java.awt.*; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.ArrayList; +import java.util.HashMap; + +class ScheduleCTInteractorUnitTest { + CardLayout cardLayout = new CardLayout(); + JPanel screens = new JPanel(); + ScheduleCTViewInterface view = new ScheduleCTView(cardLayout, screens); + ScheduleCTOutputBoundary presenter = new ScheduleCTPresenter(view); + ScheduleCTInteractor interactor = new ScheduleCTInteractor(presenter); + + @Test + public void convertLocalDateTimeToStringTest() { + + LocalDateTime start = LocalDateTime.of(2022, 11, 26, 6, 0); + LocalDateTime end = LocalDateTime.of(2022, 11, 26, 7, 0); + + String expected = "2022-11-26 06:00 to 2022-11-26 07:00"; + String actual = interactor.convertLocalDateTimeToString(start, end); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void convertStringToLocalDateTimeTest() { + + String stringDateTime = "2022-11-26 06:00"; + + LocalDateTime expected = LocalDateTime.of(2022, 11, 26, 6, 0); + LocalDateTime actual = interactor.convertStringToLocalDateTime(stringDateTime); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void getTaskObjectFromNameTest() { + // test for when the task exists in the hash map given + + String taskName = "CSC207 lecture"; + HashMap hashMap = new HashMap<>(); + + StudentUser user = new StudentUser("Alyson", "penguinsAndDucks"); + + CollaborativeTask collaborativeTask1 = new CollaborativeTask("CSC207 lecture", "207User", + 1, false, "", LocalDateTime.of(2022, 11, 26, 2, 0), + LocalDateTime.of(2022, 11, 26, 3, 0), + LocalDateTime.of(2022, 11, 26, 8, 0), + user); + Event event2 = new Event("Hackathon", "HackathonUser", 1, + LocalDateTime.of(2022, 11, 27, 2, 0), + LocalDateTime.of(2022, 11, 27, 3, 0), + false, ""); + + hashMap.put("207User", collaborativeTask1); + hashMap.put("HackathonUser", event2); + + Task actual = interactor.getTaskObjectFromName(taskName, hashMap); + + Assertions.assertEquals(collaborativeTask1, actual); + } + + @Test + public void getAllTaskFromIdExceptOneTest() { + // test getAllTaskFromIdExceptOne + + HashMap hashMap = new HashMap<>(); + + StudentUser user = new StudentUser("Alyson", "penguinsAndDucks"); + ArrayList toDoList = new ArrayList<>(); + toDoList.add("207User"); + toDoList.add("HackathonUser"); + toDoList.add("LunchUser"); + + user.setToDoList(toDoList); + + CollaborativeTask collaborativeTask1 = new CollaborativeTask("CSC207 lecture", "207User", + 1, false, "", LocalDateTime.of(2022, 11, 26, 2, 0), + LocalDateTime.of(2022, 11, 26, 3, 0), + LocalDateTime.of(2022, 11, 26, 8, 0), + user); + Event event1 = new Event("Hackathon", "HackathonUser", 1, + LocalDateTime.of(2022, 11, 27, 2, 0), + LocalDateTime.of(2022, 11, 27, 3, 0), + false, ""); + Event event2 = new Event("Eat lunch", "LunchUser", 1, + LocalDateTime.of(2022, 11, 28, 12, 0), + LocalDateTime.of(2022, 11, 28, 13, 0), + false, ""); + + hashMap.put("207User", collaborativeTask1); + hashMap.put("LunchUser", event2); + hashMap.put("HackathonUser", event1); + + ArrayList expected = new ArrayList<>(); + expected.add(event1); + expected.add(event2); + + ArrayList actual = interactor.getAllTaskFromIdExceptOne(collaborativeTask1, user, hashMap); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void givenTimeNoConflictTest() { + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 26, 1, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 26, 3, 0); + + // creating time block of existing task + LocalDateTime start = LocalDateTime.of(2022, 11, 25, 6, 0); + LocalDateTime end = LocalDateTime.of(2022, 11, 25, 7, 0); + + boolean expected = true; + boolean actual = interactor.givenTime(timeBlockStart, timeBlockEnd, start, end); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void givenTimeCaseOneTest() { + // Testing the first case where the time block is within start and end + // output should be false since conflicting + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 26, 4, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 26, 5, 0); + + // creating time block of existing task + LocalDateTime start = LocalDateTime.of(2022, 11, 26, 3, 0); + LocalDateTime end = LocalDateTime.of(2022, 11, 26, 6, 0); + + boolean expected = false; + boolean actual = interactor.givenTime(timeBlockStart, timeBlockEnd, start, end); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void givenTimeCaseTwoTest() { + // Testing the second case where the time block covers start and end + // output should be false since conflicting + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 26, 5, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 26, 8, 0); + + // creating time block of existing task + LocalDateTime start = LocalDateTime.of(2022, 11, 26, 6, 0); + LocalDateTime end = LocalDateTime.of(2022, 11, 26, 7, 0); + + boolean expected = false; + boolean actual = interactor.givenTime(timeBlockStart, timeBlockEnd, start, end); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void givenTimeCaseThreeTest() { + // Testing the third case where the starts before START, and the end of the time block is between START and END + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 26, 5, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 26, 6, 0); + + // creating time block of existing task + LocalDateTime start = LocalDateTime.of(2022, 11, 26, 4, 0); + LocalDateTime end = LocalDateTime.of(2022, 11, 26, 5, 30); + + boolean expected = false; + boolean actual = interactor.givenTime(timeBlockStart, timeBlockEnd, start, end); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void givenTimeCaseFourTest() { + // Testing the fourth case where the time block starts at the same time as START + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 26, 5, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 26, 6, 0); + + // creating time block of existing task + LocalDateTime start = LocalDateTime.of(2022, 11, 26, 5, 0); + LocalDateTime end = LocalDateTime.of(2022, 11, 26, 7, 0); + + boolean expected = false; + boolean actual = interactor.givenTime(timeBlockStart, timeBlockEnd, start, end); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void givenTimeCaseFiveTest() { + // Testing the fifth case where the time block ends at the same time as END + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 26, 5, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 26, 6, 0); + + // creating time block of existing task + LocalDateTime start = LocalDateTime.of(2022, 11, 26, 4, 0); + LocalDateTime end = LocalDateTime.of(2022, 11, 26, 6, 0); + + boolean expected = false; + boolean actual = interactor.givenTime(timeBlockStart, timeBlockEnd, start, end); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void givenTimeCaseSixTest() { + // Testing the sixth case where the time block starts within START and END, and ends after END + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 26, 5, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 26, 9, 0); + + // creating time block of existing task + LocalDateTime start = LocalDateTime.of(2022, 11, 26, 4, 0); + LocalDateTime end = LocalDateTime.of(2022, 11, 26, 7, 0); + + boolean expected = false; + boolean actual = interactor.givenTime(timeBlockStart, timeBlockEnd, start, end); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void workingHoursFreeNoConflictTest() { + // Testing that workingHoursFree should return true when no conflict between time blocks + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 26, 6, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 26, 7, 0); + + // creating time of working hours + LocalTime workingHoursStart = LocalTime.of(2, 0); + LocalTime workingHoursEnd = LocalTime.of(3, 0); + + boolean expected = true; + boolean actual = interactor.workingHoursFree(timeBlockStart, timeBlockEnd, workingHoursStart, workingHoursEnd); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void workingHoursCaseOneTest() { + // Testing first case where the time block is within working hours + // Should return false since there is a conflict + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 26, 3, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 26, 4, 0); + + // creating time of working hours + LocalTime workingHoursStart = LocalTime.of(2, 0); + LocalTime workingHoursEnd = LocalTime.of(5, 0); + + boolean expected = false; + boolean actual = interactor.workingHoursFree(timeBlockStart, timeBlockEnd, workingHoursStart, workingHoursEnd); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void workingHoursCaseTwoTest() { + // Testing second case where the time block covers all working hours + // Should return false since there is a conflict + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 26, 2, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 26, 5, 0); + + // creating time of working hours + LocalTime workingHoursStart = LocalTime.of(3, 0); + LocalTime workingHoursEnd = LocalTime.of(4, 0); + + boolean expected = false; + boolean actual = interactor.workingHoursFree(timeBlockStart, timeBlockEnd, workingHoursStart, workingHoursEnd); + + Assertions.assertEquals(expected, actual); + + } + + @Test + public void workingHoursCaseThreeTest() { + // Testing third case where the time block starts before working hours, and ends between working hours + // Should return false since there is a conflict + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 26, 1, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 26, 4, 0); + + // creating time of working hours + LocalTime workingHoursStart = LocalTime.of(2, 0); + LocalTime workingHoursEnd = LocalTime.of(5, 0); + + boolean expected = false; + boolean actual = interactor.workingHoursFree(timeBlockStart, timeBlockEnd, workingHoursStart, workingHoursEnd); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void workingHoursCaseFourTest() { + // Testing fourth case where the time block starts between working hours, and ends after working hours + // Should return false since there is a conflict + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 26, 3, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 26, 8, 0); + + // creating time of working hours + LocalTime workingHoursStart = LocalTime.of(2, 0); + LocalTime workingHoursEnd = LocalTime.of(5, 0); + + boolean expected = false; + boolean actual = interactor.workingHoursFree(timeBlockStart, timeBlockEnd, workingHoursStart, workingHoursEnd); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void workingHoursCaseFiveTest() { + // Testing fifth case where the end of the time block is equal to the end of working hours + // Should return false since there is a conflict + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 26, 3, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 26, 4, 0); + + // creating time of working hours + LocalTime workingHoursStart = LocalTime.of(2, 0); + LocalTime workingHoursEnd = LocalTime.of(4, 0); + + boolean expected = false; + boolean actual = interactor.workingHoursFree(timeBlockStart, timeBlockEnd, workingHoursStart, workingHoursEnd); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void workingHoursCaseSixTest() { + // Testing sixth case where the start of the time block is equal to the start of working hours + // Should return false since there is a conflict + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 26, 3, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 26, 4, 0); + + // creating time of working hours + LocalTime workingHoursStart = LocalTime.of(3, 0); + LocalTime workingHoursEnd = LocalTime.of(5, 0); + + boolean expected = false; + boolean actual = interactor.workingHoursFree(timeBlockStart, timeBlockEnd, workingHoursStart, workingHoursEnd); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void collaborativeTaskFreeNoConflictTest() { + // Testing collaborativeTaskFree where given a collaborative task and a start and end date and time + // Should return true since there is no conflict + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 26, 3, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 26, 4, 0); + + // creating student user + StudentUser user = new StudentUser("alyson", "catsAndDog"); + + // creating a collaborative task + CollaborativeTask collaborativeTask = new CollaborativeTask("Eating", "EatingUser", 1, + true, "daily", + LocalDateTime.of(2022, 11, 26, 7, 0), + LocalDateTime.of(2022, 11, 26, 8, 0), + LocalDateTime.of(2022, 11, 28, 9, 0), + user); + // adding scheduled times to collaborative task + ArrayList> scheduledDates = new ArrayList<>(); + + ArrayList date1 = new ArrayList<>(); + date1.add(LocalDateTime.of(2022, 11, 26, 7, 0)); + date1.add(LocalDateTime.of(2022, 11, 26, 8, 0)); + + ArrayList date2 = new ArrayList<>(); + date2.add(LocalDateTime.of(2022, 11, 27, 7, 0)); + date2.add(LocalDateTime.of(2022, 11, 27, 8, 0)); + + ArrayList date3 = new ArrayList<>(); + date3.add(LocalDateTime.of(2022, 11, 28, 7, 0)); + date3.add(LocalDateTime.of(2022, 11, 29, 8, 0)); + + scheduledDates.add(date1); + scheduledDates.add(date2); + scheduledDates.add(date3); + + collaborativeTask.setTimeBlocks(scheduledDates); + + boolean expected = true; + boolean actual = interactor.collaborativeTaskFree(collaborativeTask, timeBlockStart, timeBlockEnd); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void collaborativeTaskFreeConflictTest() { + // Testing collaborativeTaskFree where given a collaborative task and a start and end date and time + // Should return false since there is a conflict + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 27, 7, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 27, 8, 0); + + // creating student user + StudentUser user = new StudentUser("alyson", "catsAndDog"); + + // creating a collaborative task + CollaborativeTask collaborativeTask = new CollaborativeTask("Eating", "EatingUser", 1, + true, "daily", + LocalDateTime.of(2022, 11, 26, 7, 0), + LocalDateTime.of(2022, 11, 26, 8, 0), + LocalDateTime.of(2022, 11, 28, 9, 0), + user); + // adding scheduled times to collaborative task + ArrayList> scheduledDates = new ArrayList<>(); + + ArrayList date1 = new ArrayList<>(); + date1.add(LocalDateTime.of(2022, 11, 26, 7, 0)); + date1.add(LocalDateTime.of(2022, 11, 26, 8, 0)); + + ArrayList date2 = new ArrayList<>(); + date2.add(LocalDateTime.of(2022, 11, 27, 7, 0)); + date2.add(LocalDateTime.of(2022, 11, 27, 8, 0)); + + ArrayList date3 = new ArrayList<>(); + date3.add(LocalDateTime.of(2022, 11, 28, 7, 0)); + date3.add(LocalDateTime.of(2022, 11, 29, 8, 0)); + + scheduledDates.add(date1); + scheduledDates.add(date2); + scheduledDates.add(date3); + + collaborativeTask.setTimeBlocks(scheduledDates); + + boolean expected = false; + boolean actual = interactor.collaborativeTaskFree(collaborativeTask, timeBlockStart, timeBlockEnd); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void assignmentFreeNoConflictTest() { + // Testing assignmentFree given an assignment and a start and end time + // Should return true since there is no conflict between the assignment and the time block given + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 27, 5, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 27, 6, 0); + + // creating assignment + Assignment assignment = new Assignment("Assignment", "AssignmentUser", + LocalDateTime.of(2022, 11, 27, 22, 0), 5); + + // adding scheduled times to assignment + ArrayList> prepTime = new ArrayList<>(); + + ArrayList prep1 = new ArrayList<>(); + prep1.add(LocalDateTime.of(2022, 11, 26, 7, 0)); + prep1.add(LocalDateTime.of(2022, 11, 26, 8, 0)); + + ArrayList prep2 = new ArrayList<>(); + prep2.add(LocalDateTime.of(2022, 11, 27, 7, 0)); + prep2.add(LocalDateTime.of(2022, 11, 27, 8, 0)); + + prepTime.add(prep1); + prepTime.add(prep2); + + assignment.setPrepTimeScheduled(prepTime); + + boolean expected = true; + boolean actual = interactor.assignmentFree(assignment, timeBlockStart, timeBlockEnd); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void assignmentFreeConflictTest() { + // Testing assignmentFree given an assignment and a start and end time + // Should return false since there is a conflict between the assignment and the time block given + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 27, 7, 30); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 27, 8, 0); + + // creating assignment + Assignment assignment = new Assignment("Assignment", "AssignmentUser", + LocalDateTime.of(2022, 11, 27, 22, 0), 5); + + // adding scheduled times to assignment + ArrayList> prepTime = new ArrayList<>(); + + ArrayList prep1 = new ArrayList<>(); + prep1.add(LocalDateTime.of(2022, 11, 26, 7, 0)); + prep1.add(LocalDateTime.of(2022, 11, 26, 8, 0)); + + ArrayList prep2 = new ArrayList<>(); + prep2.add(LocalDateTime.of(2022, 11, 27, 7, 0)); + prep2.add(LocalDateTime.of(2022, 11, 27, 8, 0)); + + prepTime.add(prep1); + prepTime.add(prep2); + + assignment.setPrepTimeScheduled(prepTime); + + boolean expected = false; + boolean actual = interactor.assignmentFree(assignment, timeBlockStart, timeBlockEnd); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void testFreeNoConflictTest() { + // Testing testFree given a test and a start and end time + // Should return true since there is no conflict between the test and the time block given + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 27, 4, 30); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 27, 5, 0); + + // creating test + entities.Test test = new entities.Test("Test", "TestUser", + LocalDateTime.of(2022, 11, 27, 14, 0), + LocalDateTime.of(2022, 11, 27, 16, 0), 15); + + // adding scheduled times to test + ArrayList> prepTime = new ArrayList<>(); + + ArrayList prep1 = new ArrayList<>(); + prep1.add(LocalDateTime.of(2022, 11, 26, 7, 0)); + prep1.add(LocalDateTime.of(2022, 11, 26, 8, 0)); + + ArrayList prep2 = new ArrayList<>(); + prep2.add(LocalDateTime.of(2022, 11, 27, 7, 0)); + prep2.add(LocalDateTime.of(2022, 11, 27, 8, 0)); + + prepTime.add(prep1); + prepTime.add(prep2); + + test.setPrepTimeScheduled(prepTime); + + boolean expected = true; + boolean actual = interactor.testFree(test, timeBlockStart, timeBlockEnd); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void testFreeConflictTest() { + // Testing testFree given a test and a start and end date and time + // Should return false since there is a conflict between the test and the time block given + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 27, 15, 30); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 27, 16, 0); + + // creating test + entities.Test test = new entities.Test("Test", "TestUser", + LocalDateTime.of(2022, 11, 27, 14, 0), + LocalDateTime.of(2022, 11, 27, 16, 0), 15); + + // adding scheduled times to test + ArrayList> prepTime = new ArrayList<>(); + + ArrayList prep1 = new ArrayList<>(); + prep1.add(LocalDateTime.of(2022, 11, 26, 7, 0)); + prep1.add(LocalDateTime.of(2022, 11, 26, 8, 0)); + + ArrayList prep2 = new ArrayList<>(); + prep2.add(LocalDateTime.of(2022, 11, 27, 7, 0)); + prep2.add(LocalDateTime.of(2022, 11, 27, 8, 0)); + + prepTime.add(prep1); + prepTime.add(prep2); + + test.setPrepTimeScheduled(prepTime); + + boolean expected = false; + boolean actual = interactor.testFree(test, timeBlockStart, timeBlockEnd); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void eventFreeNoConflictTest() { + // Testing eventFree given an event and a start and end date and time + // Should return true since there is no conflict between the event and the time block given + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 27, 4, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 27, 5, 0); + + // creating event + Event event = new Event("Event", "EventUser", 1, + LocalDateTime.of(2022, 11, 28, 13, 0), + LocalDateTime.of(2022, 11, 28, 15, 0), + false, ""); + + boolean expected = true; + boolean actual = interactor.eventFree(event, timeBlockStart, timeBlockEnd); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void eventFreeConflictTest() { + // Testing eventFree given an event and a start and end date and time + // Should return false since there is a conflict between the event and the time block given + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 28, 14, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 28, 15, 0); + + // creating event + Event event = new Event("Event", "EventUser", 1, + LocalDateTime.of(2022, 11, 28, 13, 0), + LocalDateTime.of(2022, 11, 28, 15, 0), + false, ""); + + boolean expected = false; + boolean actual = interactor.eventFree(event, timeBlockStart, timeBlockEnd); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void isUserAvailableAtDateTimeNoConflictTest() { + // Testing isUserAvailableAtDateTime + // Should return true since there is no conflict + + ArrayList tasks = new ArrayList<>(); + // creating event + Event event = new Event("Event", "EventUser", 1, + LocalDateTime.of(2022, 11, 27, 4, 0), + LocalDateTime.of(2022, 11, 27, 5, 0), + false, ""); + + // creating test + entities.Test test = new entities.Test("Test", "TestUser", + LocalDateTime.of(2022, 11, 27, 5, 0), + LocalDateTime.of(2022, 11, 27, 6, 0), 15); + + // adding scheduled times to test + ArrayList> prepTime = new ArrayList<>(); + + ArrayList prep1 = new ArrayList<>(); + prep1.add(LocalDateTime.of(2022, 11, 27, 8, 0)); + prep1.add(LocalDateTime.of(2022, 11, 27, 9, 0)); + + ArrayList prep2 = new ArrayList<>(); + prep2.add(LocalDateTime.of(2022, 11, 27, 9, 0)); + prep2.add(LocalDateTime.of(2022, 11, 27, 10, 0)); + + prepTime.add(prep1); + prepTime.add(prep2); + + test.setPrepTimeScheduled(prepTime); + + // creating assignment + Assignment assignment = new Assignment("Assignment", "AssignmentUser", + LocalDateTime.of(2022, 12, 5, 22, 0), 5); + + // adding scheduled times to assignment + ArrayList> assignmentPrepTime = new ArrayList<>(); + + ArrayList assignmentPrep1 = new ArrayList<>(); + assignmentPrep1.add(LocalDateTime.of(2022, 11, 28, 7, 0)); + assignmentPrep1.add(LocalDateTime.of(2022, 11, 28, 8, 0)); + + ArrayList assignmentPrep2 = new ArrayList<>(); + assignmentPrep2.add(LocalDateTime.of(2022, 11, 28, 9, 0)); + assignmentPrep2.add(LocalDateTime.of(2022, 11, 28, 10, 0)); + + assignmentPrepTime.add(assignmentPrep1); + assignmentPrepTime.add(assignmentPrep2); + + assignment.setPrepTimeScheduled(assignmentPrepTime); + + tasks.add(event); + tasks.add(test); + tasks.add(assignment); + + // creating time of working hours + ArrayList workingHours = new ArrayList<>(); + LocalTime workingHoursStart = LocalTime.of(1, 0); + LocalTime workingHoursEnd = LocalTime.of(2, 0); + workingHours.add(workingHoursStart); + workingHours.add(workingHoursEnd); + + // creating time block of collaborative task user wants to schedule + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 29, 4, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 29, 5, 0); + + // creating student user + StudentUser user = new StudentUser("alyson", "veryTiredStudent"); + user.setWorkingHours(workingHours); + + boolean expected = true; + boolean actual = interactor.isUserAvailableAtDateTime(user, tasks, timeBlockStart, timeBlockEnd); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void isUserAvailableAtDateTimeConflictWithWorkingHoursTest() { + // Testing isUserAvailableAtDateTime + // Should return false since there is a conflict + + ArrayList tasks = new ArrayList<>(); + // creating event + Event event = new Event("Event", "EventUser", 1, + LocalDateTime.of(2022, 11, 27, 4, 0), + LocalDateTime.of(2022, 11, 27, 5, 0), + false, ""); + + // creating test + entities.Test test = new entities.Test("Test", "TestUser", + LocalDateTime.of(2022, 11, 27, 5, 0), + LocalDateTime.of(2022, 11, 27, 6, 0), 15); + + // adding scheduled times to test + ArrayList> prepTime = new ArrayList<>(); + + ArrayList prep1 = new ArrayList<>(); + prep1.add(LocalDateTime.of(2022, 11, 27, 8, 0)); + prep1.add(LocalDateTime.of(2022, 11, 27, 9, 0)); + + ArrayList prep2 = new ArrayList<>(); + prep2.add(LocalDateTime.of(2022, 11, 27, 9, 0)); + prep2.add(LocalDateTime.of(2022, 11, 27, 10, 0)); + + prepTime.add(prep1); + prepTime.add(prep2); + + test.setPrepTimeScheduled(prepTime); + + // creating assignment + Assignment assignment = new Assignment("Assignment", "AssignmentUser", + LocalDateTime.of(2022, 12, 5, 22, 0), 5); + + // adding scheduled times to assignment + ArrayList> assignmentPrepTime = new ArrayList<>(); + + ArrayList assignmentPrep1 = new ArrayList<>(); + assignmentPrep1.add(LocalDateTime.of(2022, 11, 28, 7, 0)); + assignmentPrep1.add(LocalDateTime.of(2022, 11, 28, 8, 0)); + + ArrayList assignmentPrep2 = new ArrayList<>(); + assignmentPrep2.add(LocalDateTime.of(2022, 11, 28, 9, 0)); + assignmentPrep2.add(LocalDateTime.of(2022, 11, 28, 10, 0)); + + assignmentPrepTime.add(assignmentPrep1); + assignmentPrepTime.add(assignmentPrep2); + + assignment.setPrepTimeScheduled(assignmentPrepTime); + + tasks.add(event); + tasks.add(test); + tasks.add(assignment); + + // creating time of working hours + ArrayList workingHours = new ArrayList<>(); + LocalTime workingHoursStart = LocalTime.of(1, 0); + LocalTime workingHoursEnd = LocalTime.of(2, 0); + workingHours.add(workingHoursStart); + workingHours.add(workingHoursEnd); + + // creating time block of collaborative task user wants to schedule + // conflicts with workingHours + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 29, 1, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 29, 3, 0); + + // creating student user + StudentUser user = new StudentUser("alyson", "veryTiredStudent"); + user.setWorkingHours(workingHours); + + boolean expected = false; + boolean actual = interactor.isUserAvailableAtDateTime(user, tasks, timeBlockStart, timeBlockEnd); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void isUserAvailableAtDateTimeConflictWithTaskTest() { + // Testing isUserAvailableAtDateTime + // Should return false since there is a conflict + + ArrayList tasks = new ArrayList<>(); + // creating event + Event event = new Event("Event", "EventUser", 1, + LocalDateTime.of(2022, 11, 27, 4, 0), + LocalDateTime.of(2022, 11, 27, 5, 0), + false, ""); + + // creating test + entities.Test test = new entities.Test("Test", "TestUser", + LocalDateTime.of(2022, 11, 27, 5, 0), + LocalDateTime.of(2022, 11, 27, 6, 0), 15); + + // adding scheduled times to test + ArrayList> prepTime = new ArrayList<>(); + + ArrayList prep1 = new ArrayList<>(); + prep1.add(LocalDateTime.of(2022, 11, 27, 8, 0)); + prep1.add(LocalDateTime.of(2022, 11, 27, 9, 0)); + + ArrayList prep2 = new ArrayList<>(); + prep2.add(LocalDateTime.of(2022, 11, 27, 9, 0)); + prep2.add(LocalDateTime.of(2022, 11, 27, 10, 0)); + + prepTime.add(prep1); + prepTime.add(prep2); + + test.setPrepTimeScheduled(prepTime); + + // creating assignment + Assignment assignment = new Assignment("Assignment", "AssignmentUser", + LocalDateTime.of(2022, 12, 5, 22, 0), 5); + + // adding scheduled times to assignment + ArrayList> assignmentPrepTime = new ArrayList<>(); + + ArrayList assignmentPrep1 = new ArrayList<>(); + assignmentPrep1.add(LocalDateTime.of(2022, 11, 28, 7, 0)); + assignmentPrep1.add(LocalDateTime.of(2022, 11, 28, 8, 0)); + + ArrayList assignmentPrep2 = new ArrayList<>(); + assignmentPrep2.add(LocalDateTime.of(2022, 11, 28, 9, 0)); + assignmentPrep2.add(LocalDateTime.of(2022, 11, 28, 10, 0)); + + assignmentPrepTime.add(assignmentPrep1); + assignmentPrepTime.add(assignmentPrep2); + + assignment.setPrepTimeScheduled(assignmentPrepTime); + + tasks.add(event); + tasks.add(test); + tasks.add(assignment); + + // creating time of working hours + ArrayList workingHours = new ArrayList<>(); + LocalTime workingHoursStart = LocalTime.of(1, 0); + LocalTime workingHoursEnd = LocalTime.of(2, 0); + workingHours.add(workingHoursStart); + workingHours.add(workingHoursEnd); + + // creating time block of collaborative task user wants to schedule + // conflicts with workingHours + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 28, 9, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 28, 10, 0); + + // creating student user + StudentUser user = new StudentUser("alyson", "veryTiredStudent"); + user.setWorkingHours(workingHours); + + boolean expected = false; + boolean actual = interactor.isUserAvailableAtDateTime(user, tasks, timeBlockStart, timeBlockEnd); + + Assertions.assertEquals(expected, actual); + } + + @Test + public void getDatesDailyTest() { + // Tests getDates with a frequency of "daily" + // Should return an ArrayList> of times until the deadline + + String frequency = "daily"; + + // creating time block of date and time of when the user wants to start scheduling + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 28, 9, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 28, 10, 0); + + // creating deadline + LocalDateTime deadline = LocalDateTime.of(2022, 11, 30, 12, 0); + + // creating expected output + ArrayList> dates = new ArrayList<>(); + + ArrayList date1 = new ArrayList<>(); + LocalDateTime date1Start = LocalDateTime.of(2022, 11, 28, 9, 0); + LocalDateTime date1End = LocalDateTime.of(2022, 11, 28, 10, 0); + date1.add(date1Start); + date1.add(date1End); + + ArrayList date2 = new ArrayList<>(); + LocalDateTime date2Start = LocalDateTime.of(2022, 11, 29, 9, 0); + LocalDateTime date2End = LocalDateTime.of(2022, 11, 29, 10, 0); + date2.add(date2Start); + date2.add(date2End); + + ArrayList date3 = new ArrayList<>(); + LocalDateTime date3Start = LocalDateTime.of(2022, 11, 30, 9, 0); + LocalDateTime date3End = LocalDateTime.of(2022, 11, 30, 10, 0); + date3.add(date3Start); + date3.add(date3End); + + dates.add(date1); + dates.add(date2); + dates.add(date3); + + ArrayList> actual = interactor.getDates(frequency, timeBlockStart, timeBlockEnd, deadline); + Assertions.assertEquals(dates, actual); + } + + @Test + public void getDatesWeeklyTest() { + // Tests getDates with a frequency of "weekly" + // Should return an ArrayList> of times until the deadline + + String frequency = "weekly"; + + // creating time block of date and time of when the user wants to start scheduling + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 28, 9, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 28, 10, 0); + + // creating deadline + LocalDateTime deadline = LocalDateTime.of(2022, 12, 5, 12, 0); + + // creating expected output + ArrayList> dates = new ArrayList<>(); + + ArrayList date1 = new ArrayList<>(); + LocalDateTime date1Start = LocalDateTime.of(2022, 11, 28, 9, 0); + LocalDateTime date1End = LocalDateTime.of(2022, 11, 28, 10, 0); + date1.add(date1Start); + date1.add(date1End); + + ArrayList date2 = new ArrayList<>(); + LocalDateTime date2Start = LocalDateTime.of(2022, 12, 5, 9, 0); + LocalDateTime date2End = LocalDateTime.of(2022, 12, 5, 10, 0); + date2.add(date2Start); + date2.add(date2End); + + dates.add(date1); + dates.add(date2); + + ArrayList> actual = interactor.getDates(frequency, timeBlockStart, timeBlockEnd, deadline); + Assertions.assertEquals(dates, actual); + } + + @Test + public void getDatesMonthlyTest() { + // Tests getDates with a frequency of "monthly" + // Should return an ArrayList> of times until the deadline + + String frequency = "monthly"; + + // creating time block of date and time of when the user wants to start scheduling + LocalDateTime timeBlockStart = LocalDateTime.of(2022, 11, 28, 9, 0); + LocalDateTime timeBlockEnd = LocalDateTime.of(2022, 11, 28, 10, 0); + + // creating deadline + LocalDateTime deadline = LocalDateTime.of(2023, 1, 30, 12, 0); + + // creating expected output + ArrayList> dates = new ArrayList<>(); + + ArrayList date1 = new ArrayList<>(); + LocalDateTime date1Start = LocalDateTime.of(2022, 11, 28, 9, 0); + LocalDateTime date1End = LocalDateTime.of(2022, 11, 28, 10, 0); + date1.add(date1Start); + date1.add(date1End); + + ArrayList date2 = new ArrayList<>(); + LocalDateTime date2Start = LocalDateTime.of(2022, 12, 28, 9, 0); + LocalDateTime date2End = LocalDateTime.of(2022, 12, 28, 10, 0); + date2.add(date2Start); + date2.add(date2End); + + ArrayList date3 = new ArrayList<>(); + LocalDateTime date3Start = LocalDateTime.of(2023, 1, 28, 9, 0); + LocalDateTime date3End = LocalDateTime.of(2023, 1, 28, 10, 0); + date3.add(date3Start); + date3.add(date3End); + + dates.add(date1); + dates.add(date2); + dates.add(date3); + + ArrayList> actual = interactor.getDates(frequency, timeBlockStart, timeBlockEnd, deadline); + Assertions.assertEquals(dates, actual); + } +} \ No newline at end of file From f3d2c8ccec453ea3941974129415e5568d0d5a2d Mon Sep 17 00:00:00 2001 From: alyson647 Date: Sat, 3 Dec 2022 21:09:40 -0500 Subject: [PATCH 11/15] Modified test (they pass!), removed user parameter and use CurrentUser instead --- src/main/java/Main.java | 2 +- .../ScheduleCTController.java | 8 +- .../ScheduleCTInteractor.java | 2 +- .../ScheduleCTRequestModel.java | 12 +- .../ScheduleCTInteractorTest.java | 325 +++++++++--------- 5 files changed, 170 insertions(+), 179 deletions(-) diff --git a/src/main/java/Main.java b/src/main/java/Main.java index 9ef09ba..2cc68b0 100644 --- a/src/main/java/Main.java +++ b/src/main/java/Main.java @@ -81,7 +81,7 @@ public static void main(String[] args) throws IOException, ClassNotFoundExceptio ScheduleCTViewInterface scheduleCTOutputView = new ScheduleCTView(cardLayout, screens); ScheduleCTOutputBoundary scheduleCTPresenter = new ScheduleCTPresenter(scheduleCTOutputView); ScheduleCTInputBoundary scheduleCTInteractor = new ScheduleCTInteractor(scheduleCTPresenter); - ScheduleCTController scheduleCTController = new ScheduleCTController(scheduleCTInteractor, user); + ScheduleCTController scheduleCTController = new ScheduleCTController(scheduleCTInteractor); CourseCreationDsGateway course; try { diff --git a/src/main/java/screens/collaborative_task_scheduling/ScheduleCTController.java b/src/main/java/screens/collaborative_task_scheduling/ScheduleCTController.java index 60371e4..9f54e8a 100644 --- a/src/main/java/screens/collaborative_task_scheduling/ScheduleCTController.java +++ b/src/main/java/screens/collaborative_task_scheduling/ScheduleCTController.java @@ -13,16 +13,12 @@ public class ScheduleCTController { final ScheduleCTInputBoundary scheduleInput; - private final Object studentUser; - /** * Constructor for ScheduleCTController * @param scheduleInput - the scheduleCTInputBoundary - * @param studentUser - the current student user logged in */ - public ScheduleCTController(ScheduleCTInputBoundary scheduleInput, Object studentUser) { + public ScheduleCTController(ScheduleCTInputBoundary scheduleInput) { this.scheduleInput = scheduleInput; - this.studentUser = studentUser; } /** @@ -34,7 +30,7 @@ public ScheduleCTController(ScheduleCTInputBoundary scheduleInput, Object studen * @param endTime - the string representation of the end date and time the user wants to schedule */ public void isConflict(String taskName, String startTime, String endTime) { - ScheduleCTRequestModel inputData = new ScheduleCTRequestModel(taskName, startTime, endTime, studentUser); + ScheduleCTRequestModel inputData = new ScheduleCTRequestModel(taskName, startTime, endTime); scheduleInput.schedule(inputData); } } \ No newline at end of file diff --git a/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTInteractor.java b/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTInteractor.java index 96c5681..f746aba 100644 --- a/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTInteractor.java +++ b/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTInteractor.java @@ -30,7 +30,7 @@ public ScheduleCTResponseModel schedule(ScheduleCTRequestModel requestModel) { CollaborativeTask task = getTaskObjectFromName(requestModel.getTaskName(), taskHashMap); - StudentUser currentUser = (StudentUser) requestModel.getStudentUser(); + StudentUser currentUser = (StudentUser) CurrentUser.getCurrentUser(); if (currentUser != task.getLeader()) { return scheduleCTOutputBoundary.prepareFailView("User is not the leader. " + diff --git a/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTRequestModel.java b/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTRequestModel.java index be50027..87a9a73 100644 --- a/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTRequestModel.java +++ b/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTRequestModel.java @@ -1,10 +1,5 @@ package use_cases.collaborative_task_scheduling.scheduling_ct_use_case; - -import entities.Task; - -import java.util.HashMap; - /** * Request Model for the Scheduling Collaborative Tasks Use Case * Acts as the input data object in the use case layer @@ -18,13 +13,10 @@ public class ScheduleCTRequestModel { private final String endTime; - private final Object studentUser; - - public ScheduleCTRequestModel(String taskName, String startTime, String endTime, Object studentUser) { + public ScheduleCTRequestModel(String taskName, String startTime, String endTime) { this.taskName = taskName; this.startTime = startTime; this.endTime = endTime; - this.studentUser = studentUser; } public String getTaskName() { return taskName; } @@ -36,6 +28,4 @@ public String getStartTime() { public String getEndTime() { return endTime; } - - public Object getStudentUser() { return studentUser; } } \ No newline at end of file diff --git a/src/test/java/scheduling_ct_use_case/ScheduleCTInteractorTest.java b/src/test/java/scheduling_ct_use_case/ScheduleCTInteractorTest.java index d745bfe..8124d82 100644 --- a/src/test/java/scheduling_ct_use_case/ScheduleCTInteractorTest.java +++ b/src/test/java/scheduling_ct_use_case/ScheduleCTInteractorTest.java @@ -1,5 +1,6 @@ package scheduling_ct_use_case; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import screens.collaborative_task_scheduling.*; import use_cases.collaborative_task_scheduling.scheduling_ct_use_case.*; @@ -17,164 +18,168 @@ class ScheduleCTInteractorTest { - // CHANGED USE CASE TO CALL TASK MAP INSTEAD OF BRINGING IN ALL TASKS - // NEED TO TEST DIFFERENTLY -// -// @Test -// void schedule() { -// -// // CREATING DATES IT SHOULD EQUAL TO -// // Wed, Dec 7, from 10-11 am -// // Wed, Dec 14, from 10-11 am -// // Wed, Dec 21, from 10-11 am -// ArrayList formattedDates = new ArrayList<>(); -// String date1 = "2022-12-07 10:00 to 2022-12-07 11:00"; -// String date2 = "2022-12-14 10:00 to 2022-12-14 11:00"; -// String date3 = "2022-12-21 10:00 to 2022-12-21 11:00"; -// formattedDates.add(date1); -// formattedDates.add(date2); -// formattedDates.add(date3); -// -// CardLayout cardLayout = new CardLayout(); -// JPanel screens = new JPanel(); -// ScheduleCTViewInterface view = new ScheduleCTView(cardLayout, screens); -// -// // This creates an anonymous implementing class for the Output Boundary. -// ScheduleCTOutputBoundary presenter = new ScheduleCTPresenter(view) { -// @Override -// public ScheduleCTResponseModel prepareNoConflictView(ScheduleCTResponseModel responseModel) { -// assertEquals(formattedDates, responseModel.getScheduledTimes()); -// return null; -// } -// // 4) Check that the Output Data and associated changes -// // are correct -// @Override -// public ScheduleCTResponseModel prepareFailView(String error) { -// fail("Use case failure is unexpected."); -// return null; -// } -// }; -// -// ScheduleCTInteractor interactor = new ScheduleCTInteractor(presenter); -// -// // CREATING THE STUDENT USERS -// // USER 1: TAYLOR -// StudentUser taylorUser = new StudentUser("Taylor", "TaylorPassword"); -// // TO DO LIST -// ArrayList taylorToDoList = new ArrayList<>(); -// taylorToDoList.add("TaylorTask1"); -// taylorToDoList.add("TaylorTask2"); -// taylorUser.setToDoList(taylorToDoList); -// // WORKING HOURS -// ArrayList taylorWorkingHours = new ArrayList<>(); -// LocalTime taylorStartWorkingHours = LocalTime.of(1, 0); -// LocalTime taylorEndWorkingHours = LocalTime.of(6, 0); -// taylorWorkingHours.add(taylorStartWorkingHours); -// taylorWorkingHours.add(taylorEndWorkingHours); -// taylorUser.setWorkingHours(taylorWorkingHours); -// -// // USER 2: PHOEBE -// StudentUser phoebeUser = new StudentUser("Phoebe", "PhoebePassword"); -// // TO DO LIST -// ArrayList phoebeToDoList = new ArrayList<>(); -// phoebeToDoList.add("PhoebeTask1"); -// phoebeToDoList.add("PhoebeTask2"); -// phoebeUser.setToDoList(phoebeToDoList); -// // WORKING HOURS -// ArrayList phoebeWorkingHours = new ArrayList<>(); -// LocalTime phoebeStartWorkingHours = LocalTime.of(1, 0); -// LocalTime phoebeEndWorkingHours = LocalTime.of(6, 0); -// phoebeWorkingHours.add(phoebeStartWorkingHours); -// phoebeWorkingHours.add(phoebeEndWorkingHours); -// phoebeUser.setWorkingHours(phoebeWorkingHours); -// -// // CREATING USER TASKS -// // TAYLOR TASK 1 -// entities.Event taylorTask1 = new entities.Event("Networking Event", "TaylorTask1", 1, -// LocalDateTime.of(2022, 12, 9, 17, 0), -// LocalDateTime.of(2022, 12, 9, 19, 0), -// false, ""); -// // TAYLOR TASK 2 -// entities.Test taylorTask2 = new entities.Test("Biology Term Test", "TaylorTask2", -// LocalDateTime.of(2022, 12, 14, 16, 0), -// LocalDateTime.of(2022, 12, 14, 17, 0), -// 10); -// // TAYLOR TASK 2 PREP TIME -// ArrayList> taylorTask2PrepTime = new ArrayList<>(); -// ArrayList taylorPrepTime1 = new ArrayList<>(); -// LocalDateTime taylorPrepTime1Start = LocalDateTime.of(2022, 12, 12, 15, 0); -// LocalDateTime taylorPrepTime1End = LocalDateTime.of(2022, 12, 12, 16, 0); -// taylorPrepTime1.add(taylorPrepTime1Start); -// taylorPrepTime1.add(taylorPrepTime1End); -// -// ArrayList taylorPrepTime2 = new ArrayList<>(); -// LocalDateTime taylorPrepTime2Start = LocalDateTime.of(2022, 12, 13, 15, 0); -// LocalDateTime taylorPrepTime2End = LocalDateTime.of(2022, 12, 13, 16, 0); -// taylorPrepTime2.add(taylorPrepTime2Start); -// taylorPrepTime2.add(taylorPrepTime2End); -// -// taylorTask2PrepTime.add(taylorPrepTime1); -// taylorTask2PrepTime.add(taylorPrepTime2); -// taylorTask2.setPrepTimeScheduled(taylorTask2PrepTime); -// -// // PHOEBE TASK 1 -// entities.Assignment phoebeTask1 = new entities.Assignment("Math Problem Set", "PhoebeTask1", -// LocalDateTime.of(2022, 12, 9, 20, 0), -// 5); -// // PHOEBE TASK 2 PREP TIME -// ArrayList> phoebeTask1PrepTime = new ArrayList<>(); -// ArrayList phoebePrepTime1 = new ArrayList<>(); -// LocalDateTime phoebePrepTime1Start = LocalDateTime.of(2022, 12, 12, 15, 0); -// LocalDateTime phoebePrepTime1End = LocalDateTime.of(2022, 12, 12, 16, 0); -// phoebePrepTime1.add(phoebePrepTime1Start); -// phoebePrepTime1.add(phoebePrepTime1End); -// -// ArrayList phoebePrepTime2 = new ArrayList<>(); -// LocalDateTime phoebePrepTime2Start = LocalDateTime.of(2022, 12, 13, 15, 0); -// LocalDateTime phoebePrepTime2End = LocalDateTime.of(2022, 12, 13, 16, 0); -// phoebePrepTime2.add(phoebePrepTime2Start); -// phoebePrepTime2.add(phoebePrepTime2End); -// -// phoebeTask1PrepTime.add(phoebePrepTime1); -// phoebeTask1PrepTime.add(phoebePrepTime2); -// phoebeTask1.setPrepTimeScheduled(phoebeTask1PrepTime); -// -// // PHOEBE TASK 2 -// entities.Event phoebeTask2 = new entities.Event("Meet with friends", "PhoebeTask2", 1, -// LocalDateTime.of(2022, 12, 15, 18, 0), -// LocalDateTime.of(2022, 12, 15, 19, 0), -// false, ""); -// -// // CREATING COLLABORATIVE TASK -// CollaborativeTask collaborativeTask = new CollaborativeTask("Work on project", "CollaborativeTask1", -// 1, true, "weekly", -// LocalDateTime.of(2022, 12, 7, 10, 0), -// LocalDateTime.of(2022, 12, 7, 11, 0), -// LocalDateTime.of(2022, 12, 22, 12, 0), -// taylorUser); -// // SETTING TEAMMATES -// ArrayList teammates = new ArrayList<>(); -// teammates.add(phoebeUser); -// collaborativeTask.setTeammates(teammates); -// -// // CREATING HASH MAP -// HashMap hashMap = new HashMap<>(); -// hashMap.put("TaylorTask1", taylorTask1); -// hashMap.put("TaylorTask2", taylorTask2); -// hashMap.put("PhoebeTask1", phoebeTask1); -// hashMap.put("PhoebeTask2", phoebeTask2); -// hashMap.put("CollaborativeTask1", collaborativeTask); -// -// -// // MAKING INPUT DATA -// // INPUT INTO THE USER INTERFACE SCREEN -// String taskName = "Work on project"; -// String startTime = "2022-12-07 10:00"; -// String endTime = "2022-12-07 11:00"; -// ScheduleCTRequestModel inputData = new ScheduleCTRequestModel(taskName, startTime, endTime, taylorUser); -// -// // RUNNING THE TEST -// interactor.schedule(inputData); -// -// } + @BeforeAll + static void setTaskMapAndCurrentUser() { + // CREATING THE STUDENT USERS + // USER 1: TAYLOR + StudentUser taylorUser = new StudentUser("Taylor", "TaylorPassword"); + // TO DO LIST + ArrayList taylorToDoList = new ArrayList<>(); + taylorToDoList.add("TaylorTask1"); + taylorToDoList.add("TaylorTask2"); + taylorUser.setToDoList(taylorToDoList); + // WORKING HOURS + ArrayList taylorWorkingHours = new ArrayList<>(); + LocalTime taylorStartWorkingHours = LocalTime.of(1, 0); + LocalTime taylorEndWorkingHours = LocalTime.of(6, 0); + taylorWorkingHours.add(taylorStartWorkingHours); + taylorWorkingHours.add(taylorEndWorkingHours); + taylorUser.setWorkingHours(taylorWorkingHours); + + // USER 2: PHOEBE + StudentUser phoebeUser = new StudentUser("Phoebe", "PhoebePassword"); + // TO DO LIST + ArrayList phoebeToDoList = new ArrayList<>(); + phoebeToDoList.add("PhoebeTask1"); + phoebeToDoList.add("PhoebeTask2"); + phoebeUser.setToDoList(phoebeToDoList); + // WORKING HOURS + ArrayList phoebeWorkingHours = new ArrayList<>(); + LocalTime phoebeStartWorkingHours = LocalTime.of(1, 0); + LocalTime phoebeEndWorkingHours = LocalTime.of(6, 0); + phoebeWorkingHours.add(phoebeStartWorkingHours); + phoebeWorkingHours.add(phoebeEndWorkingHours); + phoebeUser.setWorkingHours(phoebeWorkingHours); + + // CREATING USER TASKS + // TAYLOR TASK 1 + entities.Event taylorTask1 = new entities.Event("Networking Event", "TaylorTask1", 1, + LocalDateTime.of(2022, 12, 9, 17, 0), + LocalDateTime.of(2022, 12, 9, 19, 0), + false, ""); + // TAYLOR TASK 2 + entities.Test taylorTask2 = new entities.Test("Biology Term Test", "TaylorTask2", + LocalDateTime.of(2022, 12, 14, 16, 0), + LocalDateTime.of(2022, 12, 14, 17, 0), + 10); + // TAYLOR TASK 2 PREP TIME + ArrayList> taylorTask2PrepTime = new ArrayList<>(); + ArrayList taylorPrepTime1 = new ArrayList<>(); + LocalDateTime taylorPrepTime1Start = LocalDateTime.of(2022, 12, 12, 15, 0); + LocalDateTime taylorPrepTime1End = LocalDateTime.of(2022, 12, 12, 16, 0); + taylorPrepTime1.add(taylorPrepTime1Start); + taylorPrepTime1.add(taylorPrepTime1End); + + ArrayList taylorPrepTime2 = new ArrayList<>(); + LocalDateTime taylorPrepTime2Start = LocalDateTime.of(2022, 12, 13, 15, 0); + LocalDateTime taylorPrepTime2End = LocalDateTime.of(2022, 12, 13, 16, 0); + taylorPrepTime2.add(taylorPrepTime2Start); + taylorPrepTime2.add(taylorPrepTime2End); + + taylorTask2PrepTime.add(taylorPrepTime1); + taylorTask2PrepTime.add(taylorPrepTime2); + taylorTask2.setPrepTimeScheduled(taylorTask2PrepTime); + + // PHOEBE TASK 1 + entities.Assignment phoebeTask1 = new entities.Assignment("Math Problem Set", "PhoebeTask1", + LocalDateTime.of(2022, 12, 9, 20, 0), + 5); + // PHOEBE TASK 2 PREP TIME + ArrayList> phoebeTask1PrepTime = new ArrayList<>(); + ArrayList phoebePrepTime1 = new ArrayList<>(); + LocalDateTime phoebePrepTime1Start = LocalDateTime.of(2022, 12, 12, 15, 0); + LocalDateTime phoebePrepTime1End = LocalDateTime.of(2022, 12, 12, 16, 0); + phoebePrepTime1.add(phoebePrepTime1Start); + phoebePrepTime1.add(phoebePrepTime1End); + + ArrayList phoebePrepTime2 = new ArrayList<>(); + LocalDateTime phoebePrepTime2Start = LocalDateTime.of(2022, 12, 13, 15, 0); + LocalDateTime phoebePrepTime2End = LocalDateTime.of(2022, 12, 13, 16, 0); + phoebePrepTime2.add(phoebePrepTime2Start); + phoebePrepTime2.add(phoebePrepTime2End); + + phoebeTask1PrepTime.add(phoebePrepTime1); + phoebeTask1PrepTime.add(phoebePrepTime2); + phoebeTask1.setPrepTimeScheduled(phoebeTask1PrepTime); + + // PHOEBE TASK 2 + entities.Event phoebeTask2 = new entities.Event("Meet with friends", "PhoebeTask2", 1, + LocalDateTime.of(2022, 12, 15, 18, 0), + LocalDateTime.of(2022, 12, 15, 19, 0), + false, ""); + + // CREATING COLLABORATIVE TASK + CollaborativeTask collaborativeTask = new CollaborativeTask("Work on project", "CollaborativeTask1", + 1, true, "weekly", + LocalDateTime.of(2022, 12, 7, 10, 0), + LocalDateTime.of(2022, 12, 7, 11, 0), + LocalDateTime.of(2022, 12, 22, 12, 0), + taylorUser); + // SETTING TEAMMATES + ArrayList teammates = new ArrayList<>(); + teammates.add(phoebeUser); + collaborativeTask.setTeammates(teammates); + + // CREATING HASH MAP + HashMap hashMap = new HashMap<>(); + hashMap.put("TaylorTask1", taylorTask1); + hashMap.put("TaylorTask2", taylorTask2); + hashMap.put("PhoebeTask1", phoebeTask1); + hashMap.put("PhoebeTask2", phoebeTask2); + hashMap.put("CollaborativeTask1", collaborativeTask); + + // SETTING THE TASK MAP + TaskMap.setTaskMap(hashMap); + + // SETTING THE CURRENT USER + CurrentUser.setCurrentUser(taylorUser); + } + + @Test + void schedule() { + + // CREATING DATES IT SHOULD EQUAL TO + // Wed, Dec 7, from 10-11 am + // Wed, Dec 14, from 10-11 am + // Wed, Dec 21, from 10-11 am + ArrayList formattedDates = new ArrayList<>(); + String date1 = "2022-12-07 10:00 to 2022-12-07 11:00"; + String date2 = "2022-12-14 10:00 to 2022-12-14 11:00"; + String date3 = "2022-12-21 10:00 to 2022-12-21 11:00"; + formattedDates.add(date1); + formattedDates.add(date2); + formattedDates.add(date3); + + CardLayout cardLayout = new CardLayout(); + JPanel screens = new JPanel(); + ScheduleCTViewInterface view = new ScheduleCTView(cardLayout, screens); + + // This creates an anonymous implementing class for the Output Boundary. + ScheduleCTOutputBoundary presenter = new ScheduleCTPresenter(view) { + @Override + public ScheduleCTResponseModel prepareNoConflictView(ScheduleCTResponseModel responseModel) { + assertEquals(formattedDates, responseModel.getScheduledTimes()); + return null; + } + // 4) Check that the Output Data and associated changes + // are correct + @Override + public ScheduleCTResponseModel prepareFailView(String error) { + fail("Use case failure is unexpected."); + return null; + } + }; + + ScheduleCTInteractor interactor = new ScheduleCTInteractor(presenter); + + // MAKING INPUT DATA + // INPUT INTO THE USER INTERFACE SCREEN + String taskName = "Work on project"; + String startTime = "2022-12-07 10:00"; + String endTime = "2022-12-07 11:00"; + ScheduleCTRequestModel inputData = new ScheduleCTRequestModel(taskName, startTime, endTime); + + // RUNNING THE TEST + interactor.schedule(inputData); + } } \ No newline at end of file From e602fae9ef9695602376f5c1d23d28b4b5d05fe9 Mon Sep 17 00:00:00 2001 From: alyson647 Date: Sat, 3 Dec 2022 21:11:03 -0500 Subject: [PATCH 12/15] Use CurrentUser and removed unused method --- .../ScheduleCTInteractor.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTInteractor.java b/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTInteractor.java index f746aba..b842430 100644 --- a/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTInteractor.java +++ b/src/main/java/use_cases/collaborative_task_scheduling/scheduling_ct_use_case/ScheduleCTInteractor.java @@ -396,20 +396,4 @@ public String convertLocalDateTimeToString(LocalDateTime start, LocalDateTime en String formattedEnd = end.format(formatter); return formattedStart + " to " + formattedEnd; } - - /** - * Turn all objects into tasks (by casting them) in the hash map - * @param objectHashMap - the hash map that maps strings to objects - * @return the same hash map but they are task objects instead - */ - public HashMap objectToTask(HashMap objectHashMap) { - - HashMap taskHashMap = new HashMap<>(); - - for (String key: objectHashMap.keySet()) { - Task task = (Task) objectHashMap.get(key); - taskHashMap.put(key, task); - } - return taskHashMap; - } } \ No newline at end of file From 19808bec7da8415bfbd821da92795d95bb56a391 Mon Sep 17 00:00:00 2001 From: alyson647 Date: Sat, 3 Dec 2022 21:26:18 -0500 Subject: [PATCH 13/15] Added scheduling ct png to readme + edited part a bit --- README.md | 10 +++++++--- images/scheduling_ct.png | Bin 0 -> 58524 bytes 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 images/scheduling_ct.png diff --git a/README.md b/README.md index 432dd8a..67d4b07 100644 --- a/README.md +++ b/README.md @@ -63,14 +63,18 @@ _Not yet implemented (extending on what is currently working in the MVP feature) If the user clicks on the `Scheduling CT` button, the screen to schedule a collaborative task will be displayed. On this screen, the user can schedule a collaborative task. -To schedule a collaborative task, the user must input the name of the task, as well as the time block (start time and end time) in the format YYYY-MM-dd HH:mm. -Then the user must click on the `Submit` button to schedule the collaborative task. +![](images/scheduling_ct.png) + +To schedule a collaborative task, the user must input the name of the task, as well as the time block +(start time and end time) in the format yyyy-MM-dd hh:mm. +Then the user must click on the `Schedule` button to schedule the collaborative task. Only the leader/creator of the collaborative task is able to schedule it. Depending on what the user chose frequency and deadline to be, the dates scheduled will differ. If there is a conflict with the inputted time block, a screen will pop up that says there is a conflict. It is on the user to either communicate with their group about this conflict or to try and reschedule another time. -If there is no conflict, the dates and times will be scheduled and the program will return the successful input. +If there is no conflict, the dates and times will be displayed to the user, and it is on the user to communicate these +dates to their group. ## Progress Tracker diff --git a/images/scheduling_ct.png b/images/scheduling_ct.png new file mode 100644 index 0000000000000000000000000000000000000000..bcae080c4be76b9bb5c535a04582633e1199084c GIT binary patch literal 58524 zcmZU32Ut@}^EY0-WMws#WMx@2U7W1#9IOZkUPUAt+%eSYqR9frefctQo$wV=3(-TN_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B0S^?L2U0um&8#__|87E-u>zNnFK>uSyg9{QFmb7PTS zX&vp*9o(>Ozfw(!Rh`0i35(N?_xg!uFFOpurMn9$BUBl&6i&eBI{e2_d&36*IMSv6 z4u{2v0_Fg~y#5=12>m$Mq_KA9^jwGC{4qHPkH4L6%l_mJ8cGD9Is3(X+N>ezbW2BX zoN{UAdk?{YxlNf@7UEM-F5a{%H;WMXh+jq{^HtfapG05dLKlS(uLf)!7Z6-0nY{z-&C{@tHgR^pO5L6%Xv|07I2N05~l?&?m|qB9MMms#1fv$=z?Z zEro5sxaHS`p=Afz!n}9Z(0iXHs)|SzqQLE@knHjx6K}$klsS7iGVSVXe)e{haxIK6 zzFx47)UF%h51rHz%5Td z5wljldeIQof}!|eXT%RcwpeUu@X<^Otg~52=Tn^)eB%oa%H-fiPRjN6v%VXQ>X3GB zKAhcRx>;Ajkq-fNMiFM~5^VS95ZIJmfW%Kv?^GA~fa{`-G4FU1k~8cf(mdK)=X1Y! zyVvaFEX_3s5eakKC%t~hVi-sLNhhst`meM zkbTsyGWIwPFe_Soy~~P(uQO2`HfSWIwuuMrfn}p?`RTf=ELR54w9BHmR=>+r)h~al zz47H24QzfmJ!^GyQPz;dmWAoeUbvzq+JV5)>yRb%<^2zS>xXE>KQP-5(TE?S5&zm6 zKh$4%ehBFNy&8UK5P?_tZ^-jM1``rPKQxHIr}`n|^cSr9LkSC<{QpnI#6C?uc8XqN z`t@M+k^TtS+W(^YM|B;mAk Date: Sat, 3 Dec 2022 21:52:38 -0500 Subject: [PATCH 14/15] Added request model and response model tests --- .../ScheduleCTRequestModelTest.java | 31 +++++++++++++++++++ .../ScheduleCTResponseModelTest.java | 31 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 src/test/java/scheduling_ct_use_case/ScheduleCTRequestModelTest.java create mode 100644 src/test/java/scheduling_ct_use_case/ScheduleCTResponseModelTest.java diff --git a/src/test/java/scheduling_ct_use_case/ScheduleCTRequestModelTest.java b/src/test/java/scheduling_ct_use_case/ScheduleCTRequestModelTest.java new file mode 100644 index 0000000..5861280 --- /dev/null +++ b/src/test/java/scheduling_ct_use_case/ScheduleCTRequestModelTest.java @@ -0,0 +1,31 @@ +package scheduling_ct_use_case; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import use_cases.collaborative_task_scheduling.scheduling_ct_use_case.ScheduleCTRequestModel; + +public class ScheduleCTRequestModelTest { + static ScheduleCTRequestModel scheduleCTRequestModel; + + @BeforeAll + static void beforeAll() { + scheduleCTRequestModel = new ScheduleCTRequestModel("taskName", "2022-12-07 10:00", + "2022-12-07 11:00"); + } + + @Test + void getTaskName() { + Assertions.assertEquals("taskName", scheduleCTRequestModel.getTaskName()); + } + + @Test + void getStart() { + Assertions.assertEquals("2022-12-07 10:00", scheduleCTRequestModel.getStartTime()); + } + + @Test + void getEnd() { + Assertions.assertEquals("2022-12-07 11:00", scheduleCTRequestModel.getEndTime()); + } +} diff --git a/src/test/java/scheduling_ct_use_case/ScheduleCTResponseModelTest.java b/src/test/java/scheduling_ct_use_case/ScheduleCTResponseModelTest.java new file mode 100644 index 0000000..fc859c6 --- /dev/null +++ b/src/test/java/scheduling_ct_use_case/ScheduleCTResponseModelTest.java @@ -0,0 +1,31 @@ +package scheduling_ct_use_case; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import use_cases.collaborative_task_scheduling.scheduling_ct_use_case.ScheduleCTResponseModel; + +import java.util.ArrayList; + +public class ScheduleCTResponseModelTest { + static ScheduleCTResponseModel scheduleCTResponseModel; + + @BeforeAll + static void beforeAll() { + ArrayList scheduledTimes = new ArrayList<>(); + scheduledTimes.add("2022-12-07 10:00 to 2022-12-07 11:00"); + scheduledTimes.add("2022-12-08 10:00 to 2022-12-08 11:00"); + scheduledTimes.add("2022-12-09 10:00 to 2022-12-09 11:00"); + + scheduleCTResponseModel = new ScheduleCTResponseModel(scheduledTimes); + } + + @Test + void getScheduledTimes() { + ArrayList scheduledTimes = new ArrayList<>(); + scheduledTimes.add("2022-12-07 10:00 to 2022-12-07 11:00"); + scheduledTimes.add("2022-12-08 10:00 to 2022-12-08 11:00"); + scheduledTimes.add("2022-12-09 10:00 to 2022-12-09 11:00"); + Assertions.assertEquals(scheduledTimes, scheduleCTResponseModel.getScheduledTimes()); + } +} From 6e4fb9ec9dde8925d5300ec97f409df17c785b24 Mon Sep 17 00:00:00 2001 From: CC-3636 Date: Mon, 5 Dec 2022 12:29:16 -0500 Subject: [PATCH 15/15] got rid of unnecessary lines in main (the lines 60-62 part) and commented out the parts that don't work because they require a user to be initialized --- src/test/java/{ => user_register_usecase}/FileUserTest.java | 2 ++ 1 file changed, 2 insertions(+) rename src/test/java/{ => user_register_usecase}/FileUserTest.java (98%) diff --git a/src/test/java/FileUserTest.java b/src/test/java/user_register_usecase/FileUserTest.java similarity index 98% rename from src/test/java/FileUserTest.java rename to src/test/java/user_register_usecase/FileUserTest.java index f25e628..fb24a4d 100644 --- a/src/test/java/FileUserTest.java +++ b/src/test/java/user_register_usecase/FileUserTest.java @@ -1,3 +1,5 @@ +package user_register_usecase; + import entities.InstructorUser; import entities.StudentUser; import org.junit.jupiter.api.Test;