Author: ptahchiev
Date: Sat Nov  3 13:38:05 2007
New Revision: 591679

URL: http://svn.apache.org/viewvc?rev=591679&view=rev
Log:
Sample integration made, so that it is possible to test with the Sample app. in 
the scratchpad

Modified:
    
jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactifyConfiguration.java
    
jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactifyEarMojo.java
    
jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactifyWarMojo.java
    
jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactusTestMojo.java

Modified: 
jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactifyConfiguration.java
URL: 
http://svn.apache.org/viewvc/jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactifyConfiguration.java?rev=591679&r1=591678&r2=591679&view=diff
==============================================================================
--- 
jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactifyConfiguration.java
 (original)
+++ 
jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactifyConfiguration.java
 Sat Nov  3 13:38:05 2007
@@ -127,18 +127,6 @@
     private boolean addEjbReferences;
 
     /**
-     * Cactus war configuration holder.
-     * @parameter
-     */
-    private CactusWar cactusWar;
-    /**
-     * @return CactusWar
-     */
-    public CactusWar getCactusWar() 
-    {
-        return cactusWar;
-    }
-    /**
      * @return FileSet
      */
     public FileSet getClassesDirectory() 
@@ -207,13 +195,6 @@
     public void setAddEjbReferences(boolean isAddEjbReferences) 
     {
         this.addEjbReferences = isAddEjbReferences;
-    }
-    /**
-     * @param theCactusWar to set
-     */
-    public void setCactusWar(CactusWar theCactusWar) 
-    {
-        this.cactusWar = theCactusWar;
     }
     /**
      * @param theClassesDirectory to set

Modified: 
jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactifyEarMojo.java
URL: 
http://svn.apache.org/viewvc/jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactifyEarMojo.java?rev=591679&r1=591678&r2=591679&view=diff
==============================================================================
--- 
jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactifyEarMojo.java
 (original)
+++ 
jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactifyEarMojo.java
 Sat Nov  3 13:38:05 2007
@@ -72,7 +72,7 @@
      * Cactus war configuration holder..
      * @parameter
      */
-    private CactusWar cactusWar;
+    private CactifyWarMojo cactusWar;
     
     /**
      * The archive that contains the web-app that should be cactified.
@@ -100,7 +100,7 @@
      * 
      * @param theCactusWar CactusWar to set
      */
-    public void addConfiguredCactuswar(CactusWar theCactusWar)
+    public void addConfiguredCactuswar(CactifyWarMojo theCactusWar)
     {
         cactusWar = theCactusWar;
     }
@@ -360,9 +360,9 @@
      *
      * @return the CactusWar configuration
      */
-    private CactusWar createCactusWarConfig()
+    private CactifyWarMojo createCactusWarConfig()
     {
-        CactusWar cactusWarConfig = new CactusWar();
+        CactifyWarMojo cactusWarConfig = new CactifyWarMojo();
         Version version = new Version();
         version.setValue("2.3");
         cactusWarConfig.getCactifyConfiguration().setVersion(version);

Modified: 
jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactifyWarMojo.java
URL: 
http://svn.apache.org/viewvc/jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactifyWarMojo.java?rev=591679&r1=591678&r2=591679&view=diff
==============================================================================
--- 
jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactifyWarMojo.java
 (original)
+++ 
jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactifyWarMojo.java
 Sat Nov  3 13:38:05 2007
@@ -56,9 +56,6 @@
  * An Maven Mojo that injects elements necessary to run Cactus tests into an
  * existing WAR file.
  * 
- * @goal cactifywar
- * @requiresDependencyResolution compile
- * 
  * @version $Id: CactifyWarMojo 239003 2004-05-31 20:05:27Z paranoiabla $
  */
 public class CactifyWarMojo extends AbstractMojo 
@@ -80,6 +77,43 @@
      * @required
      */
     private WarArchiver warArchiver;
+    //=============================================================
+    /**
+     * Name of the generated web app file.
+     */
+    private static final String FILE_NAME = "cactus.war";
+    
+    /**
+     * Context of the cactus web application.
+     */
+    private String context;
+    
+    /**
+     * @return Returns the context.
+     */
+    public String getContext()
+    {
+        return context;
+    }
+    
+    /**
+     * @param theContext The context to set.
+     */
+    public void setContext(String theContext)
+    {
+        context = theContext;
+    }   
+    
+    /**
+     * 
+     * @return the name of the web app file
+     */
+    public String getFileName()
+    {
+        return FILE_NAME;
+    }
+    //============================================
+    
     /**
      * The xmlEntityResolver.
      */

Modified: 
jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactusTestMojo.java
URL: 
http://svn.apache.org/viewvc/jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactusTestMojo.java?rev=591679&r1=591678&r2=591679&view=diff
==============================================================================
--- 
jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactusTestMojo.java
 (original)
+++ 
jakarta/cactus/branches/CACTUS_TRUNK_MAMOUTH/integration/integration-maven2/src/main/java/org/apache/cactus/integration/m2/CactusTestMojo.java
 Sat Nov  3 13:38:05 2007
@@ -19,13 +19,17 @@
  */
 package org.apache.cactus.integration.m2;
 
+import java.awt.Container;
 import java.io.File;
 import java.io.IOException;
 
+import org.apache.cactus.integration.ant.CactusTask;
+import org.apache.cactus.integration.ant.ContainerSet;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugin.surefire.SurefirePlugin;
+import org.apache.tools.ant.Project;
 
 /**
  * @goal test
@@ -43,19 +47,40 @@
      */
     private File testClassesDirectory;
     /**
+     * @parameter
+     * @required
+     */
+    private File warFile;
+    /**
+     * @parameter
+     * @required
+     */
+    private ContainerSet containerSet;
+    /**
      * This is the mojo's "main" method.
      * 
      * @throws MojoExecutionException in case of error
      * @throws MojoFailureException in case of error
      */
-    public void execute() throws MojoExecutionException, MojoFailureException 
-    {   /*
+    public void execute()
+    {   
         // Model 1 - with the instantiating or extending the Surefire plugin
         // does not run - NPE is thrown, as maven2 does not allow on to 
         // extend a plugin
-        SurefirePlugin plugin = new SurefirePlugin();
-        plugin.execute();
-        */
+        //SurefirePlugin plugin = new SurefirePlugin();
+        //plugin.execute();
+        
+       try {
+               Project pro = new Project();
+               CactusTask cactusTask = new CactusTask();
+               
+               cactusTask.setProject(pro);
+               
+               cactusTask.setWarFile(warFile);
+               cactusTask.addContainerSet(containerSet);
+               
+       } catch (Exception ex) 
{System.out.println("Error");ex.printStackTrace();}
+       
         /*
         // Model 2 - with the Runtime: works but with no log!
         Thread thread = new Thread() {
@@ -74,7 +99,5 @@
         };
         thread.run();
         */
-        
-        
    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to