diff --git a/doc/DeveloperGuide.md b/doc/DeveloperGuide.md index c82c3afb9..e2ed428c6 100644 --- a/doc/DeveloperGuide.md +++ b/doc/DeveloperGuide.md @@ -12,27 +12,40 @@ #### Prerequisites -1. **JDK 8** or later -2. **Eclipse** IDE -3. **e(fx)clipse** plugin for Eclipse (Do the steps 2 onwards given in - [this page](http://www.eclipse.org/efxclipse/install.html#for-the-ambitious)) - - -#### Importing the project into Eclipse - -0. Fork this repo, and clone the fork to your computer -1. Open Eclipse (Note: Ensure you have installed the **e(fx)clipse plugin** as given in the prerequisites above) -2. Click `File` > `Import` -3. Click `General` > `Existing Projects into Workspace` > `Next` -4. Click `Browse`, then locate the project's directory -5. Click `Finish` +* JDK 8 or later +* IntelliJ IDE + +#### Importing the project into IntelliJ + +1. Open IntelliJ (if you are not in the welcome screen, click `File` > `Close Project` to close the existing project dialog first) +2. Set up the correct JDK version + 1. Click `Configure` > `Project Defaults` > `Project Structure` + 2. If JDK 8 is listed in the drop down, select it. If it is not, click `New...` and select the directory where you installed JDK 8. + 3. Click `OK`. +3. Click `Import Project` +4. Locate the project directory and click `OK` +5. Select `Create project from existing sources` and click `Next` +6. Rename the project if you want. Click `Next` +7. Ensure that your `\src` and `\test\java` folder is checked. Keep clicking `Next` +8. Click `Finish` +9. Add JUnit 4 to classpath + 1. Open any test file in `\test\java` and place your cursor over any `@Test` highlighted in red + 2. Press ALT+ENTER and select `Add 'JUnit4' to classpath` + 3. Select `Use 'JUnit4' from IntelliJ IDEA distribution` and click `OK` +10. Run all the tests (right-click the `test` folder, and click `Run 'All Tests'`) +11. Observe how some tests fail. That is because they try to access the test data from the wrong directory (the working directory is expected to be the root directory, but IntelliJ runs the test with `test\` as the working directory by default). To fix this issue: + 1. Go to `Run` -> `Edit Configurations...` + 2. On the list at the left, ensure that `All in test` is selected + 3. Under `Configuration`, change the `Working directory` to the `addressbook-level3` folder + 4. Click `OK` +12. Run the tests again to ensure they all pass now. ## Design ## Testing -* In Eclipse, right-click on the `test/java` folder and choose `Run as` > `JUnit Test` +* In IntelliJ, right-click on the `test` folder and choose `Run 'All Tests'` ## Appendix A : User Stories