From f130dff41f7aea8930c53437cd7892d1219c9798 Mon Sep 17 00:00:00 2001 From: Vishnu Prem Date: Sat, 1 Oct 2016 23:49:20 +0800 Subject: [PATCH 001/139] Update README.md to point to updated Build Status --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 249a00b3899c..bb1e60de9cdb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/se-edu/addressbook-level4.svg?branch=master)](https://travis-ci.org/se-edu/addressbook-level4) +[![Build Status](https://travis-ci.org/CS2103AUG2016-W11-C2/main.svg?branch=master)](https://travis-ci.org/CS2103AUG2016-W11-C2/main) [![Coverage Status](https://coveralls.io/repos/github/se-edu/addressbook-level4/badge.svg?branch=master)](https://coveralls.io/github/se-edu/addressbook-level4?branch=master) # Address Book (Level 4) From cfb9b819ea9fd6255706d4c112bd941c10cbd451 Mon Sep 17 00:00:00 2001 From: "XPS13\\Rachael" Date: Mon, 3 Oct 2016 20:29:11 +0800 Subject: [PATCH 002/139] Delete address, email and phone class from model --- .../seedu/address/model/person/Address.java | 54 ------------------ .../seedu/address/model/person/Email.java | 56 ------------------- .../seedu/address/model/person/Phone.java | 54 ------------------ 3 files changed, 164 deletions(-) delete mode 100644 src/main/java/seedu/address/model/person/Address.java delete mode 100644 src/main/java/seedu/address/model/person/Email.java delete mode 100644 src/main/java/seedu/address/model/person/Phone.java diff --git a/src/main/java/seedu/address/model/person/Address.java b/src/main/java/seedu/address/model/person/Address.java deleted file mode 100644 index a2bd109c005e..000000000000 --- a/src/main/java/seedu/address/model/person/Address.java +++ /dev/null @@ -1,54 +0,0 @@ -package seedu.address.model.person; - - -import seedu.address.commons.exceptions.IllegalValueException; - -/** - * Represents a Person's address in the address book. - * Guarantees: immutable; is valid as declared in {@link #isValidAddress(String)} - */ -public class Address { - - public static final String MESSAGE_ADDRESS_CONSTRAINTS = "Person addresses can be in any format"; - public static final String ADDRESS_VALIDATION_REGEX = ".+"; - - public final String value; - - /** - * Validates given address. - * - * @throws IllegalValueException if given address string is invalid. - */ - public Address(String address) throws IllegalValueException { - assert address != null; - if (!isValidAddress(address)) { - throw new IllegalValueException(MESSAGE_ADDRESS_CONSTRAINTS); - } - this.value = address; - } - - /** - * Returns true if a given string is a valid person email. - */ - public static boolean isValidAddress(String test) { - return test.matches(ADDRESS_VALIDATION_REGEX); - } - - @Override - public String toString() { - return value; - } - - @Override - public boolean equals(Object other) { - return other == this // short circuit if same object - || (other instanceof Address // instanceof handles nulls - && this.value.equals(((Address) other).value)); // state check - } - - @Override - public int hashCode() { - return value.hashCode(); - } - -} \ No newline at end of file diff --git a/src/main/java/seedu/address/model/person/Email.java b/src/main/java/seedu/address/model/person/Email.java deleted file mode 100644 index 5da4d1078236..000000000000 --- a/src/main/java/seedu/address/model/person/Email.java +++ /dev/null @@ -1,56 +0,0 @@ -package seedu.address.model.person; - - -import seedu.address.commons.exceptions.IllegalValueException; - -/** - * Represents a Person's phone number in the address book. - * Guarantees: immutable; is valid as declared in {@link #isValidEmail(String)} - */ -public class Email { - - public static final String MESSAGE_EMAIL_CONSTRAINTS = - "Person emails should be 2 alphanumeric/period strings separated by '@'"; - public static final String EMAIL_VALIDATION_REGEX = "[\\w\\.]+@[\\w\\.]+"; - - public final String value; - - /** - * Validates given email. - * - * @throws IllegalValueException if given email address string is invalid. - */ - public Email(String email) throws IllegalValueException { - assert email != null; - email = email.trim(); - if (!isValidEmail(email)) { - throw new IllegalValueException(MESSAGE_EMAIL_CONSTRAINTS); - } - this.value = email; - } - - /** - * Returns if a given string is a valid person email. - */ - public static boolean isValidEmail(String test) { - return test.matches(EMAIL_VALIDATION_REGEX); - } - - @Override - public String toString() { - return value; - } - - @Override - public boolean equals(Object other) { - return other == this // short circuit if same object - || (other instanceof Email // instanceof handles nulls - && this.value.equals(((Email) other).value)); // state check - } - - @Override - public int hashCode() { - return value.hashCode(); - } - -} diff --git a/src/main/java/seedu/address/model/person/Phone.java b/src/main/java/seedu/address/model/person/Phone.java deleted file mode 100644 index d27b2244b727..000000000000 --- a/src/main/java/seedu/address/model/person/Phone.java +++ /dev/null @@ -1,54 +0,0 @@ -package seedu.address.model.person; - -import seedu.address.commons.exceptions.IllegalValueException; - -/** - * Represents a Person's phone number in the address book. - * Guarantees: immutable; is valid as declared in {@link #isValidPhone(String)} - */ -public class Phone { - - public static final String MESSAGE_PHONE_CONSTRAINTS = "Person phone numbers should only contain numbers"; - public static final String PHONE_VALIDATION_REGEX = "\\d+"; - - public final String value; - - /** - * Validates given phone number. - * - * @throws IllegalValueException if given phone string is invalid. - */ - public Phone(String phone) throws IllegalValueException { - assert phone != null; - phone = phone.trim(); - if (!isValidPhone(phone)) { - throw new IllegalValueException(MESSAGE_PHONE_CONSTRAINTS); - } - this.value = phone; - } - - /** - * Returns true if a given string is a valid person phone number. - */ - public static boolean isValidPhone(String test) { - return test.matches(PHONE_VALIDATION_REGEX); - } - - @Override - public String toString() { - return value; - } - - @Override - public boolean equals(Object other) { - return other == this // short circuit if same object - || (other instanceof Phone // instanceof handles nulls - && this.value.equals(((Phone) other).value)); // state check - } - - @Override - public int hashCode() { - return value.hashCode(); - } - -} From 1150601052c25b279f0966ecbc7895f16b2253e6 Mon Sep 17 00:00:00 2001 From: "XPS13\\Rachael" Date: Mon, 3 Oct 2016 20:31:56 +0800 Subject: [PATCH 003/139] Remove Phone, Email and Address object from Person class --- .../seedu/address/model/person/Person.java | 29 +++---------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/src/main/java/seedu/address/model/person/Person.java b/src/main/java/seedu/address/model/person/Person.java index 03ffce7d2e79..cd5460facd97 100644 --- a/src/main/java/seedu/address/model/person/Person.java +++ b/src/main/java/seedu/address/model/person/Person.java @@ -12,21 +12,15 @@ public class Person implements ReadOnlyPerson { private Name name; - private Phone phone; - private Email email; - private Address address; private UniqueTagList tags; /** * Every field must be present and not null. */ - public Person(Name name, Phone phone, Email email, Address address, UniqueTagList tags) { - assert !CollectionUtil.isAnyNull(name, phone, email, address, tags); + public Person(Name name, UniqueTagList tags) { + assert !CollectionUtil.isAnyNull(name, tags); this.name = name; - this.phone = phone; - this.email = email; - this.address = address; this.tags = new UniqueTagList(tags); // protect internal tags from changes in the arg list } @@ -34,7 +28,7 @@ public Person(Name name, Phone phone, Email email, Address address, UniqueTagLis * Copy constructor. */ public Person(ReadOnlyPerson source) { - this(source.getName(), source.getPhone(), source.getEmail(), source.getAddress(), source.getTags()); + this(source.getName(), source.getTags()); } @Override @@ -42,21 +36,6 @@ public Name getName() { return name; } - @Override - public Phone getPhone() { - return phone; - } - - @Override - public Email getEmail() { - return email; - } - - @Override - public Address getAddress() { - return address; - } - @Override public UniqueTagList getTags() { return new UniqueTagList(tags); @@ -79,7 +58,7 @@ public boolean equals(Object other) { @Override public int hashCode() { // use this method for custom fields hashing instead of implementing your own - return Objects.hash(name, phone, email, address, tags); + return Objects.hash(name, tags); } @Override From 9ce954fb1160bf4ddde89c0e4bfa73db4a860c65 Mon Sep 17 00:00:00 2001 From: "XPS13\\Rachael" Date: Mon, 3 Oct 2016 20:34:23 +0800 Subject: [PATCH 004/139] Remove Phone, Email and Address dependencies from ReadOnlyPerson interface --- .../seedu/address/model/person/ReadOnlyPerson.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/main/java/seedu/address/model/person/ReadOnlyPerson.java b/src/main/java/seedu/address/model/person/ReadOnlyPerson.java index d45be4b5fe36..0325cd238f83 100644 --- a/src/main/java/seedu/address/model/person/ReadOnlyPerson.java +++ b/src/main/java/seedu/address/model/person/ReadOnlyPerson.java @@ -9,9 +9,6 @@ public interface ReadOnlyPerson { Name getName(); - Phone getPhone(); - Email getEmail(); - Address getAddress(); /** * The returned TagList is a deep copy of the internal TagList, @@ -25,10 +22,7 @@ public interface ReadOnlyPerson { default boolean isSameStateAs(ReadOnlyPerson other) { return other == this // short circuit if same object || (other != null // this is first to avoid NPE below - && other.getName().equals(this.getName()) // state checks here onwards - && other.getPhone().equals(this.getPhone()) - && other.getEmail().equals(this.getEmail()) - && other.getAddress().equals(this.getAddress())); + && other.getName().equals(this.getName())); // state checks here onwards } /** @@ -37,12 +31,6 @@ default boolean isSameStateAs(ReadOnlyPerson other) { default String getAsText() { final StringBuilder builder = new StringBuilder(); builder.append(getName()) - .append(" Phone: ") - .append(getPhone()) - .append(" Email: ") - .append(getEmail()) - .append(" Address: ") - .append(getAddress()) .append(" Tags: "); getTags().forEach(builder::append); return builder.toString(); From 69fd489b7a0aefbaf083c0f91a33f49085e13ef3 Mon Sep 17 00:00:00 2001 From: "XPS13\\Rachael" Date: Mon, 3 Oct 2016 20:36:43 +0800 Subject: [PATCH 005/139] Remove phone, email and address from XmlAdaptedPerson class in storage --- .../seedu/address/storage/XmlAdaptedPerson.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/main/java/seedu/address/storage/XmlAdaptedPerson.java b/src/main/java/seedu/address/storage/XmlAdaptedPerson.java index f2167ec201b4..ca668587dffa 100644 --- a/src/main/java/seedu/address/storage/XmlAdaptedPerson.java +++ b/src/main/java/seedu/address/storage/XmlAdaptedPerson.java @@ -16,12 +16,6 @@ public class XmlAdaptedPerson { @XmlElement(required = true) private String name; - @XmlElement(required = true) - private String phone; - @XmlElement(required = true) - private String email; - @XmlElement(required = true) - private String address; @XmlElement private List tagged = new ArrayList<>(); @@ -39,9 +33,6 @@ public XmlAdaptedPerson() {} */ public XmlAdaptedPerson(ReadOnlyPerson source) { name = source.getName().fullName; - phone = source.getPhone().value; - email = source.getEmail().value; - address = source.getAddress().value; tagged = new ArrayList<>(); for (Tag tag : source.getTags()) { tagged.add(new XmlAdaptedTag(tag)); @@ -59,10 +50,7 @@ public Person toModelType() throws IllegalValueException { personTags.add(tag.toModelType()); } final Name name = new Name(this.name); - final Phone phone = new Phone(this.phone); - final Email email = new Email(this.email); - final Address address = new Address(this.address); final UniqueTagList tags = new UniqueTagList(personTags); - return new Person(name, phone, email, address, tags); + return new Person(name, tags); } } From 6f30a25cb94f487dbe8ce002fa6d85f2d4c5d7fc Mon Sep 17 00:00:00 2001 From: "XPS13\\Rachael" Date: Mon, 3 Oct 2016 20:38:20 +0800 Subject: [PATCH 006/139] Remove phone, email and address from Add Command in logic --- src/main/java/seedu/address/logic/commands/AddCommand.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/seedu/address/logic/commands/AddCommand.java b/src/main/java/seedu/address/logic/commands/AddCommand.java index 2860a9ab2a85..5eb69a7e7eb0 100644 --- a/src/main/java/seedu/address/logic/commands/AddCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddCommand.java @@ -30,7 +30,7 @@ public class AddCommand extends Command { * * @throws IllegalValueException if any of the raw values are invalid */ - public AddCommand(String name, String phone, String email, String address, Set tags) + public AddCommand(String name, Set tags) throws IllegalValueException { final Set tagSet = new HashSet<>(); for (String tagName : tags) { @@ -38,9 +38,6 @@ public AddCommand(String name, String phone, String email, String address, Set Date: Mon, 3 Oct 2016 20:40:27 +0800 Subject: [PATCH 007/139] Update Parser to remove pattern matching and grouping for phone, email and address --- src/main/java/seedu/address/logic/parser/Parser.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main/java/seedu/address/logic/parser/Parser.java b/src/main/java/seedu/address/logic/parser/Parser.java index 959b2cd0383c..86db4b7a448d 100644 --- a/src/main/java/seedu/address/logic/parser/Parser.java +++ b/src/main/java/seedu/address/logic/parser/Parser.java @@ -28,9 +28,6 @@ public class Parser { private static final Pattern PERSON_DATA_ARGS_FORMAT = // '/' forward slashes are reserved for delimiter prefixes Pattern.compile("(?[^/]+)" - + " (?p?)p/(?[^/]+)" - + " (?p?)e/(?[^/]+)" - + " (?p?)a/(?
[^/]+)" + "(?(?: t/[^/]+)*)"); // variable number of tags public Parser() {} @@ -95,9 +92,6 @@ private Command prepareAdd(String args){ try { return new AddCommand( matcher.group("name"), - matcher.group("phone"), - matcher.group("email"), - matcher.group("address"), getTagsFromArgs(matcher.group("tagArguments")) ); } catch (IllegalValueException ive) { From 2f451bfd1a617877816b538b4d57ac9d14a362b4 Mon Sep 17 00:00:00 2001 From: "XPS13\\Rachael" Date: Mon, 3 Oct 2016 20:41:47 +0800 Subject: [PATCH 008/139] Remove phone, address and email from Personcard class in UI --- src/main/java/seedu/address/ui/PersonCard.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/main/java/seedu/address/ui/PersonCard.java b/src/main/java/seedu/address/ui/PersonCard.java index 259e9ad0d333..e2958c983e5d 100644 --- a/src/main/java/seedu/address/ui/PersonCard.java +++ b/src/main/java/seedu/address/ui/PersonCard.java @@ -17,12 +17,6 @@ public class PersonCard extends UiPart{ @FXML private Label id; @FXML - private Label phone; - @FXML - private Label address; - @FXML - private Label email; - @FXML private Label tags; private ReadOnlyPerson person; @@ -43,9 +37,6 @@ public static PersonCard load(ReadOnlyPerson person, int displayedIndex){ public void initialize() { name.setText(person.getName().fullName); id.setText(displayedIndex + ". "); - phone.setText(person.getPhone().value); - address.setText(person.getAddress().value); - email.setText(person.getEmail().value); tags.setText(person.tagsString()); } From 068c64abdd31c0db9bfd3cfe0732b92b4d60c386 Mon Sep 17 00:00:00 2001 From: "XPS13\\Rachael" Date: Mon, 3 Oct 2016 20:51:21 +0800 Subject: [PATCH 009/139] Remove phone, email and address objects from Logic Manager Test class. Remove format check for phone, email and address in add command. (Passed JUnit test) --- .../seedu/address/logic/LogicManagerTest.java | 32 +++---------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/src/test/java/seedu/address/logic/LogicManagerTest.java b/src/test/java/seedu/address/logic/LogicManagerTest.java index e1ee0cfb4051..132d73dabfb0 100644 --- a/src/test/java/seedu/address/logic/LogicManagerTest.java +++ b/src/test/java/seedu/address/logic/LogicManagerTest.java @@ -149,26 +149,16 @@ public void execute_clear() throws Exception { @Test public void execute_add_invalidArgsFormat() throws Exception { String expectedMessage = String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddCommand.MESSAGE_USAGE); - assertCommandBehavior( - "add wrong args wrong args", expectedMessage); - assertCommandBehavior( - "add Valid Name 12345 e/valid@email.butNoPhonePrefix a/valid, address", expectedMessage); - assertCommandBehavior( - "add Valid Name p/12345 valid@email.butNoPrefix a/valid, address", expectedMessage); - assertCommandBehavior( - "add Valid Name p/12345 e/valid@email.butNoAddressPrefix valid, address", expectedMessage); + // TODO + // currently, there are no invalid add argument format } @Test public void execute_add_invalidPersonData() throws Exception { assertCommandBehavior( - "add []\\[;] p/12345 e/valid@e.mail a/valid, address", Name.MESSAGE_NAME_CONSTRAINTS); - assertCommandBehavior( - "add Valid Name p/not_numbers e/valid@e.mail a/valid, address", Phone.MESSAGE_PHONE_CONSTRAINTS); - assertCommandBehavior( - "add Valid Name p/12345 e/notAnEmail a/valid, address", Email.MESSAGE_EMAIL_CONSTRAINTS); + "add []\\[;]", Name.MESSAGE_NAME_CONSTRAINTS); assertCommandBehavior( - "add Valid Name p/12345 e/valid@e.mail a/valid, address t/invalid_-[.tag", Tag.MESSAGE_TAG_CONSTRAINTS); + "add Valid Name t/invalid_-[.tag", Tag.MESSAGE_TAG_CONSTRAINTS); } @@ -384,13 +374,10 @@ class TestDataHelper{ Person adam() throws Exception { Name name = new Name("Adam Brown"); - Phone privatePhone = new Phone("111111"); - Email email = new Email("adam@gmail.com"); - Address privateAddress = new Address("111, alpha street"); Tag tag1 = new Tag("tag1"); Tag tag2 = new Tag("tag2"); UniqueTagList tags = new UniqueTagList(tag1, tag2); - return new Person(name, privatePhone, email, privateAddress, tags); + return new Person(name, tags); } /** @@ -403,9 +390,6 @@ Person adam() throws Exception { Person generatePerson(int seed) throws Exception { return new Person( new Name("Person " + seed), - new Phone("" + Math.abs(seed)), - new Email(seed + "@email"), - new Address("House of " + seed), new UniqueTagList(new Tag("tag" + Math.abs(seed)), new Tag("tag" + Math.abs(seed + 1))) ); } @@ -417,9 +401,6 @@ String generateAddCommand(Person p) { cmd.append("add "); cmd.append(p.getName().toString()); - cmd.append(" p/").append(p.getPhone()); - cmd.append(" e/").append(p.getEmail()); - cmd.append(" a/").append(p.getAddress()); UniqueTagList tags = p.getTags(); for(Tag t: tags){ @@ -502,9 +483,6 @@ List generatePersonList(Person... persons) { Person generatePersonWithName(String name) throws Exception { return new Person( new Name(name), - new Phone("1"), - new Email("1@email"), - new Address("House of 1"), new UniqueTagList(new Tag("tag")) ); } From f4aa5655f5692ce3d49fc5fbf4ec8f13dfdfdb56 Mon Sep 17 00:00:00 2001 From: "XPS13\\Rachael" Date: Mon, 3 Oct 2016 21:02:39 +0800 Subject: [PATCH 010/139] Remove phone, email and address from TestUtil and Person Card Handle --- .../guitests/guihandles/PersonCardHandle.java | 23 ++----------- .../seedu/address/testutil/PersonBuilder.java | 15 --------- .../seedu/address/testutil/TestPerson.java | 33 ------------------- .../java/seedu/address/testutil/TestUtil.java | 18 +++++----- .../address/testutil/TypicalTestPersons.java | 22 +++++-------- 5 files changed, 21 insertions(+), 90 deletions(-) diff --git a/src/test/java/guitests/guihandles/PersonCardHandle.java b/src/test/java/guitests/guihandles/PersonCardHandle.java index fae22a45ae2f..39f273fef7cc 100644 --- a/src/test/java/guitests/guihandles/PersonCardHandle.java +++ b/src/test/java/guitests/guihandles/PersonCardHandle.java @@ -10,9 +10,6 @@ */ public class PersonCardHandle extends GuiHandle { private static final String NAME_FIELD_ID = "#name"; - private static final String ADDRESS_FIELD_ID = "#address"; - private static final String PHONE_FIELD_ID = "#phone"; - private static final String EMAIL_FIELD_ID = "#email"; private Node node; @@ -29,35 +26,21 @@ public String getFullName() { return getTextFromLabel(NAME_FIELD_ID); } - public String getAddress() { - return getTextFromLabel(ADDRESS_FIELD_ID); - } - - public String getPhone() { - return getTextFromLabel(PHONE_FIELD_ID); - } - - public String getEmail() { - return getTextFromLabel(EMAIL_FIELD_ID); - } - public boolean isSamePerson(ReadOnlyPerson person){ - return getFullName().equals(person.getName().fullName) && getPhone().equals(person.getPhone().value) - && getEmail().equals(person.getEmail().value) && getAddress().equals(person.getAddress().value); + return getFullName().equals(person.getName().fullName); } @Override public boolean equals(Object obj) { if(obj instanceof PersonCardHandle) { PersonCardHandle handle = (PersonCardHandle) obj; - return getFullName().equals(handle.getFullName()) - && getAddress().equals(handle.getAddress()); //TODO: compare the rest + return getFullName().equals(handle.getFullName()); //TODO: compare the rest } return super.equals(obj); } @Override public String toString() { - return getFullName() + " " + getAddress(); + return getFullName(); } } diff --git a/src/test/java/seedu/address/testutil/PersonBuilder.java b/src/test/java/seedu/address/testutil/PersonBuilder.java index 8b02a1668ef6..a491ec38588d 100644 --- a/src/test/java/seedu/address/testutil/PersonBuilder.java +++ b/src/test/java/seedu/address/testutil/PersonBuilder.java @@ -27,21 +27,6 @@ public PersonBuilder withTags(String ... tags) throws IllegalValueException { return this; } - public PersonBuilder withAddress(String address) throws IllegalValueException { - this.person.setAddress(new Address(address)); - return this; - } - - public PersonBuilder withPhone(String phone) throws IllegalValueException { - this.person.setPhone(new Phone(phone)); - return this; - } - - public PersonBuilder withEmail(String email) throws IllegalValueException { - this.person.setEmail(new Email(email)); - return this; - } - public TestPerson build() { return this.person; } diff --git a/src/test/java/seedu/address/testutil/TestPerson.java b/src/test/java/seedu/address/testutil/TestPerson.java index 19ee5ded1cd3..c714261b1926 100644 --- a/src/test/java/seedu/address/testutil/TestPerson.java +++ b/src/test/java/seedu/address/testutil/TestPerson.java @@ -9,9 +9,6 @@ public class TestPerson implements ReadOnlyPerson { private Name name; - private Address address; - private Email email; - private Phone phone; private UniqueTagList tags; public TestPerson() { @@ -22,38 +19,11 @@ public void setName(Name name) { this.name = name; } - public void setAddress(Address address) { - this.address = address; - } - - public void setEmail(Email email) { - this.email = email; - } - - public void setPhone(Phone phone) { - this.phone = phone; - } - @Override public Name getName() { return name; } - @Override - public Phone getPhone() { - return phone; - } - - @Override - public Email getEmail() { - return email; - } - - @Override - public Address getAddress() { - return address; - } - @Override public UniqueTagList getTags() { return tags; @@ -67,9 +37,6 @@ public String toString() { public String getAddCommand() { StringBuilder sb = new StringBuilder(); sb.append("add " + this.getName().fullName + " "); - sb.append("p/" + this.getPhone().value + " "); - sb.append("e/" + this.getEmail().value + " "); - sb.append("a/" + this.getAddress().value + " "); this.getTags().getInternalList().stream().forEach(s -> sb.append("t/" + s.tagName + " ")); return sb.toString(); } diff --git a/src/test/java/seedu/address/testutil/TestUtil.java b/src/test/java/seedu/address/testutil/TestUtil.java index 17c92d66398a..2efaf0ef9d6d 100644 --- a/src/test/java/seedu/address/testutil/TestUtil.java +++ b/src/test/java/seedu/address/testutil/TestUtil.java @@ -65,15 +65,15 @@ public static void assertThrows(Class expected, Runnable ex private static Person[] getSamplePersonData() { try { return new Person[]{ - new Person(new Name("Ali Muster"), new Phone("9482424"), new Email("hans@google.com"), new Address("4th street"), new UniqueTagList()), - new Person(new Name("Boris Mueller"), new Phone("87249245"), new Email("ruth@google.com"), new Address("81th street"), new UniqueTagList()), - new Person(new Name("Carl Kurz"), new Phone("95352563"), new Email("heinz@yahoo.com"), new Address("wall street"), new UniqueTagList()), - new Person(new Name("Daniel Meier"), new Phone("87652533"), new Email("cornelia@google.com"), new Address("10th street"), new UniqueTagList()), - new Person(new Name("Elle Meyer"), new Phone("9482224"), new Email("werner@gmail.com"), new Address("michegan ave"), new UniqueTagList()), - new Person(new Name("Fiona Kunz"), new Phone("9482427"), new Email("lydia@gmail.com"), new Address("little tokyo"), new UniqueTagList()), - new Person(new Name("George Best"), new Phone("9482442"), new Email("anna@google.com"), new Address("4th street"), new UniqueTagList()), - new Person(new Name("Hoon Meier"), new Phone("8482424"), new Email("stefan@mail.com"), new Address("little india"), new UniqueTagList()), - new Person(new Name("Ida Mueller"), new Phone("8482131"), new Email("hans@google.com"), new Address("chicago ave"), new UniqueTagList()) + new Person(new Name("Ali Muster"), new UniqueTagList()), + new Person(new Name("Boris Mueller"), new UniqueTagList()), + new Person(new Name("Carl Kurz"), new UniqueTagList()), + new Person(new Name("Daniel Meier"), new UniqueTagList()), + new Person(new Name("Elle Meyer"), new UniqueTagList()), + new Person(new Name("Fiona Kunz"), new UniqueTagList()), + new Person(new Name("George Best"), new UniqueTagList()), + new Person(new Name("Hoon Meier"), new UniqueTagList()), + new Person(new Name("Ida Mueller"), new UniqueTagList()) }; } catch (IllegalValueException e) { assert false; diff --git a/src/test/java/seedu/address/testutil/TypicalTestPersons.java b/src/test/java/seedu/address/testutil/TypicalTestPersons.java index 773f64a98cc3..d15ba703a156 100644 --- a/src/test/java/seedu/address/testutil/TypicalTestPersons.java +++ b/src/test/java/seedu/address/testutil/TypicalTestPersons.java @@ -13,21 +13,17 @@ public class TypicalTestPersons { public TypicalTestPersons() { try { - alice = new PersonBuilder().withName("Alice Pauline").withAddress("123, Jurong West Ave 6, #08-111") - .withEmail("alice@gmail.com").withPhone("85355255") - .withTags("friends").build(); - benson = new PersonBuilder().withName("Benson Meier").withAddress("311, Clementi Ave 2, #02-25") - .withEmail("johnd@gmail.com").withPhone("98765432") - .withTags("owesMoney", "friends").build(); - carl = new PersonBuilder().withName("Carl Kurz").withPhone("95352563").withEmail("heinz@yahoo.com").withAddress("wall street").build(); - daniel = new PersonBuilder().withName("Daniel Meier").withPhone("87652533").withEmail("cornelia@google.com").withAddress("10th street").build(); - elle = new PersonBuilder().withName("Elle Meyer").withPhone("9482224").withEmail("werner@gmail.com").withAddress("michegan ave").build(); - fiona = new PersonBuilder().withName("Fiona Kunz").withPhone("9482427").withEmail("lydia@gmail.com").withAddress("little tokyo").build(); - george = new PersonBuilder().withName("George Best").withPhone("9482442").withEmail("anna@google.com").withAddress("4th street").build(); + alice = new PersonBuilder().withName("Alice Pauline").withTags("friends").build(); + benson = new PersonBuilder().withName("Benson Meier").withTags("owesMoney", "friends").build(); + carl = new PersonBuilder().withName("Carl Kurz").build(); + daniel = new PersonBuilder().withName("Daniel Meier").build(); + elle = new PersonBuilder().withName("Elle Meyer").build(); + fiona = new PersonBuilder().withName("Fiona Kunz").build(); + george = new PersonBuilder().withName("George Best").build(); //Manually added - hoon = new PersonBuilder().withName("Hoon Meier").withPhone("8482424").withEmail("stefan@mail.com").withAddress("little india").build(); - ida = new PersonBuilder().withName("Ida Mueller").withPhone("8482131").withEmail("hans@google.com").withAddress("chicago ave").build(); + hoon = new PersonBuilder().withName("Hoon Meier").build(); + ida = new PersonBuilder().withName("Ida Mueller").build(); } catch (IllegalValueException e) { e.printStackTrace(); assert false : "not possible"; From b3a9a785807a10d31144d75aae2af37e0e76dba3 Mon Sep 17 00:00:00 2001 From: "XPS13\\Rachael" Date: Mon, 3 Oct 2016 21:16:44 +0800 Subject: [PATCH 011/139] Remove phone, address and email from person list card fxml --- src/main/resources/view/PersonListCard.fxml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/resources/view/PersonListCard.fxml b/src/main/resources/view/PersonListCard.fxml index 13d4b149651b..d126739601ae 100644 --- a/src/main/resources/view/PersonListCard.fxml +++ b/src/main/resources/view/PersonListCard.fxml @@ -12,7 +12,7 @@ - + @@ -31,9 +31,6 @@ -