Informatics 215: Homework1

Spring Quarter 2016

JPacman, Java, Eclipse, JUnit

Instructor: Professor James A. Jones

Course Web Site: Informatics 215

Discussion Board: https://eee.uci.edu/toolbox/messageboard/m18038/f58059/

Due Date: Thursday, April 7, midnight

Submission Site: https://eee.uci.edu/toolbox/dropbox/index.php?op=openfolder&folder=454940


For questions and discussion, please post them to the EEE MessageBoard rather than emailing me or the Reader. We will monitor those and answer some questions, however everyone is encouraged to help answer each others’ questions. Please offer helpful hints to each other without giving each other the answers. We are all here to learn, so advice that helps each other learn is welcomed.


Install JPacman

  1. Install the latest version (Mars) of Eclipse from http://www.eclipse.org/downloads/ . Either: get the Installer and choose Java, or get the Eclipse IDE for Java Developers package.

  2. Obtain JPacman from https://github.com/SERG-Delft/jpacman-framework. To do this, clone the repository using either command-line git or the Eclipse Git Plugin (built into Eclipse).

  3. You can choose to download the latest snapshot.

  4. Import jpacman-framework into Eclipse.

  5. -Make sure that you are in the Java Perspective (not the Git Perspective)

  6. -File → Import → Git → Project From Git

  7. -Choose “Local” if you have already cloned the git repo (or “URI” if you haven’t and then specify the URI copied from the Github page... should end in “.git”)

  8. -Make sure that you import as a “general project”

  9. Let Eclipse recognize it as a maven project by selecting
        – Right-mouse click on the main project entry → Configure → Convert to Maven Project.

  10. To see JPacman working, execute nl.tudelft.jpacman.Launcher



Running the Test Suite

  1. To see the JUnit test suite working within Eclipse, right click in the project, and run it as JUnit Test.

  2. To familiarize yourself with the way JPacman is tested, have a look at some of the test classes, and figure out what they are testing.


Using Maven for JPacman

  1. Run the tests via maven (Eclipse: Run As, Maven Test).

  2. Create all project information using maven site. (Eclipse: Run As, Maven build...).

  3. Put the jpacman jar into your maven repository, by means of a maven install (Eclipse: Run As, Maven Install).



Write Test Cases Using JUnit

  1. Write new test cases to realize the scenarios listed in docs/scenarios.md. Write one JUnit-test-case method per scenario.

  2. These scenarios are written in the “behavior-driven development” style, but the details of this style are not important for completing this task.

  3. For help writing and understanding JUnit, refer to this article: http://www.vogella.com/tutorials/JUnit/article.html

  4. You will need to review the JPacman code to build an understanding of how it works and how to test it.

  5. For hints on how you might write these test cases, you can refer to the JUnit test cases in the src/test directory.


Submission Procedure

Zip your new test file(s) into a file named for your UCInetID.zip (e.g., for me, it would be jajones.zip). Only include these files so that we can easily find them (and anything that we’ll need to check them)

Upload to the INF215-Sp16 HW1 EEE dropbox by Thursday, April 7 (just before midnight).