use expected=.class instead of try-catch