The lab text says:
Create your own exceptions and test them. Add to Github
Feel free to talk to the Bot. It has a very limited amount of phrases. If you give it a phrase that it doesn't
understand, it recites poetry to you. Check out the Bot.java
file in the chat
method for the list of phrases that it understands.
To exit, press the EOF
character on your keyboard. On macOS/Linux it is CTRL-D. On Windows, it is CTRL-Z followed by
the Enter key.
Note: IDE terminals, such as IntelliJ IDEA and Eclipse, do not parse END-OF_FILE (EOF
) properly, or they just screw up for
no apparent reason. Please run via cmd (Windows) or terminal (macOS/Linux).
-
Get the JAR file from the Releases section.
-
Run it:
java -jar Bot-1.0.jar
Be sure you have Maven installed to follow these instructions.
-
Clone this repo.
-
To create the JAR file, type:
mvn package
-
Then run it by typing:
java -jar target/Bot-1.0.jar
The lab is about exceptions. Conversion with the Bot is as follows:
- Get input from user
- Parse input
- Throw an exception if the user enters any naughty words
- Given the parsed input, allow the Bot to chat with the user
- Throw an exception if the input is not parsed
The JUnit test cases cover these exceptions.