Uploaded image for project: 'ShrinkWrap'
  1. ShrinkWrap
  2. SHRINKWRAP-150

add resource from Java package

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Minor Minor
    • 1.0.0-alpha-8
    • 1.0.0-alpha-7
    • api
    • None
    • Documentation (Ref Guide, User Guide, etc.)
    • Low

      Particularly in testing environments, resources are often organized under the same package as the class. However, when referring to a "qualified resource" (a resource located in a package), the package delimiter must be changed from the dot (.) to a forward slash . ShrinkWrap does not currently provide a convenient way to include such a resource, leaving the burden on the developer to do the conversion. Thus, we are starting to see cases like the following appear quite often in Arquillian tests:

      .addResource(FooTest.class.getPackage().getName().replaceAll("
      .", "/") + "/bar.xml");

      I would like to propose the following additions to ResourceContainer and ManifestContainer, respectively, to clean up this scenario:

      ResourceContainer#addResource(Package, String)
      ResourceContainer#addResource(Package, String, ArchivePath)

      ManifestContainer#addManifestResource(Package, String)
      ManifestContainer#addManifestResource(Package, String, ArchivePath)

      Please add any other parallel methods, as needed.

              aslak@redhat.com Aslak Knutsen
              dan.j.allen Dan Allen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: