- Copy your repository url to the clipboard.
- Open intellij and select checkout from version control.
- Select the git option and paste the url.
- Configure your project directory and name.
Open the terminal from intellij and run the following command.
./setup.sh
Your project should have two folders with the following content.
.
├── src
│ └── Hello.java
└── tests
├── HelloTest.java
└── TestRunner.java
Complete the hello method in src/Hello.java
so that it prints out a message multiple times.
The message and count are parameters to the method.
The main method invokes the hello method with given parameters. When you compile and run the Hello class, the main method executes. The following shows an example method call with its expected output.
hello("some message", 2);
some message
some message
Run the HelloTest class in tests/HelloTest.java
to make sure your code is correct.
You can also run TestRunner to estimate the grade for your project.
Remember to push you code to GitHub!
git add .
git commit -m "your commit message"
git push
The tests may update when you push or pull your project. After pushing your code run the following command.
git status
If you see that tests
has been modified, then rerun your tests to make sure they all pass, and then update your project again.
The tests directory actually references another repository. When you cloned the repo the directory was actually empty.
The setup script downloaded the appropriate files and installed hooks to keep them up to date. Whenever the project is updated with git pull
or git push
the tests directory will also update.
Without the setup script you could do the following:
# after cloning the repo
git submodule init
git submodule update --remote
# checking for updates
git submodule update --remote
git status
# if status shows modified tests
git commit -am "updating tests"