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

Should validate that a TestClass does not contain multiple same named Archives with the same Target

    XMLWordPrintable

    Details

      Description

      The backing container implementations can not handle a automatic redeploy of a same named archive and will in some cases silently ignore the call. This is a programming error that cause confusion.

      If redeploy support is requested as a feature, a proper API/SPI should be put in place.

      Not Allowed
      @Deployment(name = "X")
         return ShrinkWrap.create(JavaArchive.class, "test.jar")
      
      @Deployment(name = "Y")
         return ShrinkWrap.create(JavaArchive.class, "test.jar")
      

      This will cause "java.lang.IllegalArgumentException: Can not add multiple org.jboss.shrinkwrap.api.Archive archive deployments with the same archive name test.jar that target the same target DEFAULT"

      Allowed
      @Deployment(name = "X") @TargetsContainer("X")
         return ShrinkWrap.create(JavaArchive.class, "test.jar")
      
      @Deployment(name = "Y") @TargetsContainer("Y")
         return ShrinkWrap.create(JavaArchive.class, "test.jar")
      

        Attachments

          Activity

            People

            Assignee:
            aslak Aslak Knutsen
            Reporter:
            aslak Aslak Knutsen
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: