From 563931d501deb4d1ac879d6c6833c40a7b91c184 Mon Sep 17 00:00:00 2001 From: gsmoon97 Date: Sat, 26 Sep 2020 23:31:21 +0900 Subject: [PATCH 1/2] refactor addressbook to clinical --- .../diagrams/ArchitectureSequenceDiagram.puml | 2 +- src/main/java/seedu/address/MainApp.java | 38 +++--- .../address/commons/core/LogsCenter.java | 2 +- src/main/java/seedu/address/logic/Logic.java | 10 +- .../seedu/address/logic/LogicManager.java | 20 ++-- .../address/logic/commands/ClearCommand.java | 4 +- ...essBookParser.java => CliniCalParser.java} | 2 +- .../model/{AddressBook.java => CliniCal.java} | 18 +-- src/main/java/seedu/address/model/Model.java | 12 +- .../seedu/address/model/ModelManager.java | 48 ++++---- ...AddressBook.java => ReadOnlyCliniCal.java} | 2 +- .../address/model/ReadOnlyUserPrefs.java | 2 +- .../java/seedu/address/model/UserPrefs.java | 20 ++-- .../address/model/util/SampleDataUtil.java | 10 +- .../address/storage/AddressBookStorage.java | 45 ------- .../address/storage/CliniCalStorage.java | 46 ++++++++ ...kStorage.java => JsonCliniCalStorage.java} | 40 +++---- ...ook.java => JsonSerializableCliniCal.java} | 32 ++--- .../java/seedu/address/storage/Storage.java | 10 +- .../seedu/address/storage/StorageManager.java | 34 +++--- .../java/seedu/address/ui/MainWindow.java | 2 +- src/main/java/seedu/address/ui/UiManager.java | 2 +- src/main/resources/images/stethoscope.png | Bin 0 -> 24919 bytes src/main/resources/view/MainWindow.fxml | 4 +- .../typicalPatientsAddressBook.json | 2 +- .../ExtraValuesUserPref.json | 2 +- .../TypicalUserPref.json | 2 +- .../address/commons/util/AppUtilTest.java | 2 +- .../seedu/address/logic/LogicManagerTest.java | 26 ++--- .../commands/AddCommandIntegrationTest.java | 8 +- .../logic/commands/AddCommandTest.java | 16 +-- .../logic/commands/ClearCommandTest.java | 14 +-- .../logic/commands/CommandTestUtil.java | 10 +- .../logic/commands/DeleteCommandTest.java | 12 +- .../logic/commands/EditCommandTest.java | 24 ++-- .../logic/commands/FindCommandTest.java | 6 +- .../logic/commands/ListCommandTest.java | 6 +- ...arserTest.java => CliniCalParserTest.java} | 4 +- ...AddressBookTest.java => CliniCalTest.java} | 48 ++++---- .../seedu/address/model/ModelManagerTest.java | 40 +++---- .../seedu/address/model/UserPrefsTest.java | 4 +- .../storage/JsonAddressBookStorageTest.java | 110 ------------------ .../storage/JsonCliniCalStorageTest.java | 110 ++++++++++++++++++ ...java => JsonSerializableCliniCalTest.java} | 32 ++--- .../storage/JsonUserPrefsStorageTest.java | 2 +- .../address/storage/StorageManagerTest.java | 28 ++--- .../address/testutil/AddressBookBuilder.java | 34 ------ .../address/testutil/CliniCalBuilder.java | 34 ++++++ .../address/testutil/TypicalPatients.java | 8 +- 49 files changed, 495 insertions(+), 494 deletions(-) rename src/main/java/seedu/address/logic/parser/{AddressBookParser.java => CliniCalParser.java} (98%) rename src/main/java/seedu/address/model/{AddressBook.java => CliniCal.java} (83%) rename src/main/java/seedu/address/model/{ReadOnlyAddressBook.java => ReadOnlyCliniCal.java} (89%) delete mode 100644 src/main/java/seedu/address/storage/AddressBookStorage.java create mode 100644 src/main/java/seedu/address/storage/CliniCalStorage.java rename src/main/java/seedu/address/storage/{JsonAddressBookStorage.java => JsonCliniCalStorage.java} (50%) rename src/main/java/seedu/address/storage/{JsonSerializableAddressBook.java => JsonSerializableCliniCal.java} (56%) create mode 100644 src/main/resources/images/stethoscope.png rename src/test/java/seedu/address/logic/parser/{AddressBookParserTest.java => CliniCalParserTest.java} (97%) rename src/test/java/seedu/address/model/{AddressBookTest.java => CliniCalTest.java} (58%) delete mode 100644 src/test/java/seedu/address/storage/JsonAddressBookStorageTest.java create mode 100644 src/test/java/seedu/address/storage/JsonCliniCalStorageTest.java rename src/test/java/seedu/address/storage/{JsonSerializableAddressBookTest.java => JsonSerializableCliniCalTest.java} (53%) delete mode 100644 src/test/java/seedu/address/testutil/AddressBookBuilder.java create mode 100644 src/test/java/seedu/address/testutil/CliniCalBuilder.java diff --git a/docs/diagrams/ArchitectureSequenceDiagram.puml b/docs/diagrams/ArchitectureSequenceDiagram.puml index ef81d18c337..91b60f94478 100644 --- a/docs/diagrams/ArchitectureSequenceDiagram.puml +++ b/docs/diagrams/ArchitectureSequenceDiagram.puml @@ -19,7 +19,7 @@ activate model MODEL_COLOR model -[MODEL_COLOR]-> logic deactivate model -logic -[LOGIC_COLOR]> storage : saveAddressBook(addressBook) +logic -[LOGIC_COLOR]> storage : saveAddressBook(cliniCal) activate storage STORAGE_COLOR storage -[STORAGE_COLOR]> storage : Save to file diff --git a/src/main/java/seedu/address/MainApp.java b/src/main/java/seedu/address/MainApp.java index e5cfb161b73..698675bf194 100644 --- a/src/main/java/seedu/address/MainApp.java +++ b/src/main/java/seedu/address/MainApp.java @@ -15,15 +15,15 @@ import seedu.address.commons.util.StringUtil; import seedu.address.logic.Logic; import seedu.address.logic.LogicManager; -import seedu.address.model.AddressBook; +import seedu.address.model.CliniCal; import seedu.address.model.Model; import seedu.address.model.ModelManager; -import seedu.address.model.ReadOnlyAddressBook; +import seedu.address.model.ReadOnlyCliniCal; import seedu.address.model.ReadOnlyUserPrefs; import seedu.address.model.UserPrefs; import seedu.address.model.util.SampleDataUtil; -import seedu.address.storage.AddressBookStorage; -import seedu.address.storage.JsonAddressBookStorage; +import seedu.address.storage.CliniCalStorage; +import seedu.address.storage.JsonCliniCalStorage; import seedu.address.storage.JsonUserPrefsStorage; import seedu.address.storage.Storage; import seedu.address.storage.StorageManager; @@ -48,7 +48,7 @@ public class MainApp extends Application { @Override public void init() throws Exception { - logger.info("=============================[ Initializing AddressBook ]==========================="); + logger.info("=============================[ Initializing CliniCal ]==========================="); super.init(); AppParameters appParameters = AppParameters.parse(getParameters()); @@ -56,8 +56,8 @@ public void init() throws Exception { UserPrefsStorage userPrefsStorage = new JsonUserPrefsStorage(config.getUserPrefsFilePath()); UserPrefs userPrefs = initPrefs(userPrefsStorage); - AddressBookStorage addressBookStorage = new JsonAddressBookStorage(userPrefs.getAddressBookFilePath()); - storage = new StorageManager(addressBookStorage, userPrefsStorage); + CliniCalStorage cliniCalStorage = new JsonCliniCalStorage(userPrefs.getCliniCalFilePath()); + storage = new StorageManager(cliniCalStorage, userPrefsStorage); initLogging(config); @@ -74,20 +74,20 @@ public void init() throws Exception { * or an empty address book will be used instead if errors occur when reading {@code storage}'s address book. */ private Model initModelManager(Storage storage, ReadOnlyUserPrefs userPrefs) { - Optional addressBookOptional; - ReadOnlyAddressBook initialData; + Optional cliniCalOptional; + ReadOnlyCliniCal initialData; try { - addressBookOptional = storage.readAddressBook(); - if (!addressBookOptional.isPresent()) { - logger.info("Data file not found. Will be starting with a sample AddressBook"); + cliniCalOptional = storage.readCliniCal(); + if (!cliniCalOptional.isPresent()) { + logger.info("Data file not found. Will be starting with a sample CliniCal"); } - initialData = addressBookOptional.orElseGet(SampleDataUtil::getSampleAddressBook); + initialData = cliniCalOptional.orElseGet(SampleDataUtil::getSampleCliniCal); } catch (DataConversionException e) { - logger.warning("Data file not in the correct format. Will be starting with an empty AddressBook"); - initialData = new AddressBook(); + logger.warning("Data file not in the correct format. Will be starting with an empty CliniCal"); + initialData = new CliniCal(); } catch (IOException e) { - logger.warning("Problem while reading from the file. Will be starting with an empty AddressBook"); - initialData = new AddressBook(); + logger.warning("Problem while reading from the file. Will be starting with an empty CliniCal"); + initialData = new CliniCal(); } return new ModelManager(initialData, userPrefs); @@ -151,7 +151,7 @@ protected UserPrefs initPrefs(UserPrefsStorage storage) { + "Using default user prefs"); initializedPrefs = new UserPrefs(); } catch (IOException e) { - logger.warning("Problem while reading from the file. Will be starting with an empty AddressBook"); + logger.warning("Problem while reading from the file. Will be starting with an empty CliniCal"); initializedPrefs = new UserPrefs(); } @@ -167,7 +167,7 @@ protected UserPrefs initPrefs(UserPrefsStorage storage) { @Override public void start(Stage primaryStage) { - logger.info("Starting AddressBook " + MainApp.VERSION); + logger.info("Starting CliniCal " + MainApp.VERSION); ui.start(primaryStage); } diff --git a/src/main/java/seedu/address/commons/core/LogsCenter.java b/src/main/java/seedu/address/commons/core/LogsCenter.java index 431e7185e76..b1700f956a9 100644 --- a/src/main/java/seedu/address/commons/core/LogsCenter.java +++ b/src/main/java/seedu/address/commons/core/LogsCenter.java @@ -18,7 +18,7 @@ public class LogsCenter { private static final int MAX_FILE_COUNT = 5; private static final int MAX_FILE_SIZE_IN_BYTES = (int) (Math.pow(2, 20) * 5); // 5MB - private static final String LOG_FILE = "addressbook.log"; + private static final String LOG_FILE = "clinical.log"; private static Level currentLogLevel = Level.INFO; private static final Logger logger = LogsCenter.getLogger(LogsCenter.class); private static FileHandler fileHandler; diff --git a/src/main/java/seedu/address/logic/Logic.java b/src/main/java/seedu/address/logic/Logic.java index 6bf20698272..622120c4fe3 100644 --- a/src/main/java/seedu/address/logic/Logic.java +++ b/src/main/java/seedu/address/logic/Logic.java @@ -7,7 +7,7 @@ import seedu.address.logic.commands.CommandResult; import seedu.address.logic.commands.exceptions.CommandException; import seedu.address.logic.parser.exceptions.ParseException; -import seedu.address.model.ReadOnlyAddressBook; +import seedu.address.model.ReadOnlyCliniCal; import seedu.address.model.patient.Patient; /** @@ -24,11 +24,11 @@ public interface Logic { CommandResult execute(String commandText) throws CommandException, ParseException; /** - * Returns the AddressBook. + * Returns the CliniCal. * - * @see seedu.address.model.Model#getAddressBook() + * @see seedu.address.model.Model#getCliniCal() */ - ReadOnlyAddressBook getAddressBook(); + ReadOnlyCliniCal getCliniCal(); /** Returns an unmodifiable view of the filtered list of patients */ ObservableList getFilteredPatientList(); @@ -36,7 +36,7 @@ public interface Logic { /** * Returns the user prefs' address book file path. */ - Path getAddressBookFilePath(); + Path getCliniCalFilePath(); /** * Returns the user prefs' GUI settings. diff --git a/src/main/java/seedu/address/logic/LogicManager.java b/src/main/java/seedu/address/logic/LogicManager.java index f6d98585fc1..abda6b5ab7e 100644 --- a/src/main/java/seedu/address/logic/LogicManager.java +++ b/src/main/java/seedu/address/logic/LogicManager.java @@ -10,10 +10,10 @@ import seedu.address.logic.commands.Command; import seedu.address.logic.commands.CommandResult; import seedu.address.logic.commands.exceptions.CommandException; -import seedu.address.logic.parser.AddressBookParser; +import seedu.address.logic.parser.CliniCalParser; import seedu.address.logic.parser.exceptions.ParseException; import seedu.address.model.Model; -import seedu.address.model.ReadOnlyAddressBook; +import seedu.address.model.ReadOnlyCliniCal; import seedu.address.model.patient.Patient; import seedu.address.storage.Storage; @@ -26,7 +26,7 @@ public class LogicManager implements Logic { private final Model model; private final Storage storage; - private final AddressBookParser addressBookParser; + private final CliniCalParser cliniCalParser; /** * Constructs a {@code LogicManager} with the given {@code Model} and {@code Storage}. @@ -34,7 +34,7 @@ public class LogicManager implements Logic { public LogicManager(Model model, Storage storage) { this.model = model; this.storage = storage; - addressBookParser = new AddressBookParser(); + cliniCalParser = new CliniCalParser(); } @Override @@ -44,14 +44,14 @@ public CommandResult execute(String commandText) throws CommandException, ParseE CommandResult commandResult; //Parse user input from String to a Command - Command command = addressBookParser.parseCommand(commandText); + Command command = cliniCalParser.parseCommand(commandText); //Executes the Command and stores the result commandResult = command.execute(model); try { //We can deduce that the previous line of code modifies model in some way // since it's being stored here. - storage.saveAddressBook(model.getAddressBook()); + storage.saveCliniCal(model.getCliniCal()); } catch (IOException ioe) { throw new CommandException(FILE_OPS_ERROR_MESSAGE + ioe, ioe); } @@ -60,8 +60,8 @@ public CommandResult execute(String commandText) throws CommandException, ParseE } @Override - public ReadOnlyAddressBook getAddressBook() { - return model.getAddressBook(); + public ReadOnlyCliniCal getCliniCal() { + return model.getCliniCal(); } @Override @@ -70,8 +70,8 @@ public ObservableList getFilteredPatientList() { } @Override - public Path getAddressBookFilePath() { - return model.getAddressBookFilePath(); + public Path getCliniCalFilePath() { + return model.getCliniCalFilePath(); } @Override diff --git a/src/main/java/seedu/address/logic/commands/ClearCommand.java b/src/main/java/seedu/address/logic/commands/ClearCommand.java index 9c86b1fa6e4..27ad326e51f 100644 --- a/src/main/java/seedu/address/logic/commands/ClearCommand.java +++ b/src/main/java/seedu/address/logic/commands/ClearCommand.java @@ -2,7 +2,7 @@ import static java.util.Objects.requireNonNull; -import seedu.address.model.AddressBook; +import seedu.address.model.CliniCal; import seedu.address.model.Model; /** @@ -17,7 +17,7 @@ public class ClearCommand extends Command { @Override public CommandResult execute(Model model) { requireNonNull(model); - model.setAddressBook(new AddressBook()); + model.setCliniCal(new CliniCal()); return new CommandResult(MESSAGE_SUCCESS); } } diff --git a/src/main/java/seedu/address/logic/parser/AddressBookParser.java b/src/main/java/seedu/address/logic/parser/CliniCalParser.java similarity index 98% rename from src/main/java/seedu/address/logic/parser/AddressBookParser.java rename to src/main/java/seedu/address/logic/parser/CliniCalParser.java index 70fe048ec47..e7e213426ba 100644 --- a/src/main/java/seedu/address/logic/parser/AddressBookParser.java +++ b/src/main/java/seedu/address/logic/parser/CliniCalParser.java @@ -20,7 +20,7 @@ /** * Parses user input. */ -public class AddressBookParser { +public class CliniCalParser { /** * Used for initial separation of command word and args. diff --git a/src/main/java/seedu/address/model/AddressBook.java b/src/main/java/seedu/address/model/CliniCal.java similarity index 83% rename from src/main/java/seedu/address/model/AddressBook.java rename to src/main/java/seedu/address/model/CliniCal.java index 603b25bdbc5..da249f88b23 100644 --- a/src/main/java/seedu/address/model/AddressBook.java +++ b/src/main/java/seedu/address/model/CliniCal.java @@ -12,7 +12,7 @@ * Wraps all data at the address-book level * Duplicates are not allowed (by .isSamePatient comparison) */ -public class AddressBook implements ReadOnlyAddressBook { +public class CliniCal implements ReadOnlyCliniCal { private final UniquePatientList patients; @@ -27,12 +27,12 @@ public class AddressBook implements ReadOnlyAddressBook { patients = new UniquePatientList(); } - public AddressBook() {} + public CliniCal() {} /** - * Creates an AddressBook using the Patients in the {@code toBeCopied} + * Creates a CliniCal using the Patients in the {@code toBeCopied} */ - public AddressBook(ReadOnlyAddressBook toBeCopied) { + public CliniCal(ReadOnlyCliniCal toBeCopied) { this(); resetData(toBeCopied); } @@ -48,9 +48,9 @@ public void setPatients(List patients) { } /** - * Resets the existing data of this {@code AddressBook} with {@code newData}. + * Resets the existing data of this {@code CliniCal} with {@code newData}. */ - public void resetData(ReadOnlyAddressBook newData) { + public void resetData(ReadOnlyCliniCal newData) { requireNonNull(newData); setPatients(newData.getPatientList()); @@ -87,7 +87,7 @@ public void setPatient(Patient target, Patient editedPatient) { } /** - * Removes {@code key} from this {@code AddressBook}. + * Removes {@code key} from this {@code CliniCal}. * {@code key} must exist in the address book. */ public void removePatient(Patient key) { @@ -110,8 +110,8 @@ public ObservableList getPatientList() { @Override public boolean equals(Object other) { return other == this // short circuit if same object - || (other instanceof AddressBook // instanceof handles nulls - && patients.equals(((AddressBook) other).patients)); + || (other instanceof CliniCal // instanceof handles nulls + && patients.equals(((CliniCal) other).patients)); } @Override diff --git a/src/main/java/seedu/address/model/Model.java b/src/main/java/seedu/address/model/Model.java index d6a62a2dd56..76f15169b56 100644 --- a/src/main/java/seedu/address/model/Model.java +++ b/src/main/java/seedu/address/model/Model.java @@ -37,20 +37,20 @@ public interface Model { /** * Returns the user prefs' address book file path. */ - Path getAddressBookFilePath(); + Path getCliniCalFilePath(); /** * Sets the user prefs' address book file path. */ - void setAddressBookFilePath(Path addressBookFilePath); + void setCliniCalFilePath(Path cliniCalFilePath); /** - * Replaces address book data with the data in {@code addressBook}. + * Replaces address book data with the data in {@code cliniCal}. */ - void setAddressBook(ReadOnlyAddressBook addressBook); + void setCliniCal(ReadOnlyCliniCal cliniCal); - /** Returns the AddressBook */ - ReadOnlyAddressBook getAddressBook(); + /** Returns the CliniCal */ + ReadOnlyCliniCal getCliniCal(); /** * Returns true if a patient with the same identity as {@code patient} exists in the address book. diff --git a/src/main/java/seedu/address/model/ModelManager.java b/src/main/java/seedu/address/model/ModelManager.java index 931f9e04128..6f41e5fd53b 100644 --- a/src/main/java/seedu/address/model/ModelManager.java +++ b/src/main/java/seedu/address/model/ModelManager.java @@ -19,26 +19,26 @@ public class ModelManager implements Model { private static final Logger logger = LogsCenter.getLogger(ModelManager.class); - private final AddressBook addressBook; + private final CliniCal cliniCal; private final UserPrefs userPrefs; private final FilteredList filteredPatients; /** - * Initializes a ModelManager with the given addressBook and userPrefs. + * Initializes a ModelManager with the given cliniCal and userPrefs. */ - public ModelManager(ReadOnlyAddressBook addressBook, ReadOnlyUserPrefs userPrefs) { + public ModelManager(ReadOnlyCliniCal cliniCal, ReadOnlyUserPrefs userPrefs) { super(); - requireAllNonNull(addressBook, userPrefs); + requireAllNonNull(cliniCal, userPrefs); - logger.fine("Initializing with address book: " + addressBook + " and user prefs " + userPrefs); + logger.fine("Initializing with address book: " + cliniCal + " and user prefs " + userPrefs); - this.addressBook = new AddressBook(addressBook); + this.cliniCal = new CliniCal(cliniCal); this.userPrefs = new UserPrefs(userPrefs); - filteredPatients = new FilteredList<>(this.addressBook.getPatientList()); + filteredPatients = new FilteredList<>(this.cliniCal.getPatientList()); } public ModelManager() { - this(new AddressBook(), new UserPrefs()); + this(new CliniCal(), new UserPrefs()); } //=========== UserPrefs ================================================================================== @@ -66,42 +66,42 @@ public void setGuiSettings(GuiSettings guiSettings) { } @Override - public Path getAddressBookFilePath() { - return userPrefs.getAddressBookFilePath(); + public Path getCliniCalFilePath() { + return userPrefs.getCliniCalFilePath(); } @Override - public void setAddressBookFilePath(Path addressBookFilePath) { - requireNonNull(addressBookFilePath); - userPrefs.setAddressBookFilePath(addressBookFilePath); + public void setCliniCalFilePath(Path cliniCalFilePath) { + requireNonNull(cliniCalFilePath); + userPrefs.setCliniCalFilePath(cliniCalFilePath); } - //=========== AddressBook ================================================================================ + //=========== CliniCal ================================================================================ @Override - public void setAddressBook(ReadOnlyAddressBook addressBook) { - this.addressBook.resetData(addressBook); + public void setCliniCal(ReadOnlyCliniCal cliniCal) { + this.cliniCal.resetData(cliniCal); } @Override - public ReadOnlyAddressBook getAddressBook() { - return addressBook; + public ReadOnlyCliniCal getCliniCal() { + return cliniCal; } @Override public boolean hasPatient(Patient patient) { requireNonNull(patient); - return addressBook.hasPatient(patient); + return cliniCal.hasPatient(patient); } @Override public void deletePatient(Patient target) { - addressBook.removePatient(target); + cliniCal.removePatient(target); } @Override public void addPatient(Patient patient) { - addressBook.addPatient(patient); + cliniCal.addPatient(patient); updateFilteredPatientList(PREDICATE_SHOW_ALL_PATIENTS); } @@ -109,14 +109,14 @@ public void addPatient(Patient patient) { public void setPatient(Patient target, Patient editedPatient) { requireAllNonNull(target, editedPatient); - addressBook.setPatient(target, editedPatient); + cliniCal.setPatient(target, editedPatient); } //=========== Filtered Patient List Accessors ============================================================= /** * Returns an unmodifiable view of the list of {@code Patient} backed by the internal list of - * {@code versionedAddressBook} + * {@code versionedCliniCal} */ @Override public ObservableList getFilteredPatientList() { @@ -143,7 +143,7 @@ public boolean equals(Object obj) { // state check ModelManager other = (ModelManager) obj; - return addressBook.equals(other.addressBook) + return cliniCal.equals(other.cliniCal) && userPrefs.equals(other.userPrefs) && filteredPatients.equals(other.filteredPatients); } diff --git a/src/main/java/seedu/address/model/ReadOnlyAddressBook.java b/src/main/java/seedu/address/model/ReadOnlyCliniCal.java similarity index 89% rename from src/main/java/seedu/address/model/ReadOnlyAddressBook.java rename to src/main/java/seedu/address/model/ReadOnlyCliniCal.java index c151e987079..0f585df1205 100644 --- a/src/main/java/seedu/address/model/ReadOnlyAddressBook.java +++ b/src/main/java/seedu/address/model/ReadOnlyCliniCal.java @@ -6,7 +6,7 @@ /** * Unmodifiable view of an address book */ -public interface ReadOnlyAddressBook { +public interface ReadOnlyCliniCal { /** * Returns an unmodifiable view of the patients list. diff --git a/src/main/java/seedu/address/model/ReadOnlyUserPrefs.java b/src/main/java/seedu/address/model/ReadOnlyUserPrefs.java index befd58a4c73..9f5ba9955bf 100644 --- a/src/main/java/seedu/address/model/ReadOnlyUserPrefs.java +++ b/src/main/java/seedu/address/model/ReadOnlyUserPrefs.java @@ -11,6 +11,6 @@ public interface ReadOnlyUserPrefs { GuiSettings getGuiSettings(); - Path getAddressBookFilePath(); + Path getCliniCalFilePath(); } diff --git a/src/main/java/seedu/address/model/UserPrefs.java b/src/main/java/seedu/address/model/UserPrefs.java index 25a5fd6eab9..75d2286f291 100644 --- a/src/main/java/seedu/address/model/UserPrefs.java +++ b/src/main/java/seedu/address/model/UserPrefs.java @@ -14,7 +14,7 @@ public class UserPrefs implements ReadOnlyUserPrefs { private GuiSettings guiSettings = new GuiSettings(); - private Path addressBookFilePath = Paths.get("data" , "addressbook.json"); + private Path cliniCalFilePath = Paths.get("data" , "clinical.json"); /** * Creates a {@code UserPrefs} with default values. @@ -35,7 +35,7 @@ public UserPrefs(ReadOnlyUserPrefs userPrefs) { public void resetData(ReadOnlyUserPrefs newUserPrefs) { requireNonNull(newUserPrefs); setGuiSettings(newUserPrefs.getGuiSettings()); - setAddressBookFilePath(newUserPrefs.getAddressBookFilePath()); + setCliniCalFilePath(newUserPrefs.getCliniCalFilePath()); } public GuiSettings getGuiSettings() { @@ -47,13 +47,13 @@ public void setGuiSettings(GuiSettings guiSettings) { this.guiSettings = guiSettings; } - public Path getAddressBookFilePath() { - return addressBookFilePath; + public Path getCliniCalFilePath() { + return cliniCalFilePath; } - public void setAddressBookFilePath(Path addressBookFilePath) { - requireNonNull(addressBookFilePath); - this.addressBookFilePath = addressBookFilePath; + public void setCliniCalFilePath(Path cliniCalFilePath) { + requireNonNull(cliniCalFilePath); + this.cliniCalFilePath = cliniCalFilePath; } @Override @@ -68,19 +68,19 @@ public boolean equals(Object other) { UserPrefs o = (UserPrefs) other; return guiSettings.equals(o.guiSettings) - && addressBookFilePath.equals(o.addressBookFilePath); + && cliniCalFilePath.equals(o.cliniCalFilePath); } @Override public int hashCode() { - return Objects.hash(guiSettings, addressBookFilePath); + return Objects.hash(guiSettings, cliniCalFilePath); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("Gui Settings : " + guiSettings); - sb.append("\nLocal data file location : " + addressBookFilePath); + sb.append("\nLocal data file location : " + cliniCalFilePath); return sb.toString(); } diff --git a/src/main/java/seedu/address/model/util/SampleDataUtil.java b/src/main/java/seedu/address/model/util/SampleDataUtil.java index 521c5c24c2c..35f2174bd33 100644 --- a/src/main/java/seedu/address/model/util/SampleDataUtil.java +++ b/src/main/java/seedu/address/model/util/SampleDataUtil.java @@ -4,8 +4,8 @@ import java.util.Set; import java.util.stream.Collectors; -import seedu.address.model.AddressBook; -import seedu.address.model.ReadOnlyAddressBook; +import seedu.address.model.CliniCal; +import seedu.address.model.ReadOnlyCliniCal; import seedu.address.model.patient.Address; import seedu.address.model.patient.Email; import seedu.address.model.patient.Name; @@ -14,7 +14,7 @@ import seedu.address.model.tag.Tag; /** - * Contains utility methods for populating {@code AddressBook} with sample data. + * Contains utility methods for populating {@code CliniCal} with sample data. */ public class SampleDataUtil { public static Patient[] getSamplePatients() { @@ -40,8 +40,8 @@ public static Patient[] getSamplePatients() { }; } - public static ReadOnlyAddressBook getSampleAddressBook() { - AddressBook sampleAb = new AddressBook(); + public static ReadOnlyCliniCal getSampleCliniCal() { + CliniCal sampleAb = new CliniCal(); for (Patient samplePatient : getSamplePatients()) { sampleAb.addPatient(samplePatient); } diff --git a/src/main/java/seedu/address/storage/AddressBookStorage.java b/src/main/java/seedu/address/storage/AddressBookStorage.java deleted file mode 100644 index 4599182b3f9..00000000000 --- a/src/main/java/seedu/address/storage/AddressBookStorage.java +++ /dev/null @@ -1,45 +0,0 @@ -package seedu.address.storage; - -import java.io.IOException; -import java.nio.file.Path; -import java.util.Optional; - -import seedu.address.commons.exceptions.DataConversionException; -import seedu.address.model.ReadOnlyAddressBook; - -/** - * Represents a storage for {@link seedu.address.model.AddressBook}. - */ -public interface AddressBookStorage { - - /** - * Returns the file path of the data file. - */ - Path getAddressBookFilePath(); - - /** - * Returns AddressBook data as a {@link ReadOnlyAddressBook}. - * Returns {@code Optional.empty()} if storage file is not found. - * @throws DataConversionException if the data in storage is not in the expected format. - * @throws IOException if there was any problem when reading from the storage. - */ - Optional readAddressBook() throws DataConversionException, IOException; - - /** - * @see #getAddressBookFilePath() - */ - Optional readAddressBook(Path filePath) throws DataConversionException, IOException; - - /** - * Saves the given {@link ReadOnlyAddressBook} to the storage. - * @param addressBook cannot be null. - * @throws IOException if there was any problem writing to the file. - */ - void saveAddressBook(ReadOnlyAddressBook addressBook) throws IOException; - - /** - * @see #saveAddressBook(ReadOnlyAddressBook) - */ - void saveAddressBook(ReadOnlyAddressBook addressBook, Path filePath) throws IOException; - -} diff --git a/src/main/java/seedu/address/storage/CliniCalStorage.java b/src/main/java/seedu/address/storage/CliniCalStorage.java new file mode 100644 index 00000000000..9f64acc1416 --- /dev/null +++ b/src/main/java/seedu/address/storage/CliniCalStorage.java @@ -0,0 +1,46 @@ +package seedu.address.storage; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.Optional; + +import seedu.address.commons.exceptions.DataConversionException; +import seedu.address.model.CliniCal; +import seedu.address.model.ReadOnlyCliniCal; + +/** + * Represents a storage for {@link CliniCal}. + */ +public interface CliniCalStorage { + + /** + * Returns the file path of the data file. + */ + Path getCliniCalFilePath(); + + /** + * Returns CliniCal data as a {@link ReadOnlyCliniCal}. + * Returns {@code Optional.empty()} if storage file is not found. + * @throws DataConversionException if the data in storage is not in the expected format. + * @throws IOException if there was any problem when reading from the storage. + */ + Optional readCliniCal() throws DataConversionException, IOException; + + /** + * @see #getCliniCalFilePath() + */ + Optional readCliniCal(Path filePath) throws DataConversionException, IOException; + + /** + * Saves the given {@link ReadOnlyCliniCal} to the storage. + * @param cliniCal cannot be null. + * @throws IOException if there was any problem writing to the file. + */ + void saveCliniCal(ReadOnlyCliniCal cliniCal) throws IOException; + + /** + * @see #saveCliniCal(ReadOnlyCliniCal) + */ + void saveCliniCal(ReadOnlyCliniCal cliniCal, Path filePath) throws IOException; + +} diff --git a/src/main/java/seedu/address/storage/JsonAddressBookStorage.java b/src/main/java/seedu/address/storage/JsonCliniCalStorage.java similarity index 50% rename from src/main/java/seedu/address/storage/JsonAddressBookStorage.java rename to src/main/java/seedu/address/storage/JsonCliniCalStorage.java index dfab9daaa0d..8052f98da63 100644 --- a/src/main/java/seedu/address/storage/JsonAddressBookStorage.java +++ b/src/main/java/seedu/address/storage/JsonCliniCalStorage.java @@ -12,47 +12,47 @@ import seedu.address.commons.exceptions.IllegalValueException; import seedu.address.commons.util.FileUtil; import seedu.address.commons.util.JsonUtil; -import seedu.address.model.ReadOnlyAddressBook; +import seedu.address.model.ReadOnlyCliniCal; /** - * A class to access AddressBook data stored as a json file on the hard disk. + * A class to access CliniCal data stored as a json file on the hard disk. */ -public class JsonAddressBookStorage implements AddressBookStorage { +public class JsonCliniCalStorage implements CliniCalStorage { - private static final Logger logger = LogsCenter.getLogger(JsonAddressBookStorage.class); + private static final Logger logger = LogsCenter.getLogger(JsonCliniCalStorage.class); private Path filePath; - public JsonAddressBookStorage(Path filePath) { + public JsonCliniCalStorage(Path filePath) { this.filePath = filePath; } - public Path getAddressBookFilePath() { + public Path getCliniCalFilePath() { return filePath; } @Override - public Optional readAddressBook() throws DataConversionException { - return readAddressBook(filePath); + public Optional readCliniCal() throws DataConversionException { + return readCliniCal(filePath); } /** - * Similar to {@link #readAddressBook()}. + * Similar to {@link #readCliniCal()}. * * @param filePath location of the data. Cannot be null. * @throws DataConversionException if the file is not in the correct format. */ - public Optional readAddressBook(Path filePath) throws DataConversionException { + public Optional readCliniCal(Path filePath) throws DataConversionException { requireNonNull(filePath); - Optional jsonAddressBook = JsonUtil.readJsonFile( - filePath, JsonSerializableAddressBook.class); - if (!jsonAddressBook.isPresent()) { + Optional jsonCliniCal = JsonUtil.readJsonFile( + filePath, JsonSerializableCliniCal.class); + if (!jsonCliniCal.isPresent()) { return Optional.empty(); } try { - return Optional.of(jsonAddressBook.get().toModelType()); + return Optional.of(jsonCliniCal.get().toModelType()); } catch (IllegalValueException ive) { logger.info("Illegal values found in " + filePath + ": " + ive.getMessage()); throw new DataConversionException(ive); @@ -60,21 +60,21 @@ public Optional readAddressBook(Path filePath) throws DataC } @Override - public void saveAddressBook(ReadOnlyAddressBook addressBook) throws IOException { - saveAddressBook(addressBook, filePath); + public void saveCliniCal(ReadOnlyCliniCal cliniCal) throws IOException { + saveCliniCal(cliniCal, filePath); } /** - * Similar to {@link #saveAddressBook(ReadOnlyAddressBook)}. + * Similar to {@link #saveCliniCal(ReadOnlyCliniCal)}. * * @param filePath location of the data. Cannot be null. */ - public void saveAddressBook(ReadOnlyAddressBook addressBook, Path filePath) throws IOException { - requireNonNull(addressBook); + public void saveCliniCal(ReadOnlyCliniCal cliniCal, Path filePath) throws IOException { + requireNonNull(cliniCal); requireNonNull(filePath); FileUtil.createIfMissing(filePath); - JsonUtil.saveJsonFile(new JsonSerializableAddressBook(addressBook), filePath); + JsonUtil.saveJsonFile(new JsonSerializableCliniCal(cliniCal), filePath); } } diff --git a/src/main/java/seedu/address/storage/JsonSerializableAddressBook.java b/src/main/java/seedu/address/storage/JsonSerializableCliniCal.java similarity index 56% rename from src/main/java/seedu/address/storage/JsonSerializableAddressBook.java rename to src/main/java/seedu/address/storage/JsonSerializableCliniCal.java index c3323e76334..428b1332b99 100644 --- a/src/main/java/seedu/address/storage/JsonSerializableAddressBook.java +++ b/src/main/java/seedu/address/storage/JsonSerializableCliniCal.java @@ -9,52 +9,52 @@ import com.fasterxml.jackson.annotation.JsonRootName; import seedu.address.commons.exceptions.IllegalValueException; -import seedu.address.model.AddressBook; -import seedu.address.model.ReadOnlyAddressBook; +import seedu.address.model.CliniCal; +import seedu.address.model.ReadOnlyCliniCal; import seedu.address.model.patient.Patient; /** - * An Immutable AddressBook that is serializable to JSON format. + * An Immutable CliniCal that is serializable to JSON format. */ -@JsonRootName(value = "addressbook") -class JsonSerializableAddressBook { +@JsonRootName(value = "clinical") +class JsonSerializableCliniCal { public static final String MESSAGE_DUPLICATE_PATIENT = "Patients list contains duplicate patient(s)."; private final List patients = new ArrayList<>(); /** - * Constructs a {@code JsonSerializableAddressBook} with the given patients. + * Constructs a {@code JsonSerializableCliniCal} with the given patients. */ @JsonCreator - public JsonSerializableAddressBook(@JsonProperty("patients") List patients) { + public JsonSerializableCliniCal(@JsonProperty("patients") List patients) { this.patients.addAll(patients); } /** - * Converts a given {@code ReadOnlyAddressBook} into this class for Jackson use. + * Converts a given {@code ReadOnlyCliniCal} into this class for Jackson use. * - * @param source future changes to this will not affect the created {@code JsonSerializableAddressBook}. + * @param source future changes to this will not affect the created {@code JsonSerializableCliniCal}. */ - public JsonSerializableAddressBook(ReadOnlyAddressBook source) { + public JsonSerializableCliniCal(ReadOnlyCliniCal source) { patients.addAll(source.getPatientList().stream().map(JsonAdaptedPatient::new).collect(Collectors.toList())); } /** - * Converts this address book into the model's {@code AddressBook} object. + * Converts this address book into the model's {@code CliniCal} object. * * @throws IllegalValueException if there were any data constraints violated. */ - public AddressBook toModelType() throws IllegalValueException { - AddressBook addressBook = new AddressBook(); + public CliniCal toModelType() throws IllegalValueException { + CliniCal cliniCal = new CliniCal(); for (JsonAdaptedPatient jsonAdaptedPatient : patients) { Patient patient = jsonAdaptedPatient.toModelType(); - if (addressBook.hasPatient(patient)) { + if (cliniCal.hasPatient(patient)) { throw new IllegalValueException(MESSAGE_DUPLICATE_PATIENT); } - addressBook.addPatient(patient); + cliniCal.addPatient(patient); } - return addressBook; + return cliniCal; } } diff --git a/src/main/java/seedu/address/storage/Storage.java b/src/main/java/seedu/address/storage/Storage.java index beda8bd9f11..d319401bdf0 100644 --- a/src/main/java/seedu/address/storage/Storage.java +++ b/src/main/java/seedu/address/storage/Storage.java @@ -5,14 +5,14 @@ import java.util.Optional; import seedu.address.commons.exceptions.DataConversionException; -import seedu.address.model.ReadOnlyAddressBook; +import seedu.address.model.ReadOnlyCliniCal; import seedu.address.model.ReadOnlyUserPrefs; import seedu.address.model.UserPrefs; /** * API of the Storage component */ -public interface Storage extends AddressBookStorage, UserPrefsStorage { +public interface Storage extends CliniCalStorage, UserPrefsStorage { @Override Optional readUserPrefs() throws DataConversionException, IOException; @@ -21,12 +21,12 @@ public interface Storage extends AddressBookStorage, UserPrefsStorage { void saveUserPrefs(ReadOnlyUserPrefs userPrefs) throws IOException; @Override - Path getAddressBookFilePath(); + Path getCliniCalFilePath(); @Override - Optional readAddressBook() throws DataConversionException, IOException; + Optional readCliniCal() throws DataConversionException, IOException; @Override - void saveAddressBook(ReadOnlyAddressBook addressBook) throws IOException; + void saveCliniCal(ReadOnlyCliniCal cliniCal) throws IOException; } diff --git a/src/main/java/seedu/address/storage/StorageManager.java b/src/main/java/seedu/address/storage/StorageManager.java index 79868290974..082c521e90c 100644 --- a/src/main/java/seedu/address/storage/StorageManager.java +++ b/src/main/java/seedu/address/storage/StorageManager.java @@ -7,25 +7,25 @@ import seedu.address.commons.core.LogsCenter; import seedu.address.commons.exceptions.DataConversionException; -import seedu.address.model.ReadOnlyAddressBook; +import seedu.address.model.ReadOnlyCliniCal; import seedu.address.model.ReadOnlyUserPrefs; import seedu.address.model.UserPrefs; /** - * Manages storage of AddressBook data in local storage. + * Manages storage of CliniCal data in local storage. */ public class StorageManager implements Storage { private static final Logger logger = LogsCenter.getLogger(StorageManager.class); - private AddressBookStorage addressBookStorage; + private CliniCalStorage cliniCalStorage; private UserPrefsStorage userPrefsStorage; /** - * Creates a {@code StorageManager} with the given {@code AddressBookStorage} and {@code UserPrefStorage}. + * Creates a {@code StorageManager} with the given {@code CliniCalStorage} and {@code UserPrefStorage}. */ - public StorageManager(AddressBookStorage addressBookStorage, UserPrefsStorage userPrefsStorage) { + public StorageManager(CliniCalStorage cliniCalStorage, UserPrefsStorage userPrefsStorage) { super(); - this.addressBookStorage = addressBookStorage; + this.cliniCalStorage = cliniCalStorage; this.userPrefsStorage = userPrefsStorage; } @@ -47,33 +47,33 @@ public void saveUserPrefs(ReadOnlyUserPrefs userPrefs) throws IOException { } - // ================ AddressBook methods ============================== + // ================ CliniCal methods ============================== @Override - public Path getAddressBookFilePath() { - return addressBookStorage.getAddressBookFilePath(); + public Path getCliniCalFilePath() { + return cliniCalStorage.getCliniCalFilePath(); } @Override - public Optional readAddressBook() throws DataConversionException, IOException { - return readAddressBook(addressBookStorage.getAddressBookFilePath()); + public Optional readCliniCal() throws DataConversionException, IOException { + return readCliniCal(cliniCalStorage.getCliniCalFilePath()); } @Override - public Optional readAddressBook(Path filePath) throws DataConversionException, IOException { + public Optional readCliniCal(Path filePath) throws DataConversionException, IOException { logger.fine("Attempting to read data from file: " + filePath); - return addressBookStorage.readAddressBook(filePath); + return cliniCalStorage.readCliniCal(filePath); } @Override - public void saveAddressBook(ReadOnlyAddressBook addressBook) throws IOException { - saveAddressBook(addressBook, addressBookStorage.getAddressBookFilePath()); + public void saveCliniCal(ReadOnlyCliniCal cliniCal) throws IOException { + saveCliniCal(cliniCal, cliniCalStorage.getCliniCalFilePath()); } @Override - public void saveAddressBook(ReadOnlyAddressBook addressBook, Path filePath) throws IOException { + public void saveCliniCal(ReadOnlyCliniCal cliniCal, Path filePath) throws IOException { logger.fine("Attempting to write to data file: " + filePath); - addressBookStorage.saveAddressBook(addressBook, filePath); + cliniCalStorage.saveCliniCal(cliniCal, filePath); } } diff --git a/src/main/java/seedu/address/ui/MainWindow.java b/src/main/java/seedu/address/ui/MainWindow.java index fa2e69dbfd2..39429bab285 100644 --- a/src/main/java/seedu/address/ui/MainWindow.java +++ b/src/main/java/seedu/address/ui/MainWindow.java @@ -116,7 +116,7 @@ void fillInnerParts() { resultDisplay = new ResultDisplay(); resultDisplayPlaceholder.getChildren().add(resultDisplay.getRoot()); - StatusBarFooter statusBarFooter = new StatusBarFooter(logic.getAddressBookFilePath()); + StatusBarFooter statusBarFooter = new StatusBarFooter(logic.getCliniCalFilePath()); statusbarPlaceholder.getChildren().add(statusBarFooter.getRoot()); CommandBox commandBox = new CommandBox(this::executeCommand); diff --git a/src/main/java/seedu/address/ui/UiManager.java b/src/main/java/seedu/address/ui/UiManager.java index 882027e4537..280114361c2 100644 --- a/src/main/java/seedu/address/ui/UiManager.java +++ b/src/main/java/seedu/address/ui/UiManager.java @@ -20,7 +20,7 @@ public class UiManager implements Ui { public static final String ALERT_DIALOG_PANE_FIELD_ID = "alertDialogPane"; private static final Logger logger = LogsCenter.getLogger(UiManager.class); - private static final String ICON_APPLICATION = "/images/address_book_32.png"; + private static final String ICON_APPLICATION = "/images/stethoscope.png"; private Logic logic; private MainWindow mainWindow; diff --git a/src/main/resources/images/stethoscope.png b/src/main/resources/images/stethoscope.png new file mode 100644 index 0000000000000000000000000000000000000000..23b613d630bb767b01b4c58b7f89dab36c7851e5 GIT binary patch literal 24919 zcmX_o1z1$g8}C_iMUa+m1*MUeUP4q-x=Ttxx&;>LMv!hqx&#Sn0qL%#Q;_biy=TAw zy?397+C4M#*1R>pAxuT-6&?;H4gdgnujOUl0RS5KD;faB0)L!(Ok9IMFq~np)uG_) z6ZCy3`1b<`c^zi}7`;M$LDD_d+`%^~Tx7Lf)a)%>+)bR!0e5$IPV0|0&SoYK=A8CU zmTCKwZ({3948Rs*c&krDR@}KSzg0?iEt$Id z*IP9WB?et-N`N8Isx6tvOtf2RE++2x5~kUE5zd;p&`dq8hGPT3t@8N6sNom@W$1iL zr1qi(HsEJsta4cXW>R3Yd#7KM9e#ETz*tbD3Aq@a+TkWIGG)iNS7GC| z2lkDvy5iX29C4urGU~o_(oMzlqLWMyJ`S;+qpfZ+owUHKkqwN;l7tfe2rh`G=&9Af z$quO{2s8*@QYbEEf0@S-5Go&xl37kiEQ56JOzno$zd<^HTx%|~O)r+~J&fnSm7nLU zT`U3Q89(~^3IZdgfDpiB z(&18m&>v|MfXk2E(yXmV42&U>C{o|NdpA2-8&ZpYxH&WiR~s#Cttu_u4cw=1zk81X z606ESo*X{XbcHV2?G^1S;|?XH$V1IX!g%AmK#?lLjt5tP(L%tPx+)33VW;FD{n)1- zgkt2@Uv$OAeQOASy2ld&AaUGcE;0MK9LqdATLKFVfj6(w=>tQlYk8F10~5J%l}0k8 z>a##g2n~(>`jrH8b@y52^8O7eiJ9*W>@c%bC|B-ED-+R@lb^oo?Co? z{(Co31oSB$oPd$Ba?pKiXapy5A85ZrQCe^40x^r7J^+V`qQUfqzapu*<6y%kZAP6S}SX*?ifM4 z5t_O`R=5LS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/src/test/data/JsonSerializableAddressBookTest/typicalPatientsAddressBook.json b/src/test/data/JsonSerializableAddressBookTest/typicalPatientsAddressBook.json index bce10d54a0b..182a55e21d1 100644 --- a/src/test/data/JsonSerializableAddressBookTest/typicalPatientsAddressBook.json +++ b/src/test/data/JsonSerializableAddressBookTest/typicalPatientsAddressBook.json @@ -1,5 +1,5 @@ { - "_comment": "AddressBook save file which contains the same Patient values as in TypicalPatients#getTypicalAddressBook()", + "_comment": "CliniCal save file which contains the same Patient values as in TypicalPatients#getTypicalCliniCal()", "patients" : [ { "name" : "Alice Pauline", "phone" : "94351253", diff --git a/src/test/data/JsonUserPrefsStorageTest/ExtraValuesUserPref.json b/src/test/data/JsonUserPrefsStorageTest/ExtraValuesUserPref.json index 1037548a9cd..3a34ed54e3b 100644 --- a/src/test/data/JsonUserPrefsStorageTest/ExtraValuesUserPref.json +++ b/src/test/data/JsonUserPrefsStorageTest/ExtraValuesUserPref.json @@ -9,5 +9,5 @@ "z" : 99 } }, - "addressBookFilePath" : "addressbook.json" + "cliniCalFilePath" : "clinical.json" } diff --git a/src/test/data/JsonUserPrefsStorageTest/TypicalUserPref.json b/src/test/data/JsonUserPrefsStorageTest/TypicalUserPref.json index b819bed900a..d14f90f98c3 100644 --- a/src/test/data/JsonUserPrefsStorageTest/TypicalUserPref.json +++ b/src/test/data/JsonUserPrefsStorageTest/TypicalUserPref.json @@ -7,5 +7,5 @@ "y" : 100 } }, - "addressBookFilePath" : "addressbook.json" + "cliniCalFilePath" : "clinical.json" } diff --git a/src/test/java/seedu/address/commons/util/AppUtilTest.java b/src/test/java/seedu/address/commons/util/AppUtilTest.java index 594de1e6365..70ce5529558 100644 --- a/src/test/java/seedu/address/commons/util/AppUtilTest.java +++ b/src/test/java/seedu/address/commons/util/AppUtilTest.java @@ -9,7 +9,7 @@ public class AppUtilTest { @Test public void getImage_exitingImage() { - assertNotNull(AppUtil.getImage("/images/address_book_32.png")); + assertNotNull(AppUtil.getImage("/images/stethoscope.png")); } @Test diff --git a/src/test/java/seedu/address/logic/LogicManagerTest.java b/src/test/java/seedu/address/logic/LogicManagerTest.java index bb7e50bcedf..919bc3396f9 100644 --- a/src/test/java/seedu/address/logic/LogicManagerTest.java +++ b/src/test/java/seedu/address/logic/LogicManagerTest.java @@ -24,10 +24,10 @@ import seedu.address.logic.parser.exceptions.ParseException; import seedu.address.model.Model; import seedu.address.model.ModelManager; -import seedu.address.model.ReadOnlyAddressBook; +import seedu.address.model.ReadOnlyCliniCal; import seedu.address.model.UserPrefs; import seedu.address.model.patient.Patient; -import seedu.address.storage.JsonAddressBookStorage; +import seedu.address.storage.JsonCliniCalStorage; import seedu.address.storage.JsonUserPrefsStorage; import seedu.address.storage.StorageManager; import seedu.address.testutil.PatientBuilder; @@ -43,10 +43,10 @@ public class LogicManagerTest { @BeforeEach public void setUp() { - JsonAddressBookStorage addressBookStorage = - new JsonAddressBookStorage(temporaryFolder.resolve("addressBook.json")); + JsonCliniCalStorage cliniCalStorage = + new JsonCliniCalStorage(temporaryFolder.resolve("cliniCal.json")); JsonUserPrefsStorage userPrefsStorage = new JsonUserPrefsStorage(temporaryFolder.resolve("userPrefs.json")); - StorageManager storage = new StorageManager(addressBookStorage, userPrefsStorage); + StorageManager storage = new StorageManager(cliniCalStorage, userPrefsStorage); logic = new LogicManager(model, storage); } @@ -70,12 +70,12 @@ public void execute_validCommand_success() throws Exception { @Test public void execute_storageThrowsIoException_throwsCommandException() { - // Setup LogicManager with JsonAddressBookIoExceptionThrowingStub - JsonAddressBookStorage addressBookStorage = - new JsonAddressBookIoExceptionThrowingStub(temporaryFolder.resolve("ioExceptionAddressBook.json")); + // Setup LogicManager with JsonCliniCalIoExceptionThrowingStub + JsonCliniCalStorage cliniCalStorage = + new JsonCliniCalIoExceptionThrowingStub(temporaryFolder.resolve("ioExceptionCliniCal.json")); JsonUserPrefsStorage userPrefsStorage = new JsonUserPrefsStorage(temporaryFolder.resolve("ioExceptionUserPrefs.json")); - StorageManager storage = new StorageManager(addressBookStorage, userPrefsStorage); + StorageManager storage = new StorageManager(cliniCalStorage, userPrefsStorage); logic = new LogicManager(model, storage); // Execute add command @@ -129,7 +129,7 @@ private void assertCommandException(String inputCommand, String expectedMessage) */ private void assertCommandFailure(String inputCommand, Class expectedException, String expectedMessage) { - Model expectedModel = new ModelManager(model.getAddressBook(), new UserPrefs()); + Model expectedModel = new ModelManager(model.getCliniCal(), new UserPrefs()); assertCommandFailure(inputCommand, expectedException, expectedMessage, expectedModel); } @@ -149,13 +149,13 @@ private void assertCommandFailure(String inputCommand, Class * - a {@code CommandException} is thrown
* - the CommandException message matches {@code expectedMessage}
- * - the address book, filtered patient list and selected patient in {@code actualModel} remain unchanged + * - the clinical, filtered patient list and selected patient in {@code actualModel} remain unchanged */ public static void assertCommandFailure(Command command, Model actualModel, String expectedMessage) { // we are unable to defensively copy the model for comparison later, so we can // only do so by copying its components. - AddressBook expectedAddressBook = new AddressBook(actualModel.getAddressBook()); + CliniCal expectedCliniCal = new CliniCal(actualModel.getCliniCal()); List expectedFilteredList = new ArrayList<>(actualModel.getFilteredPatientList()); assertThrows(CommandException.class, expectedMessage, () -> command.execute(actualModel)); - assertEquals(expectedAddressBook, actualModel.getAddressBook()); + assertEquals(expectedCliniCal, actualModel.getCliniCal()); assertEquals(expectedFilteredList, actualModel.getFilteredPatientList()); } /** * Updates {@code model}'s filtered list to show only the patient at the given {@code targetIndex} in the - * {@code model}'s address book. + * {@code model}'s clinical. */ public static void showPatientAtIndex(Model model, Index targetIndex) { assertTrue(targetIndex.getZeroBased() < model.getFilteredPatientList().size()); diff --git a/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java b/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java index 24c33040dc6..8224ae70896 100644 --- a/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java @@ -7,7 +7,7 @@ import static seedu.address.logic.commands.CommandTestUtil.showPatientAtIndex; import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_PATIENT; import static seedu.address.testutil.TypicalIndexes.INDEX_SECOND_PATIENT; -import static seedu.address.testutil.TypicalPatients.getTypicalAddressBook; +import static seedu.address.testutil.TypicalPatients.getTypicalCliniCal; import org.junit.jupiter.api.Test; @@ -24,7 +24,7 @@ */ public class DeleteCommandTest { - private Model model = new ModelManager(getTypicalAddressBook(), new UserPrefs()); + private Model model = new ModelManager(getTypicalCliniCal(), new UserPrefs()); @Test public void execute_validIndexUnfilteredList_success() { @@ -33,7 +33,7 @@ public void execute_validIndexUnfilteredList_success() { String expectedMessage = String.format(DeleteCommand.MESSAGE_DELETE_PATIENT_SUCCESS, patientToDelete); - ModelManager expectedModel = new ModelManager(model.getAddressBook(), new UserPrefs()); + ModelManager expectedModel = new ModelManager(model.getCliniCal(), new UserPrefs()); expectedModel.deletePatient(patientToDelete); assertCommandSuccess(deleteCommand, model, expectedMessage, expectedModel); @@ -56,7 +56,7 @@ public void execute_validIndexFilteredList_success() { String expectedMessage = String.format(DeleteCommand.MESSAGE_DELETE_PATIENT_SUCCESS, patientToDelete); - Model expectedModel = new ModelManager(model.getAddressBook(), new UserPrefs()); + Model expectedModel = new ModelManager(model.getCliniCal(), new UserPrefs()); expectedModel.deletePatient(patientToDelete); showNoPatient(expectedModel); @@ -68,8 +68,8 @@ public void execute_invalidIndexFilteredList_throwsCommandException() { showPatientAtIndex(model, INDEX_FIRST_PATIENT); Index outOfBoundIndex = INDEX_SECOND_PATIENT; - // ensures that outOfBoundIndex is still in bounds of address book list - assertTrue(outOfBoundIndex.getZeroBased() < model.getAddressBook().getPatientList().size()); + // ensures that outOfBoundIndex is still in bounds of clinical list + assertTrue(outOfBoundIndex.getZeroBased() < model.getCliniCal().getPatientList().size()); DeleteCommand deleteCommand = new DeleteCommand(outOfBoundIndex); diff --git a/src/test/java/seedu/address/logic/commands/EditCommandTest.java b/src/test/java/seedu/address/logic/commands/EditCommandTest.java index c99ae0e8557..81a8e1aaebc 100644 --- a/src/test/java/seedu/address/logic/commands/EditCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/EditCommandTest.java @@ -12,14 +12,14 @@ import static seedu.address.logic.commands.CommandTestUtil.showPatientAtIndex; import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_PATIENT; import static seedu.address.testutil.TypicalIndexes.INDEX_SECOND_PATIENT; -import static seedu.address.testutil.TypicalPatients.getTypicalAddressBook; +import static seedu.address.testutil.TypicalPatients.getTypicalCliniCal; import org.junit.jupiter.api.Test; import seedu.address.commons.core.Messages; import seedu.address.commons.core.index.Index; import seedu.address.logic.commands.EditCommand.EditPatientDescriptor; -import seedu.address.model.AddressBook; +import seedu.address.model.CliniCal; import seedu.address.model.Model; import seedu.address.model.ModelManager; import seedu.address.model.UserPrefs; @@ -32,7 +32,7 @@ */ public class EditCommandTest { - private Model model = new ModelManager(getTypicalAddressBook(), new UserPrefs()); + private Model model = new ModelManager(getTypicalCliniCal(), new UserPrefs()); @Test public void execute_allFieldsSpecifiedUnfilteredList_success() { @@ -42,7 +42,7 @@ public void execute_allFieldsSpecifiedUnfilteredList_success() { String expectedMessage = String.format(EditCommand.MESSAGE_EDIT_PATIENT_SUCCESS, editedPatient); - Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()), new UserPrefs()); + Model expectedModel = new ModelManager(new CliniCal(model.getCliniCal()), new UserPrefs()); expectedModel.setPatient(model.getFilteredPatientList().get(0), editedPatient); assertCommandSuccess(editCommand, model, expectedMessage, expectedModel); @@ -63,7 +63,7 @@ public void execute_someFieldsSpecifiedUnfilteredList_success() { String expectedMessage = String.format(EditCommand.MESSAGE_EDIT_PATIENT_SUCCESS, editedPatient); - Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()), new UserPrefs()); + Model expectedModel = new ModelManager(new CliniCal(model.getCliniCal()), new UserPrefs()); expectedModel.setPatient(lastPatient, editedPatient); assertCommandSuccess(editCommand, model, expectedMessage, expectedModel); @@ -76,7 +76,7 @@ public void execute_noFieldSpecifiedUnfilteredList_success() { String expectedMessage = String.format(EditCommand.MESSAGE_EDIT_PATIENT_SUCCESS, editedPatient); - Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()), new UserPrefs()); + Model expectedModel = new ModelManager(new CliniCal(model.getCliniCal()), new UserPrefs()); assertCommandSuccess(editCommand, model, expectedMessage, expectedModel); } @@ -92,7 +92,7 @@ public void execute_filteredList_success() { String expectedMessage = String.format(EditCommand.MESSAGE_EDIT_PATIENT_SUCCESS, editedPatient); - Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()), new UserPrefs()); + Model expectedModel = new ModelManager(new CliniCal(model.getCliniCal()), new UserPrefs()); expectedModel.setPatient(model.getFilteredPatientList().get(0), editedPatient); assertCommandSuccess(editCommand, model, expectedMessage, expectedModel); @@ -111,8 +111,8 @@ public void execute_duplicatePatientUnfilteredList_failure() { public void execute_duplicatePatientFilteredList_failure() { showPatientAtIndex(model, INDEX_FIRST_PATIENT); - // edit patient in filtered list into a duplicate in address book - Patient patientInList = model.getAddressBook().getPatientList().get(INDEX_SECOND_PATIENT.getZeroBased()); + // edit patient in filtered list into a duplicate in clinical + Patient patientInList = model.getCliniCal().getPatientList().get(INDEX_SECOND_PATIENT.getZeroBased()); EditCommand editCommand = new EditCommand(INDEX_FIRST_PATIENT, new EditPatientDescriptorBuilder(patientInList).build()); @@ -131,14 +131,14 @@ public void execute_invalidPatientIndexUnfilteredList_failure() { /** * Edit filtered list where index is larger than size of filtered list, - * but smaller than size of address book + * but smaller than size of clinical */ @Test public void execute_invalidPatientIndexFilteredList_failure() { showPatientAtIndex(model, INDEX_FIRST_PATIENT); Index outOfBoundIndex = INDEX_SECOND_PATIENT; - // ensures that outOfBoundIndex is still in bounds of address book list - assertTrue(outOfBoundIndex.getZeroBased() < model.getAddressBook().getPatientList().size()); + // ensures that outOfBoundIndex is still in bounds of clinical list + assertTrue(outOfBoundIndex.getZeroBased() < model.getCliniCal().getPatientList().size()); EditCommand editCommand = new EditCommand(outOfBoundIndex, new EditPatientDescriptorBuilder().withName(VALID_NAME_BOB).build()); diff --git a/src/test/java/seedu/address/logic/commands/FindCommandTest.java b/src/test/java/seedu/address/logic/commands/FindCommandTest.java index 8d1874a2a33..72cee209c11 100644 --- a/src/test/java/seedu/address/logic/commands/FindCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/FindCommandTest.java @@ -8,7 +8,7 @@ import static seedu.address.testutil.TypicalPatients.CARL; import static seedu.address.testutil.TypicalPatients.ELLE; import static seedu.address.testutil.TypicalPatients.FIONA; -import static seedu.address.testutil.TypicalPatients.getTypicalAddressBook; +import static seedu.address.testutil.TypicalPatients.getTypicalCliniCal; import java.util.Arrays; import java.util.Collections; @@ -24,8 +24,8 @@ * Contains integration tests (interaction with the Model) for {@code FindCommand}. */ public class FindCommandTest { - private Model model = new ModelManager(getTypicalAddressBook(), new UserPrefs()); - private Model expectedModel = new ModelManager(getTypicalAddressBook(), new UserPrefs()); + private Model model = new ModelManager(getTypicalCliniCal(), new UserPrefs()); + private Model expectedModel = new ModelManager(getTypicalCliniCal(), new UserPrefs()); @Test public void equals() { diff --git a/src/test/java/seedu/address/logic/commands/ListCommandTest.java b/src/test/java/seedu/address/logic/commands/ListCommandTest.java index 1a05bc24247..da172871069 100644 --- a/src/test/java/seedu/address/logic/commands/ListCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/ListCommandTest.java @@ -3,7 +3,7 @@ import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess; import static seedu.address.logic.commands.CommandTestUtil.showPatientAtIndex; import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_PATIENT; -import static seedu.address.testutil.TypicalPatients.getTypicalAddressBook; +import static seedu.address.testutil.TypicalPatients.getTypicalCliniCal; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -22,8 +22,8 @@ public class ListCommandTest { @BeforeEach public void setUp() { - model = new ModelManager(getTypicalAddressBook(), new UserPrefs()); - expectedModel = new ModelManager(model.getAddressBook(), new UserPrefs()); + model = new ModelManager(getTypicalCliniCal(), new UserPrefs()); + expectedModel = new ModelManager(model.getCliniCal(), new UserPrefs()); } @Test diff --git a/src/test/java/seedu/address/logic/parser/AddressBookParserTest.java b/src/test/java/seedu/address/logic/parser/CliniCalParserTest.java similarity index 97% rename from src/test/java/seedu/address/logic/parser/AddressBookParserTest.java rename to src/test/java/seedu/address/logic/parser/CliniCalParserTest.java index 88505cb0368..764361ebc49 100644 --- a/src/test/java/seedu/address/logic/parser/AddressBookParserTest.java +++ b/src/test/java/seedu/address/logic/parser/CliniCalParserTest.java @@ -28,9 +28,9 @@ import seedu.address.testutil.PatientBuilder; import seedu.address.testutil.PatientUtil; -public class AddressBookParserTest { +public class CliniCalParserTest { - private final AddressBookParser parser = new AddressBookParser(); + private final CliniCalParser parser = new CliniCalParser(); @Test public void parseCommand_add() throws Exception { diff --git a/src/test/java/seedu/address/model/AddressBookTest.java b/src/test/java/seedu/address/model/CliniCalTest.java similarity index 58% rename from src/test/java/seedu/address/model/AddressBookTest.java rename to src/test/java/seedu/address/model/CliniCalTest.java index 083553ff73a..f0e782e36ac 100644 --- a/src/test/java/seedu/address/model/AddressBookTest.java +++ b/src/test/java/seedu/address/model/CliniCalTest.java @@ -7,7 +7,7 @@ import static seedu.address.logic.commands.CommandTestUtil.VALID_TAG_HUSBAND; import static seedu.address.testutil.Assert.assertThrows; import static seedu.address.testutil.TypicalPatients.ALICE; -import static seedu.address.testutil.TypicalPatients.getTypicalAddressBook; +import static seedu.address.testutil.TypicalPatients.getTypicalCliniCal; import java.util.Arrays; import java.util.Collection; @@ -22,25 +22,25 @@ import seedu.address.model.patient.exceptions.DuplicatePatientException; import seedu.address.testutil.PatientBuilder; -public class AddressBookTest { +public class CliniCalTest { - private final AddressBook addressBook = new AddressBook(); + private final CliniCal cliniCal = new CliniCal(); @Test public void constructor() { - assertEquals(Collections.emptyList(), addressBook.getPatientList()); + assertEquals(Collections.emptyList(), cliniCal.getPatientList()); } @Test public void resetData_null_throwsNullPointerException() { - assertThrows(NullPointerException.class, () -> addressBook.resetData(null)); + assertThrows(NullPointerException.class, () -> cliniCal.resetData(null)); } @Test - public void resetData_withValidReadOnlyAddressBook_replacesData() { - AddressBook newData = getTypicalAddressBook(); - addressBook.resetData(newData); - assertEquals(newData, addressBook); + public void resetData_withValidReadOnlyCliniCal_replacesData() { + CliniCal newData = getTypicalCliniCal(); + cliniCal.resetData(newData); + assertEquals(newData, cliniCal); } @Test @@ -49,47 +49,47 @@ public void resetData_withDuplicatePatients_throwsDuplicatePatientException() { Patient editedAlice = new PatientBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_HUSBAND) .build(); List newPatients = Arrays.asList(ALICE, editedAlice); - AddressBookStub newData = new AddressBookStub(newPatients); + CliniCalStub newData = new CliniCalStub(newPatients); - assertThrows(DuplicatePatientException.class, () -> addressBook.resetData(newData)); + assertThrows(DuplicatePatientException.class, () -> cliniCal.resetData(newData)); } @Test public void hasPatient_nullPatient_throwsNullPointerException() { - assertThrows(NullPointerException.class, () -> addressBook.hasPatient(null)); + assertThrows(NullPointerException.class, () -> cliniCal.hasPatient(null)); } @Test - public void hasPatient_patientNotInAddressBook_returnsFalse() { - assertFalse(addressBook.hasPatient(ALICE)); + public void hasPatient_patientNotInCliniCal_returnsFalse() { + assertFalse(cliniCal.hasPatient(ALICE)); } @Test - public void hasPatient_patientInAddressBook_returnsTrue() { - addressBook.addPatient(ALICE); - assertTrue(addressBook.hasPatient(ALICE)); + public void hasPatient_patientInCliniCal_returnsTrue() { + cliniCal.addPatient(ALICE); + assertTrue(cliniCal.hasPatient(ALICE)); } @Test - public void hasPatient_patientWithSameIdentityFieldsInAddressBook_returnsTrue() { - addressBook.addPatient(ALICE); + public void hasPatient_patientWithSameIdentityFieldsInCliniCal_returnsTrue() { + cliniCal.addPatient(ALICE); Patient editedAlice = new PatientBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_HUSBAND) .build(); - assertTrue(addressBook.hasPatient(editedAlice)); + assertTrue(cliniCal.hasPatient(editedAlice)); } @Test public void getPatientList_modifyList_throwsUnsupportedOperationException() { - assertThrows(UnsupportedOperationException.class, () -> addressBook.getPatientList().remove(0)); + assertThrows(UnsupportedOperationException.class, () -> cliniCal.getPatientList().remove(0)); } /** - * A stub ReadOnlyAddressBook whose patients list can violate interface constraints. + * A stub ReadOnlyCliniCal whose patients list can violate interface constraints. */ - private static class AddressBookStub implements ReadOnlyAddressBook { + private static class CliniCalStub implements ReadOnlyCliniCal { private final ObservableList patients = FXCollections.observableArrayList(); - AddressBookStub(Collection patients) { + CliniCalStub(Collection patients) { this.patients.setAll(patients); } diff --git a/src/test/java/seedu/address/model/ModelManagerTest.java b/src/test/java/seedu/address/model/ModelManagerTest.java index 1cd4fc781fd..0b808e7cf8d 100644 --- a/src/test/java/seedu/address/model/ModelManagerTest.java +++ b/src/test/java/seedu/address/model/ModelManagerTest.java @@ -16,7 +16,7 @@ import seedu.address.commons.core.GuiSettings; import seedu.address.model.patient.NameContainsKeywordsPredicate; -import seedu.address.testutil.AddressBookBuilder; +import seedu.address.testutil.CliniCalBuilder; public class ModelManagerTest { @@ -26,7 +26,7 @@ public class ModelManagerTest { public void constructor() { assertEquals(new UserPrefs(), modelManager.getUserPrefs()); assertEquals(new GuiSettings(), modelManager.getGuiSettings()); - assertEquals(new AddressBook(), new AddressBook(modelManager.getAddressBook())); + assertEquals(new CliniCal(), new CliniCal(modelManager.getCliniCal())); } @Test @@ -37,14 +37,14 @@ public void setUserPrefs_nullUserPrefs_throwsNullPointerException() { @Test public void setUserPrefs_validUserPrefs_copiesUserPrefs() { UserPrefs userPrefs = new UserPrefs(); - userPrefs.setAddressBookFilePath(Paths.get("address/book/file/path")); + userPrefs.setCliniCalFilePath(Paths.get("address/book/file/path")); userPrefs.setGuiSettings(new GuiSettings(1, 2, 3, 4)); modelManager.setUserPrefs(userPrefs); assertEquals(userPrefs, modelManager.getUserPrefs()); // Modifying userPrefs should not modify modelManager's userPrefs UserPrefs oldUserPrefs = new UserPrefs(userPrefs); - userPrefs.setAddressBookFilePath(Paths.get("new/address/book/file/path")); + userPrefs.setCliniCalFilePath(Paths.get("new/address/book/file/path")); assertEquals(oldUserPrefs, modelManager.getUserPrefs()); } @@ -61,15 +61,15 @@ public void setGuiSettings_validGuiSettings_setsGuiSettings() { } @Test - public void setAddressBookFilePath_nullPath_throwsNullPointerException() { - assertThrows(NullPointerException.class, () -> modelManager.setAddressBookFilePath(null)); + public void setCliniCalFilePath_nullPath_throwsNullPointerException() { + assertThrows(NullPointerException.class, () -> modelManager.setCliniCalFilePath(null)); } @Test - public void setAddressBookFilePath_validPath_setsAddressBookFilePath() { + public void setCliniCalFilePath_validPath_setsCliniCalFilePath() { Path path = Paths.get("address/book/file/path"); - modelManager.setAddressBookFilePath(path); - assertEquals(path, modelManager.getAddressBookFilePath()); + modelManager.setCliniCalFilePath(path); + assertEquals(path, modelManager.getCliniCalFilePath()); } @Test @@ -78,12 +78,12 @@ public void hasPatient_nullPatient_throwsNullPointerException() { } @Test - public void hasPatient_patientNotInAddressBook_returnsFalse() { + public void hasPatient_patientNotInCliniCal_returnsFalse() { assertFalse(modelManager.hasPatient(ALICE)); } @Test - public void hasPatient_patientInAddressBook_returnsTrue() { + public void hasPatient_patientInCliniCal_returnsTrue() { modelManager.addPatient(ALICE); assertTrue(modelManager.hasPatient(ALICE)); } @@ -95,13 +95,13 @@ public void getFilteredPatientList_modifyList_throwsUnsupportedOperationExceptio @Test public void equals() { - AddressBook addressBook = new AddressBookBuilder().withPatient(ALICE).withPatient(BENSON).build(); - AddressBook differentAddressBook = new AddressBook(); + CliniCal cliniCal = new CliniCalBuilder().withPatient(ALICE).withPatient(BENSON).build(); + CliniCal differentCliniCal = new CliniCal(); UserPrefs userPrefs = new UserPrefs(); // same values -> returns true - modelManager = new ModelManager(addressBook, userPrefs); - ModelManager modelManagerCopy = new ModelManager(addressBook, userPrefs); + modelManager = new ModelManager(cliniCal, userPrefs); + ModelManager modelManagerCopy = new ModelManager(cliniCal, userPrefs); assertTrue(modelManager.equals(modelManagerCopy)); // same object -> returns true @@ -113,20 +113,20 @@ public void equals() { // different types -> returns false assertFalse(modelManager.equals(5)); - // different addressBook -> returns false - assertFalse(modelManager.equals(new ModelManager(differentAddressBook, userPrefs))); + // different cliniCal -> returns false + assertFalse(modelManager.equals(new ModelManager(differentCliniCal, userPrefs))); // different filteredList -> returns false String[] keywords = ALICE.getName().fullName.split("\\s+"); modelManager.updateFilteredPatientList(new NameContainsKeywordsPredicate(Arrays.asList(keywords))); - assertFalse(modelManager.equals(new ModelManager(addressBook, userPrefs))); + assertFalse(modelManager.equals(new ModelManager(cliniCal, userPrefs))); // resets modelManager to initial state for upcoming tests modelManager.updateFilteredPatientList(PREDICATE_SHOW_ALL_PATIENTS); // different userPrefs -> returns false UserPrefs differentUserPrefs = new UserPrefs(); - differentUserPrefs.setAddressBookFilePath(Paths.get("differentFilePath")); - assertFalse(modelManager.equals(new ModelManager(addressBook, differentUserPrefs))); + differentUserPrefs.setCliniCalFilePath(Paths.get("differentFilePath")); + assertFalse(modelManager.equals(new ModelManager(cliniCal, differentUserPrefs))); } } diff --git a/src/test/java/seedu/address/model/UserPrefsTest.java b/src/test/java/seedu/address/model/UserPrefsTest.java index b1307a70d52..385f9384edd 100644 --- a/src/test/java/seedu/address/model/UserPrefsTest.java +++ b/src/test/java/seedu/address/model/UserPrefsTest.java @@ -13,9 +13,9 @@ public void setGuiSettings_nullGuiSettings_throwsNullPointerException() { } @Test - public void setAddressBookFilePath_nullPath_throwsNullPointerException() { + public void setCliniCalFilePath_nullPath_throwsNullPointerException() { UserPrefs userPrefs = new UserPrefs(); - assertThrows(NullPointerException.class, () -> userPrefs.setAddressBookFilePath(null)); + assertThrows(NullPointerException.class, () -> userPrefs.setCliniCalFilePath(null)); } } diff --git a/src/test/java/seedu/address/storage/JsonAddressBookStorageTest.java b/src/test/java/seedu/address/storage/JsonAddressBookStorageTest.java deleted file mode 100644 index 53f34f28142..00000000000 --- a/src/test/java/seedu/address/storage/JsonAddressBookStorageTest.java +++ /dev/null @@ -1,110 +0,0 @@ -package seedu.address.storage; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static seedu.address.testutil.Assert.assertThrows; -import static seedu.address.testutil.TypicalPatients.ALICE; -import static seedu.address.testutil.TypicalPatients.HOON; -import static seedu.address.testutil.TypicalPatients.IDA; -import static seedu.address.testutil.TypicalPatients.getTypicalAddressBook; - -import java.io.IOException; -import java.nio.file.Path; -import java.nio.file.Paths; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; - -import seedu.address.commons.exceptions.DataConversionException; -import seedu.address.model.AddressBook; -import seedu.address.model.ReadOnlyAddressBook; - -public class JsonAddressBookStorageTest { - private static final Path TEST_DATA_FOLDER = Paths.get("src", "test", "data", "JsonAddressBookStorageTest"); - - @TempDir - public Path testFolder; - - @Test - public void readAddressBook_nullFilePath_throwsNullPointerException() { - assertThrows(NullPointerException.class, () -> readAddressBook(null)); - } - - private java.util.Optional readAddressBook(String filePath) throws Exception { - return new JsonAddressBookStorage(Paths.get(filePath)).readAddressBook(addToTestDataPathIfNotNull(filePath)); - } - - private Path addToTestDataPathIfNotNull(String prefsFileInTestDataFolder) { - return prefsFileInTestDataFolder != null - ? TEST_DATA_FOLDER.resolve(prefsFileInTestDataFolder) - : null; - } - - @Test - public void read_missingFile_emptyResult() throws Exception { - assertFalse(readAddressBook("NonExistentFile.json").isPresent()); - } - - @Test - public void read_notJsonFormat_exceptionThrown() { - assertThrows(DataConversionException.class, () -> readAddressBook("notJsonFormatAddressBook.json")); - } - - @Test - public void readAddressBook_invalidPatientAddressBook_throwDataConversionException() { - assertThrows(DataConversionException.class, () -> readAddressBook("invalidPatientAddressBook.json")); - } - - @Test - public void readAddressBook_invalidAndValidPatientAddressBook_throwDataConversionException() { - assertThrows(DataConversionException.class, () -> readAddressBook("invalidAndValidPatientAddressBook.json")); - } - - @Test - public void readAndSaveAddressBook_allInOrder_success() throws Exception { - Path filePath = testFolder.resolve("TempAddressBook.json"); - AddressBook original = getTypicalAddressBook(); - JsonAddressBookStorage jsonAddressBookStorage = new JsonAddressBookStorage(filePath); - - // Save in new file and read back - jsonAddressBookStorage.saveAddressBook(original, filePath); - ReadOnlyAddressBook readBack = jsonAddressBookStorage.readAddressBook(filePath).get(); - assertEquals(original, new AddressBook(readBack)); - - // Modify data, overwrite exiting file, and read back - original.addPatient(HOON); - original.removePatient(ALICE); - jsonAddressBookStorage.saveAddressBook(original, filePath); - readBack = jsonAddressBookStorage.readAddressBook(filePath).get(); - assertEquals(original, new AddressBook(readBack)); - - // Save and read without specifying file path - original.addPatient(IDA); - jsonAddressBookStorage.saveAddressBook(original); // file path not specified - readBack = jsonAddressBookStorage.readAddressBook().get(); // file path not specified - assertEquals(original, new AddressBook(readBack)); - - } - - @Test - public void saveAddressBook_nullAddressBook_throwsNullPointerException() { - assertThrows(NullPointerException.class, () -> saveAddressBook(null, "SomeFile.json")); - } - - /** - * Saves {@code addressBook} at the specified {@code filePath}. - */ - private void saveAddressBook(ReadOnlyAddressBook addressBook, String filePath) { - try { - new JsonAddressBookStorage(Paths.get(filePath)) - .saveAddressBook(addressBook, addToTestDataPathIfNotNull(filePath)); - } catch (IOException ioe) { - throw new AssertionError("There should not be an error writing to the file.", ioe); - } - } - - @Test - public void saveAddressBook_nullFilePath_throwsNullPointerException() { - assertThrows(NullPointerException.class, () -> saveAddressBook(new AddressBook(), null)); - } -} diff --git a/src/test/java/seedu/address/storage/JsonCliniCalStorageTest.java b/src/test/java/seedu/address/storage/JsonCliniCalStorageTest.java new file mode 100644 index 00000000000..e4590f2d3d8 --- /dev/null +++ b/src/test/java/seedu/address/storage/JsonCliniCalStorageTest.java @@ -0,0 +1,110 @@ +package seedu.address.storage; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static seedu.address.testutil.Assert.assertThrows; +import static seedu.address.testutil.TypicalPatients.ALICE; +import static seedu.address.testutil.TypicalPatients.HOON; +import static seedu.address.testutil.TypicalPatients.IDA; +import static seedu.address.testutil.TypicalPatients.getTypicalCliniCal; + +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import seedu.address.commons.exceptions.DataConversionException; +import seedu.address.model.CliniCal; +import seedu.address.model.ReadOnlyCliniCal; + +public class JsonCliniCalStorageTest { + private static final Path TEST_DATA_FOLDER = Paths.get("src", "test", "data", "JsonCliniCalStorageTest"); + + @TempDir + public Path testFolder; + + @Test + public void readCliniCal_nullFilePath_throwsNullPointerException() { + assertThrows(NullPointerException.class, () -> readCliniCal(null)); + } + + private java.util.Optional readCliniCal(String filePath) throws Exception { + return new JsonCliniCalStorage(Paths.get(filePath)).readCliniCal(addToTestDataPathIfNotNull(filePath)); + } + + private Path addToTestDataPathIfNotNull(String prefsFileInTestDataFolder) { + return prefsFileInTestDataFolder != null + ? TEST_DATA_FOLDER.resolve(prefsFileInTestDataFolder) + : null; + } + + @Test + public void read_missingFile_emptyResult() throws Exception { + assertFalse(readCliniCal("NonExistentFile.json").isPresent()); + } + + @Test + public void read_notJsonFormat_exceptionThrown() { + assertThrows(DataConversionException.class, () -> readCliniCal("notJsonFormatCliniCal.json")); + } + + @Test + public void readCliniCal_invalidPatientCliniCal_throwDataConversionException() { + assertThrows(DataConversionException.class, () -> readCliniCal("invalidPatientCliniCal.json")); + } + + @Test + public void readCliniCal_invalidAndValidPatientCliniCal_throwDataConversionException() { + assertThrows(DataConversionException.class, () -> readCliniCal("invalidAndValidPatientCliniCal.json")); + } + + @Test + public void readAndSaveCliniCal_allInOrder_success() throws Exception { + Path filePath = testFolder.resolve("TempCliniCal.json"); + CliniCal original = getTypicalCliniCal(); + JsonCliniCalStorage jsonCliniCalStorage = new JsonCliniCalStorage(filePath); + + // Save in new file and read back + jsonCliniCalStorage.saveCliniCal(original, filePath); + ReadOnlyCliniCal readBack = jsonCliniCalStorage.readCliniCal(filePath).get(); + assertEquals(original, new CliniCal(readBack)); + + // Modify data, overwrite exiting file, and read back + original.addPatient(HOON); + original.removePatient(ALICE); + jsonCliniCalStorage.saveCliniCal(original, filePath); + readBack = jsonCliniCalStorage.readCliniCal(filePath).get(); + assertEquals(original, new CliniCal(readBack)); + + // Save and read without specifying file path + original.addPatient(IDA); + jsonCliniCalStorage.saveCliniCal(original); // file path not specified + readBack = jsonCliniCalStorage.readCliniCal().get(); // file path not specified + assertEquals(original, new CliniCal(readBack)); + + } + + @Test + public void saveCliniCal_nullCliniCal_throwsNullPointerException() { + assertThrows(NullPointerException.class, () -> saveCliniCal(null, "SomeFile.json")); + } + + /** + * Saves {@code cliniCal} at the specified {@code filePath}. + */ + private void saveCliniCal(ReadOnlyCliniCal cliniCal, String filePath) { + try { + new JsonCliniCalStorage(Paths.get(filePath)) + .saveCliniCal(cliniCal, addToTestDataPathIfNotNull(filePath)); + } catch (IOException ioe) { + throw new AssertionError("There should not be an error writing to the file.", ioe); + } + } + + @Test + public void saveCliniCal_nullFilePath_throwsNullPointerException() { + assertThrows(NullPointerException.class, () -> saveCliniCal(new CliniCal(), null)); + } +} diff --git a/src/test/java/seedu/address/storage/JsonSerializableAddressBookTest.java b/src/test/java/seedu/address/storage/JsonSerializableCliniCalTest.java similarity index 53% rename from src/test/java/seedu/address/storage/JsonSerializableAddressBookTest.java rename to src/test/java/seedu/address/storage/JsonSerializableCliniCalTest.java index 14b438cd8f3..d494999dd17 100644 --- a/src/test/java/seedu/address/storage/JsonSerializableAddressBookTest.java +++ b/src/test/java/seedu/address/storage/JsonSerializableCliniCalTest.java @@ -10,37 +10,37 @@ import seedu.address.commons.exceptions.IllegalValueException; import seedu.address.commons.util.JsonUtil; -import seedu.address.model.AddressBook; +import seedu.address.model.CliniCal; import seedu.address.testutil.TypicalPatients; -public class JsonSerializableAddressBookTest { +public class JsonSerializableCliniCalTest { - private static final Path TEST_DATA_FOLDER = Paths.get("src", "test", "data", "JsonSerializableAddressBookTest"); - private static final Path TYPICAL_PATIENTS_FILE = TEST_DATA_FOLDER.resolve("typicalPatientsAddressBook.json"); - private static final Path INVALID_PATIENT_FILE = TEST_DATA_FOLDER.resolve("invalidPatientAddressBook.json"); - private static final Path DUPLICATE_PATIENT_FILE = TEST_DATA_FOLDER.resolve("duplicatePatientAddressBook.json"); + private static final Path TEST_DATA_FOLDER = Paths.get("src", "test", "data", "JsonSerializableCliniCalTest"); + private static final Path TYPICAL_PATIENTS_FILE = TEST_DATA_FOLDER.resolve("typicalPatientsCliniCal.json"); + private static final Path INVALID_PATIENT_FILE = TEST_DATA_FOLDER.resolve("invalidPatientCliniCal.json"); + private static final Path DUPLICATE_PATIENT_FILE = TEST_DATA_FOLDER.resolve("duplicatePatientCliniCal.json"); @Test public void toModelType_typicalPatientsFile_success() throws Exception { - JsonSerializableAddressBook dataFromFile = JsonUtil.readJsonFile(TYPICAL_PATIENTS_FILE, - JsonSerializableAddressBook.class).get(); - AddressBook addressBookFromFile = dataFromFile.toModelType(); - AddressBook typicalPatientsAddressBook = TypicalPatients.getTypicalAddressBook(); - assertEquals(addressBookFromFile, typicalPatientsAddressBook); + JsonSerializableCliniCal dataFromFile = JsonUtil.readJsonFile(TYPICAL_PATIENTS_FILE, + JsonSerializableCliniCal.class).get(); + CliniCal cliniCalFromFile = dataFromFile.toModelType(); + CliniCal typicalPatientsCliniCal = TypicalPatients.getTypicalCliniCal(); + assertEquals(cliniCalFromFile, typicalPatientsCliniCal); } @Test public void toModelType_invalidPatientFile_throwsIllegalValueException() throws Exception { - JsonSerializableAddressBook dataFromFile = JsonUtil.readJsonFile(INVALID_PATIENT_FILE, - JsonSerializableAddressBook.class).get(); + JsonSerializableCliniCal dataFromFile = JsonUtil.readJsonFile(INVALID_PATIENT_FILE, + JsonSerializableCliniCal.class).get(); assertThrows(IllegalValueException.class, dataFromFile::toModelType); } @Test public void toModelType_duplicatePatients_throwsIllegalValueException() throws Exception { - JsonSerializableAddressBook dataFromFile = JsonUtil.readJsonFile(DUPLICATE_PATIENT_FILE, - JsonSerializableAddressBook.class).get(); - assertThrows(IllegalValueException.class, JsonSerializableAddressBook.MESSAGE_DUPLICATE_PATIENT, + JsonSerializableCliniCal dataFromFile = JsonUtil.readJsonFile(DUPLICATE_PATIENT_FILE, + JsonSerializableCliniCal.class).get(); + assertThrows(IllegalValueException.class, JsonSerializableCliniCal.MESSAGE_DUPLICATE_PATIENT, dataFromFile::toModelType); } diff --git a/src/test/java/seedu/address/storage/JsonUserPrefsStorageTest.java b/src/test/java/seedu/address/storage/JsonUserPrefsStorageTest.java index 16f33f4a6bb..41677b8309d 100644 --- a/src/test/java/seedu/address/storage/JsonUserPrefsStorageTest.java +++ b/src/test/java/seedu/address/storage/JsonUserPrefsStorageTest.java @@ -73,7 +73,7 @@ public void readUserPrefs_extraValuesInFile_extraValuesIgnored() throws DataConv private UserPrefs getTypicalUserPrefs() { UserPrefs userPrefs = new UserPrefs(); userPrefs.setGuiSettings(new GuiSettings(1000, 500, 300, 100)); - userPrefs.setAddressBookFilePath(Paths.get("addressbook.json")); + userPrefs.setCliniCalFilePath(Paths.get("clinical.json")); return userPrefs; } diff --git a/src/test/java/seedu/address/storage/StorageManagerTest.java b/src/test/java/seedu/address/storage/StorageManagerTest.java index 7c3845d3b97..248f5dc67a2 100644 --- a/src/test/java/seedu/address/storage/StorageManagerTest.java +++ b/src/test/java/seedu/address/storage/StorageManagerTest.java @@ -2,7 +2,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static seedu.address.testutil.TypicalPatients.getTypicalAddressBook; +import static seedu.address.testutil.TypicalPatients.getTypicalCliniCal; import java.nio.file.Path; @@ -11,8 +11,8 @@ import org.junit.jupiter.api.io.TempDir; import seedu.address.commons.core.GuiSettings; -import seedu.address.model.AddressBook; -import seedu.address.model.ReadOnlyAddressBook; +import seedu.address.model.CliniCal; +import seedu.address.model.ReadOnlyCliniCal; import seedu.address.model.UserPrefs; public class StorageManagerTest { @@ -24,9 +24,9 @@ public class StorageManagerTest { @BeforeEach public void setUp() { - JsonAddressBookStorage addressBookStorage = new JsonAddressBookStorage(getTempFilePath("ab")); + JsonCliniCalStorage cliniCalStorage = new JsonCliniCalStorage(getTempFilePath("ab")); JsonUserPrefsStorage userPrefsStorage = new JsonUserPrefsStorage(getTempFilePath("prefs")); - storageManager = new StorageManager(addressBookStorage, userPrefsStorage); + storageManager = new StorageManager(cliniCalStorage, userPrefsStorage); } private Path getTempFilePath(String fileName) { @@ -48,21 +48,21 @@ public void prefsReadSave() throws Exception { } @Test - public void addressBookReadSave() throws Exception { + public void cliniCalReadSave() throws Exception { /* * Note: This is an integration test that verifies the StorageManager is properly wired to the - * {@link JsonAddressBookStorage} class. - * More extensive testing of UserPref saving/reading is done in {@link JsonAddressBookStorageTest} class. + * {@link JsonCliniCalStorage} class. + * More extensive testing of UserPref saving/reading is done in {@link JsonCliniCalStorageTest} class. */ - AddressBook original = getTypicalAddressBook(); - storageManager.saveAddressBook(original); - ReadOnlyAddressBook retrieved = storageManager.readAddressBook().get(); - assertEquals(original, new AddressBook(retrieved)); + CliniCal original = getTypicalCliniCal(); + storageManager.saveCliniCal(original); + ReadOnlyCliniCal retrieved = storageManager.readCliniCal().get(); + assertEquals(original, new CliniCal(retrieved)); } @Test - public void getAddressBookFilePath() { - assertNotNull(storageManager.getAddressBookFilePath()); + public void getCliniCalFilePath() { + assertNotNull(storageManager.getCliniCalFilePath()); } } diff --git a/src/test/java/seedu/address/testutil/AddressBookBuilder.java b/src/test/java/seedu/address/testutil/AddressBookBuilder.java deleted file mode 100644 index dce68da40b8..00000000000 --- a/src/test/java/seedu/address/testutil/AddressBookBuilder.java +++ /dev/null @@ -1,34 +0,0 @@ -package seedu.address.testutil; - -import seedu.address.model.AddressBook; -import seedu.address.model.patient.Patient; - -/** - * A utility class to help with building Addressbook objects. - * Example usage:
- * {@code AddressBook ab = new AddressBookBuilder().withPatient("John", "Doe").build();} - */ -public class AddressBookBuilder { - - private AddressBook addressBook; - - public AddressBookBuilder() { - addressBook = new AddressBook(); - } - - public AddressBookBuilder(AddressBook addressBook) { - this.addressBook = addressBook; - } - - /** - * Adds a new {@code Patient} to the {@code AddressBook} that we are building. - */ - public AddressBookBuilder withPatient(Patient patient) { - addressBook.addPatient(patient); - return this; - } - - public AddressBook build() { - return addressBook; - } -} diff --git a/src/test/java/seedu/address/testutil/CliniCalBuilder.java b/src/test/java/seedu/address/testutil/CliniCalBuilder.java new file mode 100644 index 00000000000..b13eaf49077 --- /dev/null +++ b/src/test/java/seedu/address/testutil/CliniCalBuilder.java @@ -0,0 +1,34 @@ +package seedu.address.testutil; + +import seedu.address.model.CliniCal; +import seedu.address.model.patient.Patient; + +/** + * A utility class to help with building CliniCal objects. + * Example usage:
+ * {@code CliniCal ab = new CliniCalBuilder().withPatient("John", "Doe").build();} + */ +public class CliniCalBuilder { + + private CliniCal cliniCal; + + public CliniCalBuilder() { + cliniCal = new CliniCal(); + } + + public CliniCalBuilder(CliniCal cliniCal) { + this.cliniCal = cliniCal; + } + + /** + * Adds a new {@code Patient} to the {@code CliniCal} that we are building. + */ + public CliniCalBuilder withPatient(Patient patient) { + cliniCal.addPatient(patient); + return this; + } + + public CliniCal build() { + return cliniCal; + } +} diff --git a/src/test/java/seedu/address/testutil/TypicalPatients.java b/src/test/java/seedu/address/testutil/TypicalPatients.java index cb26142db02..159467806c9 100644 --- a/src/test/java/seedu/address/testutil/TypicalPatients.java +++ b/src/test/java/seedu/address/testutil/TypicalPatients.java @@ -15,7 +15,7 @@ import java.util.Arrays; import java.util.List; -import seedu.address.model.AddressBook; +import seedu.address.model.CliniCal; import seedu.address.model.patient.Patient; /** @@ -60,10 +60,10 @@ public class TypicalPatients { private TypicalPatients() {} // prevents instantiation /** - * Returns an {@code AddressBook} with all the typical patients. + * Returns an {@code CliniCal} with all the typical patients. */ - public static AddressBook getTypicalAddressBook() { - AddressBook ab = new AddressBook(); + public static CliniCal getTypicalCliniCal() { + CliniCal ab = new CliniCal(); for (Patient patient : getTypicalPatients()) { ab.addPatient(patient); } From ce782cca263c1651354d76fa7795a53bca88b8b6 Mon Sep 17 00:00:00 2001 From: gsmoon97 Date: Sat, 26 Sep 2020 23:47:05 +0900 Subject: [PATCH 2/2] rename test files --- .../invalidAndValidPatientCliniCal.json} | 0 .../invalidPatientCliniCal.json} | 0 .../notJsonFormatCliniCal.json} | 0 .../duplicatePatientCliniCal.json} | 0 .../invalidPatientCliniCal.json} | 0 .../typicalPatientsCliniCal.json} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename src/test/data/{JsonAddressBookStorageTest/invalidAndValidPatientAddressBook.json => JsonCliniCalStorageTest/invalidAndValidPatientCliniCal.json} (100%) rename src/test/data/{JsonAddressBookStorageTest/invalidPatientAddressBook.json => JsonCliniCalStorageTest/invalidPatientCliniCal.json} (100%) rename src/test/data/{JsonAddressBookStorageTest/notJsonFormatAddressBook.json => JsonCliniCalStorageTest/notJsonFormatCliniCal.json} (100%) rename src/test/data/{JsonSerializableAddressBookTest/duplicatePatientAddressBook.json => JsonSerializableCliniCalTest/duplicatePatientCliniCal.json} (100%) rename src/test/data/{JsonSerializableAddressBookTest/invalidPatientAddressBook.json => JsonSerializableCliniCalTest/invalidPatientCliniCal.json} (100%) rename src/test/data/{JsonSerializableAddressBookTest/typicalPatientsAddressBook.json => JsonSerializableCliniCalTest/typicalPatientsCliniCal.json} (100%) diff --git a/src/test/data/JsonAddressBookStorageTest/invalidAndValidPatientAddressBook.json b/src/test/data/JsonCliniCalStorageTest/invalidAndValidPatientCliniCal.json similarity index 100% rename from src/test/data/JsonAddressBookStorageTest/invalidAndValidPatientAddressBook.json rename to src/test/data/JsonCliniCalStorageTest/invalidAndValidPatientCliniCal.json diff --git a/src/test/data/JsonAddressBookStorageTest/invalidPatientAddressBook.json b/src/test/data/JsonCliniCalStorageTest/invalidPatientCliniCal.json similarity index 100% rename from src/test/data/JsonAddressBookStorageTest/invalidPatientAddressBook.json rename to src/test/data/JsonCliniCalStorageTest/invalidPatientCliniCal.json diff --git a/src/test/data/JsonAddressBookStorageTest/notJsonFormatAddressBook.json b/src/test/data/JsonCliniCalStorageTest/notJsonFormatCliniCal.json similarity index 100% rename from src/test/data/JsonAddressBookStorageTest/notJsonFormatAddressBook.json rename to src/test/data/JsonCliniCalStorageTest/notJsonFormatCliniCal.json diff --git a/src/test/data/JsonSerializableAddressBookTest/duplicatePatientAddressBook.json b/src/test/data/JsonSerializableCliniCalTest/duplicatePatientCliniCal.json similarity index 100% rename from src/test/data/JsonSerializableAddressBookTest/duplicatePatientAddressBook.json rename to src/test/data/JsonSerializableCliniCalTest/duplicatePatientCliniCal.json diff --git a/src/test/data/JsonSerializableAddressBookTest/invalidPatientAddressBook.json b/src/test/data/JsonSerializableCliniCalTest/invalidPatientCliniCal.json similarity index 100% rename from src/test/data/JsonSerializableAddressBookTest/invalidPatientAddressBook.json rename to src/test/data/JsonSerializableCliniCalTest/invalidPatientCliniCal.json diff --git a/src/test/data/JsonSerializableAddressBookTest/typicalPatientsAddressBook.json b/src/test/data/JsonSerializableCliniCalTest/typicalPatientsCliniCal.json similarity index 100% rename from src/test/data/JsonSerializableAddressBookTest/typicalPatientsAddressBook.json rename to src/test/data/JsonSerializableCliniCalTest/typicalPatientsCliniCal.json