2011/08/05 - Jakarta Cactus has been retired.

For more information, please explore the Attic.

Clover coverage report - Cactus 1.8dev for J2EE API 1.3
Coverage timestamp: Sun Mar 26 2006 18:50:18 BRT
file stats: LOC: 76   Methods: 2
NCLOC: 23   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
BaseConfiguration.java 50% 60% 50% 55.6%
coverage coverage
 1   
 /* 
 2   
  * ========================================================================
 3   
  * 
 4   
  * Copyright 2001-2004 The Apache Software Foundation.
 5   
  *
 6   
  * Licensed under the Apache License, Version 2.0 (the "License");
 7   
  * you may not use this file except in compliance with the License.
 8   
  * You may obtain a copy of the License at
 9   
  * 
 10   
  *   http://www.apache.org/licenses/LICENSE-2.0
 11   
  * 
 12   
  * Unless required by applicable law or agreed to in writing, software
 13   
  * distributed under the License is distributed on an "AS IS" BASIS,
 14   
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 15   
  * See the License for the specific language governing permissions and
 16   
  * limitations under the License.
 17   
  * 
 18   
  * ========================================================================
 19   
  */
 20   
 package org.apache.cactus.internal.configuration;
 21   
 
 22   
 import org.apache.cactus.util.ChainedRuntimeException;
 23   
 
 24   
 /**
 25   
  * Provides access to the Cactus configuration parameters that are independent
 26   
  * of any redirector. All Cactus configuration are defined as Java System
 27   
  * Properties.
 28   
  *
 29   
  * @version $Id: BaseConfiguration.java 238991 2004-05-22 11:34:50Z vmassol $
 30   
  */
 31   
 public class BaseConfiguration implements Configuration
 32   
 {
 33   
     /**
 34   
      * Name of Cactus property that specify the URL up to the webapp context.
 35   
      * This is the base URL to call for the redirectors. It is made up of :
 36   
      * "http://" + serverName + port + "/" + contextName.
 37   
      */
 38   
     public static final String CACTUS_CONTEXT_URL_PROPERTY = 
 39   
         "cactus.contextURL";
 40   
 
 41   
     /**
 42   
      * Name of the Cactus property for defining an initializer (i.e. a class
 43   
      * that is executed before the Cactus tests start on the client side).
 44   
      */
 45   
     private static final String CACTUS_INITIALIZER_PROPERTY = 
 46   
         "cactus.initializer";
 47   
 
 48   
     /**
 49   
      * @return the context URL under which our application to test runs.
 50   
      */
 51  51
     public String getContextURL()
 52   
     {
 53   
         // Try to read it from a System property first and then if it fails
 54   
         // from the Cactus configuration file.
 55  51
         String contextURL = System.getProperty(CACTUS_CONTEXT_URL_PROPERTY);
 56   
 
 57  51
         if (contextURL == null)
 58   
         {
 59  0
             throw new ChainedRuntimeException("Missing Cactus property ["
 60   
                 + CACTUS_CONTEXT_URL_PROPERTY + "]");
 61   
         }
 62   
 
 63  51
         return contextURL;
 64   
     }
 65   
 
 66   
     /**
 67   
      * @return the initializer class (i.e. a class that is executed before the
 68   
      *         Cactus tests start on the client side) or null if none has been
 69   
      *         defined
 70   
      */
 71  0
     public String getInitializer()
 72   
     {
 73  0
         return System.getProperty(CACTUS_INITIALIZER_PROPERTY);
 74   
     }
 75   
 }
 76