- scala 2.11.12
- sbt 1.2.8
- Download the project
git clone https://github.com/DanyangLinda/BakeryChallengeScala.git
- Run tests
cd BakeryChallengeScala
sbt test
- Create an input file. Take "BakeryChallengeScala/input.txt" as an exmaple, and run the program
sbt "run <path to the input file>"
- The result are written in output.txt file.
If any error occurs, program with exit properly and error messages will be printed with logger.
- Error message for invalid input format
Invalid input line items. The expected format is <quantity: Int> <product_code: String>
- Error message for invalid product code
Item code <item code> doesn't exist. Stop processing the order.
- Error message for invalid product quantity
The quantity (<item quantity>) of item <item code> is not valid. Stop processing the order.
- For system errors, stack trace will be printed