All Exercises in This Part
Return the project refactored in Exercise 8.1. Recap of the steps in this part:
- Create a separate model object (
Task) for tasks instead of using UI components directly. - Add at least a task title and a done/not-done state to the model.
- Use
ObservableList<Task>as the primary data structure for tasks. - Update the task creation logic to use the model object.
When the phase is complete, run git add for the modified files and create a git commit.
Return your project files.
Return the project refactored in Exercise 8.2. Recap of the steps in this part:
- Replace the task
VBox+CheckBoxlisting with aTableViewcomponent. - Add at least the following columns to the table: task (title), done status.
- Bind the table's data to an
ObservableList<Task>list. - Allow the user to select a task and delete the selected row.
When the phase is complete, run git add for the modified files and create a git commit.
Return your project files.
Return the project refactored in Exercise 8.3. Recap of the steps in this part:
- Organize the project into layers (at minimum: model + UI logic).
- Move the file reading and writing logic from the controller into a
TaskCollectionclass. - Modify the
MainControllerclass so that it delegates save and load operations to the model.
When the phase is complete, run git add for the modified files and create a git commit.
Return your project files.
Return the project refactored in Exercise 8.4. Recap of the steps in this part:
- Open the task editing view when the user double-clicks a task.
- Add at least a description and a priority to the task.
- Add validation for user input (for example, the task title must not be empty).
- Save the changes back to the task and update the view.
When the phase is complete, run git add for the modified files and create a git commit.
Return your project files.
Take your solution (or the model solution) from Exercise 5.10 and write unit tests for it. Test the functionality of the method with at least five different inputs. Use the examples given in the exercise or create your own test cases.
Write unit tests for the TaskCollection class. Test at least the following:
- When a task is added with a title that contains leading and trailing spaces, the spaces are removed before the task is stored in the list.
- When two tasks with the same title are added to the collection, both of them are actually stored in the list.
- Continuing from the previous case: when one of those tasks is marked as completed, only that specific task is marked as completed, not the other one.
- When two different tasks are added to the collection one after another, both are stored in the list in the correct order.
Return the TaskCollectionTest class.
Return the project refactored in Exercise 8.5. Recap of the steps in this part:
- Add unit tests to the project.
- Separate task saving and loading into a dedicated class that implements the
TaskRepositoryinterface. - Create a mock class in the test package that implements the
TaskRepositoryinterface but stores data only in memory. - Test file saving and loading.
When the phase is complete, run git add for the modified files and create a git commit.
Return the TaskRepository interface as well as the JsonTaskRepository, MockTaskRepository, and TaskCollectionTest classes. No other classes or FXML files need to be returned.
Create a public Git remote repository for your work and save your code there.