1 Reply Latest reply on Dec 17, 2009 11:14 AM by alesj

    Use of Shrinkwrap in place of AssembledDirectories

    johnbailey

      In VFS2 there was an AssembedDirectory, which could be used to create a directory structure programmatically.  In VFS3, we added in an AssembledFileSystem, which also allows the allows programmatic creation of directories in the VFS.  From what the tests are showing the main usages of the AssembledDirectory are to create virtual archive structures.

       

      Ex.

       

      {code}

             AssembledDirectory topLevel = createAssembledDirectory("top-level.ear", "top-level.ear");
             addPath(topLevel, "/webbeans/simple", "META-INF");

       

            AssembledDirectory earLib = topLevel.mkdir("lib");

       

            AssembledDirectory util = earLib.mkdir("util.jar");
             addPackage(util, SomeUtil.class);

       

            AssembledDirectory ext = earLib.mkdir("ext.jar");
             addPackage(ext, ExternalWebBean.class);
             addPath(ext, "/webbeans/simple/ext", "META-INF");

            ...

       

            AssembledDirectory lib = webinf.mkdir("lib");

       

            AssembledDirectory uijar = lib.mkdir("ui.jar");
             addPackage(uijar, UIWebBean.class);
             addPath(uijar, "/webbeans/simple/ui", "META-INF");
      {code}

       


       

      The questions I have is whether we should be using an AssembledFileSystem or creating Shrinkwrap archives for this kind of testing.  The syntax like 'addPackage' seems to be a mismatch with building a generic file system and should be leveraging a higher-level EE focused library like Shrinkwrap. 

       

      Embedded had capabilities for deploying Shrinkwrap archives.  Maybe some of the tests like 'AbstractWebBeansTest' don't belong in the deployers-vfs project.

       

      Any thoughts?

        • 1. Re: Use of Shrinkwrap in place of AssembledDirectories
          alesj

          Embedded had capabilities for deploying Shrinkwrap archives.  Maybe some of the tests like 'AbstractWebBeansTest' don't belong in the deployers-vfs project.

          AbstractWeBeansTest truely doesn't belong there, as it's just a leftover before we actually moved the code to Weld-int sub-project.

          You can simply delete it.

           

          Dunno about the rest. Which tests do you have in mind?

          We need to mock the basic deployments, so that we see how different things actually behave.

          e.g. Reflect with Javassist impl + new Classpools

          The questions I have is whether we should be using an AssembledFileSystem or creating Shrinkwrap archives for this kind of testing.  The syntax like 'addPackage' seems to be a mismatch with building a generic file system and should be leveraging a higher-level EE focused library like Shrinkwrap.

          We had these tests before Shrinkwrap existed.

          I wouldn't bother with porting the old tests to it.

          But I do agree it makes sense for the new tests.