Cactus
  1. Cactus
  2. CACTUS-238

Ability for the CactifyEar Task to to optionally work on an exploded Ear

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.7.1
    • Fix Version/s: None
    • Component/s: Ant Integration
    • Labels:
      None

      Description

      We're using Weblogic 8.1 and in development we deploy the application as an exploded Ear to allow hot deployment of JSPs and a quick turn around.

      Because the developers are used to such quick turn arounds time it makes it very hard to convince them to build a full Eay, cactify it and then delpoy as it adds an extra couple of minutes to each build cycle. Which means that they ignore the UnitTests.

      It would be really useful if the CactifyEar task could be configured so that it could cactify an exploded appllication.
      I think this will just involved
      1) creating the Cactus war in the appropriate place
      2) adding a module for the cactus war in the application xml of the exploded Ear

      1. cactus-238-patch-all.txt
        49 kB
        William Ferguson
      2. cactus-238-patch-from-svn-cmdline.txt
        24 kB
        William Ferguson
      3. cactus-238-patch.txt
        25 kB
        William Ferguson
      4. patch-to-build-xml.txt
        0.7 kB
        William Ferguson
      5. CactifyExplodedEarTask.java
        8 kB
        William Ferguson

        Activity

        William Ferguson created issue -
        Hide
        William Ferguson added a comment -

        This Task will cactifiy an exploded Ear (ie a folder that contains Ear content).

        It only needs a single srcfile attribute which defines the folder to cactify.
        Ie the target folder is modified, a new folder is not created.

        It may also contain a cactuswar element as per cactifyear.

        It does not added EJB refs to the embedded Cactus WAR.

        Show
        William Ferguson added a comment - This Task will cactifiy an exploded Ear (ie a folder that contains Ear content). It only needs a single srcfile attribute which defines the folder to cactify. Ie the target folder is modified, a new folder is not created. It may also contain a cactuswar element as per cactifyear. It does not added EJB refs to the embedded Cactus WAR.
        William Ferguson made changes -
        Field Original Value New Value
        Attachment CactifyExplodedEarTask.java [ 12324873 ]
        Hide
        William Ferguson added a comment -

        This pacth just ensures that the CactifyExplodedEar task is included in the cactus.tasks resource.

        Show
        William Ferguson added a comment - This pacth just ensures that the CactifyExplodedEar task is included in the cactus.tasks resource.
        William Ferguson made changes -
        Attachment patch-to-build-xml.txt [ 12324874 ]
        Hide
        William Ferguson added a comment -

        This patch allows you to build and execute Cactus tests against an application in an exploded Ear format. This is a common development practice for some app servers such as Weblogic as it allows for quick turnaround in building the and delpoying the application.

        It adds the following:
        1) Adds the 'cactifyexplodedear' task, which is a separate task from the 'cactifyear' task as it does not extend the Ear/Jar Tasks since it works ona folder and not an archive.
        2) Adds the ExplodedJarArchive, ExplodedWarArchive and ExplodedEarArchive classes and modifies EarParser so that when the 'cactus' task asks for details of the Ear, if it is pointed at a folder instead of an archive, it returns an ExplodedEarArchive instead of a DefaultEarArchive (nb thanks to whoever added the Archive interfaces).

        It has the following limitations.
        1) The server needs to be started before the 'cactus' task is executed as otherwise the 'cacuts' task will attempt to use the ContainerRunner to start the server, which in turn assumes that the application is an archive (at least the Weblogic7xContainer does - which is what is executed even though we are using Weblogic8).
        2) There is no doco for the cactifyexplodedear task, but if someone points me to where it should go and example to work from, i'll be happy to add it.

        So how about it?
        Is there a committer in the house willing to add it?

        Show
        William Ferguson added a comment - This patch allows you to build and execute Cactus tests against an application in an exploded Ear format. This is a common development practice for some app servers such as Weblogic as it allows for quick turnaround in building the and delpoying the application. It adds the following: 1) Adds the 'cactifyexplodedear' task, which is a separate task from the 'cactifyear' task as it does not extend the Ear/Jar Tasks since it works ona folder and not an archive. 2) Adds the ExplodedJarArchive, ExplodedWarArchive and ExplodedEarArchive classes and modifies EarParser so that when the 'cactus' task asks for details of the Ear, if it is pointed at a folder instead of an archive, it returns an ExplodedEarArchive instead of a DefaultEarArchive (nb thanks to whoever added the Archive interfaces). It has the following limitations. 1) The server needs to be started before the 'cactus' task is executed as otherwise the 'cacuts' task will attempt to use the ContainerRunner to start the server, which in turn assumes that the application is an archive (at least the Weblogic7xContainer does - which is what is executed even though we are using Weblogic8). 2) There is no doco for the cactifyexplodedear task, but if someone points me to where it should go and example to work from, i'll be happy to add it. So how about it? Is there a committer in the house willing to add it?
        William Ferguson made changes -
        Attachment cactus-238-patch.txt [ 12325216 ]
        Hide
        Felipe Leme added a comment -

        Hi William,

        I've tried to apply your patch, but it failed:

        [felipeal@disco-stu.local]/Users/felipeal/cvs/cactus/trunk: patch -p0 < /Users/felipeal/cvs/patches/CACTUS-238/cactus-238-patch.txt
        (Stripping trailing CRs from patch.)
        patching file D:/Modules/cactus-cvs/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/application/ExplodedEarArchive.java
        (Stripping trailing CRs from patch.)
        patching file D:/Modules/cactus-cvs/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/ExplodedJarArchive.java
        (Stripping trailing CRs from patch.)
        can't find file to patch at input line 247
        Perhaps you used the wrong -p or --strip option?
        The text leading up to this was:
        --------------------------

        Index: D:/Modules/cactus-cvs/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/EarParser.java
        ===================================================================
        — D:/Modules/cactus-cvs/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/EarParser.java (revision 387121)
        +++ D:/Modules/cactus-cvs/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/EarParser.java (working copy)
        --------------------------

        Could you please provide a new patch against SVN's trunk? Also, a test case for the new feature would be welcome.

        Regarding the documentation, it's on documentation/docs/xdocs; you go to the documentation dir, run 'ant dist' and the documentation will be available on documentation/target/doc/index.html . I think you will need to add a new xml describing the task on documentation/docs/xdocs/integration/ant (you can use the existing xmls as template) and also an entry in the sitemap.xml

        – Felipe

        Show
        Felipe Leme added a comment - Hi William, I've tried to apply your patch, but it failed: [felipeal@disco-stu.local] /Users/felipeal/cvs/cactus/trunk: patch -p0 < /Users/felipeal/cvs/patches/ CACTUS-238 /cactus-238-patch.txt (Stripping trailing CRs from patch.) patching file D:/Modules/cactus-cvs/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/application/ExplodedEarArchive.java (Stripping trailing CRs from patch.) patching file D:/Modules/cactus-cvs/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/ExplodedJarArchive.java (Stripping trailing CRs from patch.) can't find file to patch at input line 247 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- Index: D:/Modules/cactus-cvs/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/EarParser.java =================================================================== — D:/Modules/cactus-cvs/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/EarParser.java (revision 387121) +++ D:/Modules/cactus-cvs/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/EarParser.java (working copy) -------------------------- Could you please provide a new patch against SVN's trunk? Also, a test case for the new feature would be welcome. Regarding the documentation, it's on documentation/docs/xdocs; you go to the documentation dir, run 'ant dist' and the documentation will be available on documentation/target/doc/index.html . I think you will need to add a new xml describing the task on documentation/docs/xdocs/integration/ant (you can use the existing xmls as template) and also an entry in the sitemap.xml – Felipe
        Hide
        William Ferguson added a comment -

        This patch was created from the SVN cmdline after updating to revision 394831.
        The previous patch was created from within Eclipse and appears to contain fully qualified paths instead of relative ones, which may be why Fellipe could not apply it.

        Show
        William Ferguson added a comment - This patch was created from the SVN cmdline after updating to revision 394831. The previous patch was created from within Eclipse and appears to contain fully qualified paths instead of relative ones, which may be why Fellipe could not apply it.
        William Ferguson made changes -
        Attachment cactus-238-patch-from-svn-cmdline.txt [ 12325739 ]
        Hide
        William Ferguson added a comment -

        OK this patch was created from the SVN cdmline so hopefully it can be readily applied.
        It contains:
        Implementations for the Cargo Archive interfaces for exploded archive formats. I think these should eventually be submitted to Cargo and will look at doing that.
        CactifyExplodedEar Ant task.
        Modifications to the EarParser such that if Archive is a folder then the cactus task will execute the tests against an exploded Ear.
        I also belive I have removed the need for any of the Cargo Archive implementations, that is I think I have switched everything to use Cargo now. So lots of the classes in org.apache.cactus.integration.ant.deployment.. can be removed in favour of the Cargo alternatives. Doing so will allow cleanup of the ExplodedArchive versions as all of these needded to explicitly reference the Cargo classes at every point.

        Show
        William Ferguson added a comment - OK this patch was created from the SVN cdmline so hopefully it can be readily applied. It contains: Implementations for the Cargo Archive interfaces for exploded archive formats. I think these should eventually be submitted to Cargo and will look at doing that. CactifyExplodedEar Ant task. Modifications to the EarParser such that if Archive is a folder then the cactus task will execute the tests against an exploded Ear. I also belive I have removed the need for any of the Cargo Archive implementations, that is I think I have switched everything to use Cargo now. So lots of the classes in org.apache.cactus.integration.ant.deployment. . can be removed in favour of the Cargo alternatives. Doing so will allow cleanup of the ExplodedArchive versions as all of these needded to explicitly reference the Cargo classes at every point.
        William Ferguson made changes -
        Attachment cactus-238-patch-all.txt [ 12326120 ]
        Hide
        Felipe Leme added a comment -

        Hi William,

        The patch worked , I mean, I could apply it to the trunk code.

        I'm running the build and later this week I will take a better look on the changes.

        Thanks for the patch and sorry again for the delay.

        – Felipe

        Show
        Felipe Leme added a comment - Hi William, The patch worked , I mean, I could apply it to the trunk code. I'm running the build and later this week I will take a better look on the changes. Thanks for the patch and sorry again for the delay. – Felipe

          People

          • Assignee:
            Unassigned
            Reporter:
            William Ferguson
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development