Skip to content

Commit 9e37448

Browse files
committed
Fix CheckStyle to pass CI
fix checkstyle in order to pass CI for add delete meeting functionality.
1 parent ac925ed commit 9e37448

8 files changed

Lines changed: 51 additions & 90 deletions

File tree

src/main/java/seedu/address/logic/commands/meetings/DeleteMeetingCommand.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package seedu.address.logic.commands.meetings;
22

3+
import static java.util.Objects.requireNonNull;
4+
5+
import java.util.List;
6+
37
import seedu.address.commons.core.Messages;
48
import seedu.address.commons.core.index.Index;
59
import seedu.address.logic.commands.Command;
@@ -8,9 +12,6 @@
812
import seedu.address.model.Model;
913
import seedu.address.model.meeting.Meeting;
1014

11-
import java.util.List;
12-
13-
import static java.util.Objects.requireNonNull;
1415

1516
public class DeleteMeetingCommand extends Command {
1617
public static final String COMMAND_WORD = "deleteMeeting";

src/main/java/seedu/address/logic/parser/CliSyntax.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class CliSyntax {
1818
/* Prefix specific for meeting */
1919
public static final Prefix PREFIX_START_TIME = new Prefix("st/");
2020
public static final Prefix PREFIX_END_TIME = new Prefix("ed/");
21-
public static final Prefix PREFIX_DESCRIPTION = new Prefix("des/");
21+
public static final Prefix PREFIX_DESCRIPTION = new Prefix("desc/");
2222
public static final Prefix PREFIX_PRIORITY = new Prefix("pr/");
2323

2424

src/main/java/seedu/address/logic/parser/meetings/DeleteMeetingCommandParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package seedu.address.logic.parser.meetings;
22

3+
import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
4+
35
import seedu.address.commons.core.index.Index;
46
import seedu.address.logic.commands.meetings.DeleteMeetingCommand;
57
import seedu.address.logic.parser.Parser;
68
import seedu.address.logic.parser.ParserUtil;
79
import seedu.address.logic.parser.exceptions.ParseException;
810

9-
import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
10-
1111

1212
public class DeleteMeetingCommandParser implements Parser<DeleteMeetingCommand> {
1313

src/main/resources/view/MainWindow.fxml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
<?import javafx.scene.layout.VBox?>
1212
<?import javafx.stage.Stage?>
1313

14-
<fx:root minHeight="600" minWidth="450" onCloseRequest="#handleExit" title="Address App" type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/15.0.1" xmlns:fx="http://javafx.com/fxml/1">
14+
<fx:root minHeight="600" minWidth="450" onCloseRequest="#handleExit" title="Address App" type="javafx.stage.Stage"
15+
xmlns="http://javafx.com/javafx/15.0.1" xmlns:fx="http://javafx.com/fxml/1">
1516

1617
<scene>
1718
<Scene>
@@ -32,14 +33,16 @@
3233
<MenuItem fx:id="helpMenuItem" mnemonicParsing="false" onAction="#handleHelp" text="Help" />
3334
</Menu>
3435
</MenuBar>
35-
36-
<StackPane fx:id="commandBoxPlaceholder" maxHeight="25.0" prefHeight="25.0" styleClass="pane-with-border" VBox.vgrow="NEVER">
36+
37+
<StackPane fx:id="commandBoxPlaceholder" maxHeight="25.0" prefHeight="25.0" styleClass="pane-with-border"
38+
VBox.vgrow="NEVER">
3739
<padding>
3840
<Insets bottom="5" left="10" right="10" top="5" />
3941
</padding>
4042
</StackPane>
41-
42-
<StackPane fx:id="resultDisplayPlaceholder" minHeight="90.0" styleClass="pane-with-border" VBox.vgrow="ALWAYS">
43+
44+
<StackPane fx:id="resultDisplayPlaceholder" minHeight="90.0" styleClass="pane-with-border"
45+
VBox.vgrow="ALWAYS">
4346
<padding>
4447
<Insets bottom="5" left="10" right="10" top="5" />
4548
</padding>
@@ -68,7 +71,7 @@
6871
<center>
6972
<StackPane fx:id="meetingDashboardPlaceholder" BorderPane.alignment="CENTER" />
7073
</center>
71-
74+
7275
</BorderPane>
7376
</Scene>
7477
</scene>

src/test/java/seedu/address/logic/commands/meetings/DeleteMeetingCommandTest.java

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,19 @@
55
import static seedu.address.logic.commands.meetings.MeetingCommandTestUtil.showMeetingAtIndex;
66
import static seedu.address.logic.commands.persons.PersonCommandTestUtil.assertCommandFailure;
77
import static seedu.address.logic.commands.persons.PersonCommandTestUtil.assertCommandSuccess;
8-
import static seedu.address.logic.commands.persons.PersonCommandTestUtil.showPersonAtIndex;
98
import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST;
109
import static seedu.address.testutil.TypicalIndexes.INDEX_SECOND;
1110
import static seedu.address.testutil.TypicalMeetings.getTypicalMeetingBook;
12-
import static seedu.address.testutil.TypicalPersons.getTypicalAddressBook;
13-
1411

1512
import org.junit.jupiter.api.Test;
1613

1714
import seedu.address.commons.core.Messages;
1815
import seedu.address.commons.core.index.Index;
19-
import seedu.address.logic.commands.persons.DeletePersonCommand;
2016
import seedu.address.model.Model;
2117
import seedu.address.model.ModelManager;
2218
import seedu.address.model.UserPrefs;
2319
import seedu.address.model.meeting.Meeting;
2420
import seedu.address.model.person.AddressBook;
25-
import seedu.address.model.person.Person;
2621

2722
/**
2823
* Contains integration tests (interaction with the Model) and unit tests for
@@ -90,4 +85,27 @@ public void execute_invalidIndexFilteredList_throwsCommandException() {
9085
assertCommandFailure(deleteMeetingCommand, model, Messages.MESSAGE_INVALID_MEETING_DISPLAYED_INDEX);
9186
}
9287

88+
@Test
89+
public void equals() {
90+
DeleteMeetingCommand deleteFirstCommand = new DeleteMeetingCommand(INDEX_FIRST);
91+
DeleteMeetingCommand deleteSecondCommand = new DeleteMeetingCommand(INDEX_SECOND);
92+
93+
// same object -> returns true
94+
assertTrue(deleteFirstCommand.equals(deleteFirstCommand));
95+
96+
// same values -> returns true
97+
DeleteMeetingCommand deleteFirstCommandCopy = new DeleteMeetingCommand(INDEX_FIRST);
98+
assertTrue(deleteFirstCommand.equals(deleteFirstCommandCopy));
99+
100+
// different types -> returns false
101+
assertFalse(deleteFirstCommand.equals(1));
102+
103+
// null -> returns false
104+
assertFalse(deleteFirstCommand.equals(null));
105+
106+
// different person -> returns false
107+
assertFalse(deleteFirstCommand.equals(deleteSecondCommand));
108+
}
109+
110+
93111
}

src/test/java/seedu/address/logic/commands/meetings/MeetingCommandTestUtil.java

Lines changed: 12 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
package seedu.address.logic.commands.meetings;
22

3-
import seedu.address.commons.core.index.Index;
4-
import seedu.address.model.Model;
5-
import seedu.address.model.meeting.Meeting;
6-
import seedu.address.model.meeting.NameContainsKeywordsPredicate;
7-
8-
import java.util.Arrays;
9-
103
import static org.junit.jupiter.api.Assertions.assertEquals;
114
import static org.junit.jupiter.api.Assertions.assertTrue;
125
import static seedu.address.logic.parser.CliSyntax.PREFIX_DESCRIPTION;
@@ -16,6 +9,14 @@
169
import static seedu.address.logic.parser.CliSyntax.PREFIX_PRIORITY;
1710
import static seedu.address.logic.parser.CliSyntax.PREFIX_START_TIME;
1811

12+
import java.util.Arrays;
13+
14+
import seedu.address.commons.core.index.Index;
15+
import seedu.address.model.Model;
16+
import seedu.address.model.meeting.Meeting;
17+
import seedu.address.model.meeting.NameContainsKeywordsPredicate;
18+
19+
1920

2021
/**
2122
* Contains helper methods for testing commands.
@@ -56,69 +57,10 @@ public class MeetingCommandTestUtil {
5657
public static final String INVALID_PRIORITY_DESC = " " + PREFIX_PRIORITY + "-2";
5758
public static final String INVALID_TAG_DESC = " " + PREFIX_GROUP + "hubby*"; // '*' not allowed in tags
5859

59-
60-
//
61-
// public static final String PREAMBLE_WHITESPACE = "\t \r \n";
62-
// public static final String PREAMBLE_NON_EMPTY = "NonEmptyPreamble";
63-
//
64-
// public static final EditPersonCommand.EditPersonDescriptor DESC_AMY;
65-
// public static final EditPersonCommand.EditPersonDescriptor DESC_BOB;
66-
//
67-
// static {
68-
// DESC_AMY = new EditPersonDescriptorBuilder().withName(VALID_NAME_AMY)
69-
// .withPhone(VALID_PHONE_AMY).withEmail(VALID_EMAIL_AMY).withAddress(VALID_ADDRESS_AMY)
70-
// .withTags(VALID_TAG_FRIEND).build();
71-
// DESC_BOB = new EditPersonDescriptorBuilder().withName(VALID_NAME_BOB)
72-
// .withPhone(VALID_PHONE_BOB).withEmail(VALID_EMAIL_BOB).withAddress(VALID_ADDRESS_BOB)
73-
// .withTags(VALID_TAG_HUSBAND, VALID_TAG_FRIEND).build();
74-
// }
75-
76-
// /**
77-
// * Executes the given {@code command}, confirms that <br>
78-
// * - the returned {@link CommandResult} matches {@code expectedCommandResult} <br>
79-
// * - the {@code actualModel} matches {@code expectedModel}
80-
// */
81-
// public static void assertCommandSuccess(Command command, Model actualModel, CommandResult expectedCommandResult,
82-
// Model expectedModel) {
83-
// try {
84-
// CommandResult result = command.execute(actualModel);
85-
// assertEquals(expectedCommandResult, result);
86-
// assertEquals(expectedModel, actualModel);
87-
// } catch (CommandException ce) {
88-
// throw new AssertionError("Execution of command should not fail.", ce);
89-
// }
90-
// }
91-
//
92-
// /**
93-
// * Convenience wrapper to {@link #assertCommandSuccess(Command, Model, CommandResult, Model)}
94-
// * that takes a string {@code expectedMessage}.
95-
// */
96-
// public static void assertCommandSuccess(Command command, Model actualModel, String expectedMessage,
97-
// Model expectedModel) {
98-
// CommandResult expectedCommandResult = new CommandResult(expectedMessage);
99-
// assertCommandSuccess(command, actualModel, expectedCommandResult, expectedModel);
100-
// }
101-
//
102-
// /**
103-
// * Executes the given {@code command}, confirms that <br>
104-
// * - a {@code CommandException} is thrown <br>
105-
// * - the CommandException message matches {@code expectedMessage} <br>
106-
// * - the address book, filtered person list and selected person in {@code actualModel} remain unchanged
107-
// */
108-
// public static void assertCommandFailure(Command command, Model actualModel, String expectedMessage) {
109-
// // we are unable to defensively copy the model for comparison later, so we can
110-
// // only do so by copying its components.
111-
// AddressBook expectedAddressBook = new AddressBook(actualModel.getAddressBook());
112-
// List<Person> expectedFilteredList = new ArrayList<>(actualModel.getFilteredPersonList());
113-
//
114-
// assertThrows(CommandException.class, expectedMessage, () -> command.execute(actualModel));
115-
// assertEquals(expectedAddressBook, actualModel.getAddressBook());
116-
// assertEquals(expectedFilteredList, actualModel.getFilteredPersonList());
117-
// }
118-
/**
119-
* Updates {@code model}'s filtered meetings list to show only the meeting at the given {@code targetIndex} in the
120-
* {@code model}'s meeting book. It is mandatory for this case meeting names are unique with respect to their first
121-
* word in their name.
60+
/**
61+
* Updates {@code model}'s filtered meetings list to show only the meeting at the given {@code targetIndex} in the
62+
* {@code model}'s meeting book. It is mandatory for this case meeting names are unique with respect to their first
63+
* word in their name.
12264
*/
12365
public static void showMeetingAtIndex(Model model, Index targetIndex) {
12466
assertTrue(targetIndex.getZeroBased() < model.getFilteredMeetingList().size());

src/test/java/seedu/address/logic/parser/meetings/DeleteMeetingCommandParserTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import org.junit.jupiter.api.Test;
99

1010
import seedu.address.logic.commands.meetings.DeleteMeetingCommand;
11-
import seedu.address.logic.commands.persons.DeletePersonCommand;
1211

1312
/**
1413
* As we are only doing white-box testing, our test cases do not cover path variations

src/test/java/seedu/address/testutil/TypicalMeetings.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
import seedu.address.model.meeting.Meeting;
2121
import seedu.address.model.meeting.MeetingBook;
22-
import seedu.address.model.person.AddressBook;
23-
import seedu.address.model.person.Person;
2422

2523
/**
2624
* A utility class containing a list of {@code Person} objects to be used in tests.

0 commit comments

Comments
 (0)