Added exception raising and catching in test classes