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

A test method should be able require redeployment before or after it has been executed.

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Unresolved
    • Optional
    • None
    • None
    • None
    • None

    Description

      Why would a test method need this?

      • before: because it wants a clean database (or clean cache or clean cached history or clean session or clean ...)
      • after: because it seriously disrupts the CDI container or enviroment. For example: it takes the configuration and changes it, it deletes some database files, ...

      Note that the deployment should be CPU efficient:
      If the container just deployed and this is the first test and before=true, then it shouldn't redeploy.
      If it is the last test for a deployment and after=true, then it shouldn't redeploy.

      Some hints from aslak on where to implement this:
      create it as a extension
      implement LoadableExtension
      create some @Observer(precendece = -1) of EventContext<Before>
      then @Inject Instance<Container> and @Inject Instance<Deployment>
      read the before.getTestMethod().annotations..
      if redeploy is .. container.get().getDeployableContainer().undeploy(deployment.getTestArchive())

      Attachments

        Activity

          People

            Unassigned Unassigned
            gdesmet@redhat.com Geoffrey De Smet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: