You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by bw...@apache.org on 2003/04/22 00:10:34 UTC

cvs commit: maven-new/src/java/org/apache/maven/plugins/suiterunner SuiteRunnerService.java SuiteRunnerComponent.java

bwalding    2003/04/21 15:10:34

  Added:       src/java/org/apache/maven/plugins/suiterunner
                        SuiteRunnerService.java SuiteRunnerComponent.java
  Log:
  New components
  
  Revision  Changes    Path
  1.1                  maven-new/src/java/org/apache/maven/plugins/suiterunner/SuiteRunnerService.java
  
  Index: SuiteRunnerService.java
  ===================================================================
  /*
   * Created on 22/04/2003
   *
   * To change this generated comment go to 
   * Window>Preferences>Java>Code Generation>Code Template
   */
  package org.apache.maven.plugins.suiterunner;
  
  import org.apache.maven.project.Project;
  
  /**
   * @author <a href="bwalding@jakarta.org">Ben Walding</a>
   * @version $Id: SuiteRunnerService.java,v 1.1 2003/04/21 22:10:33 bwalding Exp $
   */
  public interface SuiteRunnerService
  {
      public static final String ROLE = SuiteRunnerService.class.getName();
  
      public void runTests(String testGroup, Project project);
  }
  
  
  
  1.1                  maven-new/src/java/org/apache/maven/plugins/suiterunner/SuiteRunnerComponent.java
  
  Index: SuiteRunnerComponent.java
  ===================================================================
  /*
   * Created on 22/04/2003
   *
   * To change this generated comment go to 
   * Window>Preferences>Java>Code Generation>Code Template
   */
  package org.apache.maven.plugins.suiterunner;
  
  import org.apache.avalon.framework.activity.Initializable;
  import org.apache.avalon.framework.activity.Startable;
  import org.apache.avalon.framework.configuration.Configurable;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.context.Contextualizable;
  import org.apache.avalon.framework.logger.Logger;
  import org.apache.avalon.framework.service.ServiceManager;
  import org.apache.avalon.framework.service.Serviceable;
  import org.apache.maven.project.Project;
  import org.apache.plexus.logging.AbstractLogEnabled;
  
  /** This service implements all the start phases:
   * @author <a href="bwalding@jakarta.org">Ben Walding</a>
  * @version $Id: SuiteRunnerComponent.java,v 1.1 2003/04/21 22:10:34 bwalding Exp $
  *
   *  LogEnabled
   *  Contexualize
   *  Serviceable
   *  Configurable
   *  Initializable
   *  Startable
   *
   */
  public class SuiteRunnerComponent
      extends AbstractLogEnabled
      implements SuiteRunnerService, Contextualizable, Serviceable, Configurable, Initializable, Startable
  {
      boolean enableLogging;
      boolean contextualize;
      boolean service;
      boolean configure;
      boolean initialize;
      boolean start;
      boolean stop;
      Context context;
  
      // ----------------------------------------------------------------------
      // Lifecycle Management
      // ----------------------------------------------------------------------
  
      public void enableLogging(Logger logger)
      {
          System.out.println("SuiteRunner.enableLogging()");
          enableLogging = true;
      }
  
      public void contextualize(Context context)
      {
          System.out.println("SuiteRunner.contextualize()");
          contextualize = true;
          System.out.println("Context:" + context);
  
          //XXX Am I allowed to hold onto references to this? 
          this.context = context;
      }
  
      public void service(ServiceManager serviceManager)
      {
          System.out.println("SuiteRunner.configure()");
          service = true;
      }
  
      public void configure(Configuration configuration)
      {
          System.out.println("SuiteRunner.configure()");
          String names[] = configuration.getAttributeNames();
  
          for (int i = 0; i < names.length; i++)
          {
              try
              {
                  System.out.println("attr[i]: " + names[i] + " = " + configuration.getAttribute(names[i]));
              }
              catch (ConfigurationException e)
              {
                  e.printStackTrace();
              }
          }
          configure = true;
  
      }
  
      public void initialize() throws Exception
      {
          System.out.println("SuiteRunner.initialize()");
          initialize = true;
      }
  
      public void start() throws Exception
      {
          System.out.println("SuiteRunner.start()");
          start = true;
      }
  
      public void stop() throws Exception
      {
          System.out.println("SuiteRunner.stop()");
          stop = true;
      }
  
      
  
      /* (non-Javadoc)
       * @see org.apache.maven.plugins.suiterunner.SuiteRunnerService#runTests(java.lang.String, org.apache.maven.project.Project)
       */
      public void runTests(String testGroup, Project project)
      {
          //Use the POM etc to locate and run the tests
          System.out.println("Running tests for project(id = " + project.getId() + ")");
          
      }
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org