jvanzyl     01/12/16 10:04:22

  Modified:    .        build-test.xml default.properties
  Added:       src/rttest Fulcrum.properties
               src/rttest/org/apache/fulcrum/test FulcrumRunner.java
  Log:
  - adding the same runtime test mechansim as there is in torque. there's
    a nifty new service coming down the pipe! it has tests of course!
  
  Revision  Changes    Path
  1.2       +10 -4     jakarta-turbine-fulcrum/build-test.xml
  
  Index: build-test.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-fulcrum/build-test.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build-test.xml    2001/12/16 07:08:46     1.1
  +++ build-test.xml    2001/12/16 18:04:22     1.2
  @@ -60,7 +60,6 @@
         </batchtest>
       </junit>
   
  -
       <java
         classname="org.apache.fulcrum.localization.LocalizationTest"
         fork="yes" failonerror="true">
  @@ -70,7 +69,13 @@
           <pathelement location="${build.dir}/test"/>
         </classpath>
       </java>
  -  
  +
  +    <java
  +      classname="org.apache.torque.test.FulcrumRunner">
  +      <arg value="${rttest.dir}/Fulcrum.properties"/>
  +      <classpath refid="classpath"/>
  +    </java>
  +
     </target>
   
     <!-- ================================================================== -->
  @@ -81,15 +86,16 @@
       name="compile-test"
       description="==> compiles the test source code">
       
  -    <ant antfile="build.xml" target="clean"/>
       <ant antfile="build.xml" target="compile"/>
       
  -    <javac srcdir="${test.dir}"
  +    <javac
         destdir="${build.dest}"
         excludes="**/package.html"
         debug="${debug}"
         deprecation="${deprecation}"
         optimize="${optimize}">
  +      <src path="${test.dir}"/>
  +      <src path="${rttest.dir}"/>
         <classpath refid="classpath"/>
         <classpath>
           <pathelement path="${build.dest}"/>
  
  
  
  1.13      +1 -0      jakarta-turbine-fulcrum/default.properties
  
  Index: default.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-fulcrum/default.properties,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- default.properties        2001/12/16 07:08:46     1.12
  +++ default.properties        2001/12/16 18:04:22     1.13
  @@ -35,6 +35,7 @@
   test.reportsDirectory = test-reports
   test.dir = ${src.dir}/test
   build.test = ${build.dir}/test
  +rttest.dir = ${src.dir}/rttest
   
   # You must set values for the JAR file properties listed here, or in
   # your ${user.home}/build.properties or local build.properties file in
  
  
  
  1.1                  jakarta-turbine-fulcrum/src/rttest/Fulcrum.properties
  
  Index: Fulcrum.properties
  ===================================================================
  # -------------------------------------------------------------------
  # 
  #  S E R V I C E S
  #
  # -------------------------------------------------------------------
  # Classes for Fulcrum Services should be defined here.
  # Format: services.[name].classname=[implementing class]
  #
  # To specify properties of a service use the following syntax:
  # service.[name].[property]=[value]
  #
  # The order that these services is listed is important! The
  # order that is stated here is the order in which the services
  # will be initialized. Keep this is mind if you have services
  # that depend on other services during initialization.
  # -------------------------------------------------------------------
  services.DvslService.classname=org.apache.fulcrum.dvsl.FulcrumDvslService
  
  
  
  
  1.1                  
jakarta-turbine-fulcrum/src/rttest/org/apache/fulcrum/test/FulcrumRunner.java
  
  Index: FulcrumRunner.java
  ===================================================================
  package org.apache.torque.test;
  
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Turbine" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Turbine", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  import org.apache.commons.collections.ExtendedProperties;
  import org.apache.log4j.Category;
  import org.apache.fulcrum.TurbineServices;
  import org.apache.fulcrum.ServiceException;
  import org.apache.fulcrum.ServiceManager;
  
  /**
   * This class is an example of how to start Torque with a
   * configuration that exists in the file system.
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>Jason van Zyl</a>
   * @author <a href="mailto:[EMAIL PROTECTED]";>Martin Poeschl</a>
   * @version $Id: FulcrumRunner.java,v 1.1 2001/12/16 18:04:22 jvanzyl Exp $
   */
  public class FulcrumRunner
  {
      /**
       * Category used for logging in the runtime test class.
       */
      private static Category category = 
          Category.getInstance(FulcrumRunner.class.getName());
  
      public static void main(String[] args)
          throws ServiceException
      {
          String configurationFile = args[0];
  
          // initializing Torque
          try
          {
              ServiceManager serviceManager = TurbineServices.getManager();
              
              serviceManager.setConfiguration(
                  new ExtendedProperties(configurationFile));
                  
              serviceManager.init();
          }
          catch (Exception e)
          {
              throw new ServiceException("Can't initialize Fulcrum!", e);
          }
          
          // run the tests
          FulcrumRunner fr = new FulcrumRunner();
      }
  }
  
  
  

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

Reply via email to