Coverage report

  %line %branch
net.sf.infrared.web.util.WebConfig
0% 
0% 

 1  
 /*
 2  
  *
 3  
  * Copyright 2005 Tavant Technologies and Contributors
 4  
  * 
 5  
  * Licensed under the Apache License, Version 2.0 (the "License")
 6  
  * you may not use this file except in compliance with the License.
 7  
  * You may obtain a copy of the License at
 8  
  *
 9  
  *     http://www.apache.org/licenses/LICENSE-2.0
 10  
  *
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  *
 17  
  *
 18  
  *
 19  
  * Original Author:  prashant.nair (Tavant Technologies)
 20  
  * Contributor(s):   
 21  
  *
 22  
  */
 23  
 package net.sf.infrared.web.util;
 24  
 
 25  
 import org.apache.log4j.Logger;
 26  
 
 27  
 import net.sf.infrared.base.util.LoggingFactory;
 28  
 
 29  0
 public class WebConfig {
 30  
 
 31  
     public static final String COLLECTOR_PERSIST_INTERVAL = "persist-interval";
 32  
     public static final String WEB_COLOR_THRESHOLD = "web.color-threshold";
 33  
     public static final String WEB_NUM_OF_SQL_QUERIES = "web.num_of_sql_queries";
 34  
     
 35  
     public static final String DEFAULT_WEB_CONFIG_LOCATION = "infrared-web.properties";
 36  
     
 37  
     public static final String DEFAULT_COLLECTOR_PERSIST_INTERVAL = "600000";
 38  
     public static final String DEFAULT_WEB_COLOR_THRESHOLD = "25";
 39  
     public static final String DEFAULT_NUM_OF_LAST_INVOCATIONS = "5";
 40  
     public static final String DEFAULT_NUM_OF_SQL_QUERIES = "5";
 41  
     
 42  0
     public static Logger log = LoggingFactory.getLogger(WebConfig.class);
 43  
     private static PropertyUtil propertyUtil;
 44  
 
 45  
     static{
 46  0
         propertyUtil = new PropertyUtil(DEFAULT_WEB_CONFIG_LOCATION);                
 47  0
     }
 48  
     
 49  
     public static long getPersistInterval(){
 50  0
         String interval = propertyUtil.getProperty(COLLECTOR_PERSIST_INTERVAL, 
 51  
                                                             DEFAULT_COLLECTOR_PERSIST_INTERVAL);
 52  0
         return Long.parseLong(interval);
 53  
     }
 54  
     
 55  
     public static int getColorThreshold(){
 56  0
         String threshold = propertyUtil.getProperty(WEB_COLOR_THRESHOLD, 
 57  
                                                                     DEFAULT_WEB_COLOR_THRESHOLD);
 58  0
         return Integer.parseInt(threshold);
 59  
     }
 60  
     
 61  
     public static int getNumOfSqlQueries(){
 62  0
         String sqlQueries = propertyUtil.getProperty(WEB_NUM_OF_SQL_QUERIES, 
 63  
                                                                        DEFAULT_NUM_OF_SQL_QUERIES);
 64  0
         return Integer.parseInt(sqlQueries);
 65  
     }
 66  
 }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.