vmassol     2002/09/01 10:02:37

  Modified:    framework/src/java/share/org/apache/cactus/util
                        Configuration.java
  Log:
  added notion of client side initializer. This is an optional class that is called 
once per run to perform some initialization task. The first usage example is the Jetty 
integration which starts Jetty before the tests run.
  
  Revision  Changes    Path
  1.13      +23 -2     
jakarta-cactus/framework/src/java/share/org/apache/cactus/util/Configuration.java
  
  Index: Configuration.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/util/Configuration.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Configuration.java        30 Aug 2002 20:42:08 -0000      1.12
  +++ Configuration.java        1 Sep 2002 17:02:37 -0000       1.13
  @@ -114,6 +114,13 @@
           HttpClientConnectionHelper.class.getName();
   
       /**
  +     * Name of the Cactus property for defining an initializer (i.e. a class
  +     * that is executed before the Cactus tests start on the client side).
  +     */
  +    private static final String CACTUS_INITIALIZER_PROPERTY = 
  +        "cactus.initializer";
  +
  +    /**
        * True if the Cactus configuration file has already been read.
        * @see #initialize()
        */
  @@ -211,10 +218,12 @@
        */
       public static String getConnectionHelper()
       {
  +        initialize();
  +
           // Try to read it from a System property first and then if not defined
           // use the default.
  -        String connectionHelperClassname = System.getProperty(
  -            CACTUS_CONNECTION_HELPER_CLASSNAME_PROPERTY);
  +        String connectionHelperClassname = 
  +            System.getProperty(CACTUS_CONNECTION_HELPER_CLASSNAME_PROPERTY);
   
           if (connectionHelperClassname == null)
           {
  @@ -223,5 +232,17 @@
           }
   
           return connectionHelperClassname;
  +    }
  +
  +    /**
  +     * @return the initializer class (i.e. a class that is executed before the
  +     *         Cactus tests start on the client side) or null if none has been
  +     *         defined
  +     */
  +    public static String getInitializer()
  +    {
  +        initialize();
  +
  +        return System.getProperty(CACTUS_INITIALIZER_PROPERTY);
       }
   }
  
  
  

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

Reply via email to