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.

    Details

    • Type: Feature Request
    • Status: Open (View Workflow)
    • Priority: Optional
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      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())

        Gliffy Diagrams

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              ge0ffrey Geoffrey De Smet
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Development