If it is not explicitly told in following recipe, setting up services are described for Ubuntu 20.04 server, but applications are described for Xubuntu 20.04 workstation. If you use different Ubuntu version or Linux distribution, settings as well as content, names and places of configuration files may be different!
Got it.

9. Exceptions and Assertions

  1. Review presentation Exceptions and assertions

    Practical exercise

  2. Investigate jtm.activity08 package
  3. Create class SimpleCalcException as a subclass of Exception
  4. Implement following constructors for this class:
    1. SimpleCalcException(String string)
    2. SimpleCalcException(String string, Throwable cause)
  5. Implement basic mathematical operations for SimpleCalc class with int numbers in range of [-10..+10] (including) to pass unit tests

    error Notes

    1. Input range is checked using assertions (so if they are disabled, inputs can be any int)
    2. Outputs are always checked and exception is thrown if it is outside allowed range
    3. Only SimpleCalcExceptions may be thrown. AssertionErrors have to be caught and wrapped into SimpleCalcExceptions

Additional information


Created by Valdis Vītoliņš on 2020-05-28 10:55
Last modified by Valdis Vītoliņš on 2021-04-13 14:31
Xwiki Powered
Creative Commons Attribution 3.0 Unported License