Skip to content

Commit

Permalink
checkstule
Browse files Browse the repository at this point in the history
  • Loading branch information
ndhuu committed Apr 14, 2019
1 parent 0a413d8 commit 9496501
Show file tree
Hide file tree
Showing 56 changed files with 152 additions and 108 deletions.
20 changes: 14 additions & 6 deletions _reposense/config.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
{
"authors":
[
"authors": [
{
"githubId": "ndhuu",
"displayName": "NGU...HUU",
"authorNames": ["ndhuu"]
"authorNames": [
"ndhuu"
]
},
{
"githubId": "articstranger",
"displayName": "WON...EMY",
"authorNames": ["articstranger"]
"authorNames": [
"articstranger"
]
},
{
"githubId": "swalahlah",
"displayName": "LIO...HUI",
"authorNames": ["swalahlah"]
"authorNames": [
"swalahlah"
]
},
{
"githubId": "quinnzzzzz",
"displayName": "ZHA... RU",
"authorNames": ["quinnzzzzz", "Quinn Zhao"]
"authorNames": [
"quinnzzzzz",
"Quinn Zhao"
]
}
]
}
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/commons/core/GuiSettings.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package seedu.address.commons.core;

import java.awt.Point;
import java.awt.*;
import java.io.Serializable;
import java.util.Objects;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ public boolean equals(Object other) {

/**
* update the previous assigned beneficiary in the following procedure:
* get the beneficiary
* add the project record in that beneficiary
* get the beneficiary
* add the project record in that beneficiary
*
* @param model
* @return beneficiary
*/
Expand All @@ -119,9 +120,10 @@ private Beneficiary updateBeneficiary(Model model) {

/**
* update the previous assigned beneficiary in the following procedure:
* get the previous beneficiary.
* delete the project record in that beneficiary.
* @param model
* get the previous beneficiary.
* delete the project record in that beneficiary.
*
* @param model
*/
private void updatePreBeneficiary(Model model) {
if (isValidPreAssignedBeneficiary(model)) {
Expand All @@ -139,6 +141,6 @@ private void updatePreBeneficiary(Model model) {
private boolean isValidPreAssignedBeneficiary(Model model) {
return projectToAssign.getBeneficiaryAssigned().toString() != "nil"
&& model.getFilteredBeneficiaryList().filtered(
x -> x.getName().equals(projectToAssign.getBeneficiaryAssigned())).size() != 0;
x -> x.getName().equals(projectToAssign.getBeneficiaryAssigned())).size() != 0;
}
}
3 changes: 1 addition & 2 deletions src/main/java/seedu/address/model/AddressBook.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ public class AddressBook implements ReadOnlyAddressBook {
*
* Note that non-static init blocks are not recommended to use. There are other ways to avoid duplication
* among constructors.
*/
{
*/ {
volunteers = new UniqueVolunteerList();
projects = new UniqueProjectList();
beneficiaries = new UniqueBeneficiaryList();
Expand Down
1 change: 1 addition & 0 deletions src/main/java/seedu/address/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ public void handleHelp() {
}

//@@author ndhuu

/**
* open summary table window.
*/
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/guitests/GuiRobot.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
import java.util.function.BooleanSupplier;

import org.testfx.api.FxRobot;
import javafx.stage.Stage;

import guitests.guihandles.exceptions.StageNotFoundException;
import javafx.stage.Stage;

/**
* Robot used to simulate user actions on the GUI.
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/seedu/address/AppParametersTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import java.util.List;
import java.util.Map;

import javafx.application.Application;

import org.junit.Test;

import javafx.application.Application;

public class AppParametersTest {

private final ParametersStub parametersStub = new ParametersStub();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static org.junit.Assert.assertEquals;

import org.junit.Test;

import javafx.beans.InvalidationListener;
import javafx.beans.property.SimpleObjectProperty;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@

import java.util.ArrayList;

import javafx.util.Pair;
import org.junit.Test;

import javafx.util.Pair;
import seedu.address.logic.CommandHistory;
import seedu.address.model.MapObject;
import seedu.address.model.Model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import org.junit.Before;
import org.junit.Test;

import seedu.address.logic.CommandHistory;
import seedu.address.model.Model;
import seedu.address.model.ModelManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import org.junit.Before;
import org.junit.Test;

import seedu.address.logic.CommandHistory;
import seedu.address.model.Model;
import seedu.address.model.ModelManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import org.junit.Test;
import org.junit.rules.ExpectedException;

import javafx.beans.property.ReadOnlyProperty;
import javafx.collections.ObservableList;
import seedu.address.commons.core.GuiSettings;
import seedu.address.logic.CommandHistory;
import seedu.address.logic.commands.CommandResult;
Expand All @@ -31,16 +33,13 @@
import seedu.address.model.project.exceptions.ProjectNotFoundException;
import seedu.address.model.volunteer.Volunteer;
import seedu.address.testutil.beneficiary.BeneficiaryBuilder;
import javafx.beans.property.ReadOnlyProperty;
import javafx.collections.ObservableList;

public class AddBeneficiaryCommandTest {

private static final CommandHistory EMPTY_COMMAND_HISTORY = new CommandHistory();

@Rule
public ExpectedException thrown = ExpectedException.none();

private static final CommandHistory EMPTY_COMMAND_HISTORY = new CommandHistory();

private CommandHistory commandHistory = new CommandHistory();

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import static seedu.address.logic.parser.CliSyntaxBeneficiary.PREFIX_ADDRESS;
import static seedu.address.logic.parser.CliSyntaxBeneficiary.PREFIX_EMAIL;
import static seedu.address.logic.parser.CliSyntaxBeneficiary.PREFIX_NAME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess;
import static seedu.address.logic.commands.beneficiary.BeneficiaryCommandTestUtil.showBeneficiaryAtIndex;
Expand All @@ -19,6 +16,9 @@
import static seedu.address.testutil.beneficiary.BeneficiariesSyncProjects.getAddressBookForBeneficiarySyncTest;
import static seedu.address.testutil.beneficiary.BeneficiariesSyncProjects.getProjectA2B;
import static seedu.address.testutil.beneficiary.TypicalBeneficiaries.getTypicalAddressBook;

import org.junit.Test;

import seedu.address.commons.core.Messages;
import seedu.address.commons.core.index.Index;
import seedu.address.logic.CommandHistory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

import static seedu.address.logic.commands.beneficiary.BeneficiaryCommandTestUtil.DESC_ANIMAL_SHELTER;
import static seedu.address.logic.commands.beneficiary.BeneficiaryCommandTestUtil.DESC_BABES;
import static seedu.address.logic.commands.beneficiary.BeneficiaryCommandTestUtil.VALID_NAME_BABES;
Expand All @@ -26,6 +23,9 @@
import static seedu.address.testutil.beneficiary.BeneficiariesSyncProjects.getAddressBookForBeneficiarySyncTest;
import static seedu.address.testutil.beneficiary.BeneficiariesSyncProjects.getProjectA2B;
import static seedu.address.testutil.beneficiary.TypicalBeneficiaries.getTypicalAddressBook;

import org.junit.Test;

import seedu.address.commons.core.Messages;
import seedu.address.commons.core.index.Index;
import seedu.address.logic.CommandHistory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

import static seedu.address.logic.commands.beneficiary.BeneficiaryCommandTestUtil.DESC_ANIMAL_SHELTER;
import static seedu.address.logic.commands.beneficiary.BeneficiaryCommandTestUtil.DESC_BABES;
import static seedu.address.logic.commands.beneficiary.BeneficiaryCommandTestUtil.VALID_ADDRESS_BABES;
import static seedu.address.logic.commands.beneficiary.BeneficiaryCommandTestUtil.VALID_EMAIL_BABES;
import static seedu.address.logic.commands.beneficiary.BeneficiaryCommandTestUtil.VALID_NAME_BABES;
import static seedu.address.logic.commands.beneficiary.BeneficiaryCommandTestUtil.VALID_PHONE_BABES;
import static seedu.address.logic.commands.beneficiary.EditBeneficiaryCommand.EditBeneficiaryDescriptor;

import org.junit.Test;

import seedu.address.testutil.beneficiary.EditBeneficiaryDescriptorBuilder;

public class EditBeneficiaryDescriptorTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import javafx.beans.property.ReadOnlyProperty;
import javafx.collections.ObservableList;
import seedu.address.commons.core.GuiSettings;
import seedu.address.logic.CommandHistory;
import seedu.address.logic.commands.CommandResult;
Expand All @@ -26,8 +29,6 @@
import seedu.address.model.beneficiary.Beneficiary;
import seedu.address.model.project.Project;
import seedu.address.model.volunteer.Volunteer;
import javafx.beans.property.ReadOnlyProperty;
import javafx.collections.ObservableList;

public class AddProjectCommandTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,27 @@

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess;
import static seedu.address.logic.commands.project.ProjectCommandTestUtil.showBeneficiaryAtIndex;
import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST;
import static seedu.address.testutil.TypicalIndexes.INDEX_SECOND;
import static seedu.address.testutil.project.TypicalProjects.PROJECT1;
import static seedu.address.testutil.project.TypicalProjects.PROJECT2;
import static seedu.address.testutil.project.TypicalProjects.PROJECT3;
import static seedu.address.testutil.project.TypicalProjects.getTypicalAddressBook;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import seedu.address.commons.core.Messages;
import seedu.address.commons.core.index.Index;
import seedu.address.logic.CommandHistory;
import seedu.address.model.Model;
import seedu.address.model.ModelManager;
import seedu.address.model.UserPrefs;
import seedu.address.model.project.Project;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess;
import static seedu.address.logic.commands.project.ProjectCommandTestUtil.showBeneficiaryAtIndex;
import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST;
import static seedu.address.testutil.TypicalIndexes.INDEX_SECOND;
import static seedu.address.testutil.project.TypicalProjects.PROJECT1;
import static seedu.address.testutil.project.TypicalProjects.PROJECT2;
import static seedu.address.testutil.project.TypicalProjects.PROJECT3;
import static seedu.address.testutil.project.TypicalProjects.getTypicalAddressBook;

public class AssignBeneficiaryCommandTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

import static junit.framework.TestCase.assertTrue;
import static org.junit.Assert.assertFalse;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess;
import static seedu.address.testutil.project.TypicalProjects.PROJECT1;
import static seedu.address.testutil.project.TypicalProjects.PROJECT2;
import static seedu.address.testutil.project.TypicalProjects.PROJECT3;
import static seedu.address.testutil.project.TypicalProjects.getTypicalAddressBook;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import seedu.address.commons.core.Messages;
import seedu.address.logic.CommandHistory;
import seedu.address.model.Model;
import seedu.address.model.ModelManager;
import seedu.address.model.UserPrefs;
import seedu.address.model.project.Project;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess;
import static seedu.address.testutil.project.TypicalProjects.PROJECT1;
import static seedu.address.testutil.project.TypicalProjects.PROJECT2;
import static seedu.address.testutil.project.TypicalProjects.PROJECT3;
import static seedu.address.testutil.project.TypicalProjects.getTypicalAddressBook;



public class AssignVolunteerCommandTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@

import static junit.framework.TestCase.assertTrue;
import static org.junit.Assert.assertFalse;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess;
import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST;
import static seedu.address.testutil.TypicalIndexes.INDEX_SECOND;
import static seedu.address.testutil.project.TypicalProjects.getTypicalAddressBook;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import seedu.address.commons.core.Messages;
import seedu.address.commons.core.index.Index;
import seedu.address.logic.CommandHistory;
import seedu.address.model.Model;
import seedu.address.model.ModelManager;
import seedu.address.model.UserPrefs;
import seedu.address.model.project.ProjectTitle;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess;
import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST;
import static seedu.address.testutil.TypicalIndexes.INDEX_SECOND;
import static seedu.address.testutil.project.TypicalProjects.getTypicalAddressBook;

public class CompleteCommandTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess;
import static seedu.address.logic.commands.project.ProjectCommandTestUtil.showProjectAtIndex;
import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST;
import static seedu.address.testutil.TypicalIndexes.INDEX_SECOND;
import static seedu.address.testutil.project.TypicalProjects.getTypicalAddressBook;

import org.junit.Test;

import seedu.address.commons.core.Messages;
import seedu.address.commons.core.index.Index;
import seedu.address.logic.CommandHistory;
Expand All @@ -15,12 +22,6 @@
import seedu.address.model.ModelManager;
import seedu.address.model.UserPrefs;
import seedu.address.model.project.Project;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess;
import static seedu.address.logic.commands.project.ProjectCommandTestUtil.showProjectAtIndex;
import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST;
import static seedu.address.testutil.TypicalIndexes.INDEX_SECOND;
import static seedu.address.testutil.project.TypicalProjects.getTypicalAddressBook;

/**
* Contains integration tests (interaction with the Model, UndoCommand and RedoCommand) and unit tests for
Expand Down
Loading

0 comments on commit 9496501

Please sign in to comment.