Uploaded image for project: 'WildFly Arquillian'
  1. WildFly Arquillian
  2. WFARQ-36

Add support for the @ShouldThrowException(testable=true) attribute

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • None

      As part of ARQ-2143 the @ShouldThrowException annotation was given a testable attribute. This attribute needs to be supported at the container level.

      From https://github.com/wildfly/wildfly-arquillian/issues/116

      I am currently struggling to try to run microprofile TCKs tests on wildfly.

      Some of the tests are using @ShouldThrowException(value = DefinitionException.class, testable = true) where DefinitionException is javax.enterprise.inject.spi.DefinitionException.

      While tests run well on a weld container, I cannot make them run with a wildfly container.
      I suspect:

      the expection to be wrapped but not unwrapped to check against the one defined inside ShouldThrowException
      the failing undeployment (because the deployment failed as expected) to also cause troubles.
      Enclosed is a simple reproducer case (I also put it on github: https://github.com/McFoggy/wildfly-failing-deployment):

      mvn clean test -Pweld works as expected
      mvn clean test -Pwildfly fails for the test expecting the deployment failure

      The attached archive is the project from the github repo that can reproduce the issue.

      To be clear - I made the API change in Arquillian that allows testable archives to throw exceptions. Containers probably still need to do something to support this feature.

      The change, as noted by @McFoggy is that @ShouldThrowException now has a testable attribute, false by default, that is meant to support enhancing the archive.

              Unassigned Unassigned
              jperkins-rhn James Perkins
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: