Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-941

Make Exception.class default for value attribute on @ShouldThrowException

    XMLWordPrintable

Details

    Description

      The annotation @ShouldThrowException is expressive enough to be understood as meaning a generic Exception will be thrown (during deployment) unless a more specific exception is specified.

      Therefore, a default should be specified for the value attribute such that:

      @ShouldThrowException == @ShouldThrowException(Exception.class)

      Here's the resulting annotation definition:

      @Documented
      @Retention(RUNTIME)
      @Target(ElementType.METHOD)
      public @interface ShouldThrowException {
         Class<? extends Exception> value() default Exception.class;
      }
      

      (Alternatively, the default can be Throwable.class, though the value of least surprise is likely Exception.class).

      Attachments

        Activity

          People

            Unassigned Unassigned
            dan.j.allen Dan Allen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: