Clover coverage report - Acegi Security System for Spring - 1.0.0-RC1
Coverage timestamp: Mon Dec 5 2005 09:05:15 EST
file stats: LOC: 101   Methods: 7
NCLOC: 43   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
AbstractTicketValidator.java 75% 91.7% 100% 91.3%
coverage coverage
 1    /* Copyright 2004 Acegi Technology Pty Limited
 2    *
 3    * Licensed under the Apache License, Version 2.0 (the "License");
 4    * you may not use this file except in compliance with the License.
 5    * You may obtain a copy of the License at
 6    *
 7    * http://www.apache.org/licenses/LICENSE-2.0
 8    *
 9    * Unless required by applicable law or agreed to in writing, software
 10    * distributed under the License is distributed on an "AS IS" BASIS,
 11    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12    * See the License for the specific language governing permissions and
 13    * limitations under the License.
 14    */
 15   
 16    package org.acegisecurity.providers.cas.ticketvalidator;
 17   
 18    import org.acegisecurity.providers.cas.TicketValidator;
 19    import org.acegisecurity.ui.cas.ServiceProperties;
 20   
 21    import org.apache.commons.logging.Log;
 22    import org.apache.commons.logging.LogFactory;
 23    import org.springframework.beans.factory.InitializingBean;
 24    import org.springframework.util.Assert;
 25   
 26   
 27    /**
 28    * Convenience abstract base for <code>TicketValidator</code>s.
 29    *
 30    * @author Ben Alex
 31    * @version $Id: AbstractTicketValidator.java,v 1.4 2005/11/17 00:56:29 benalex Exp $
 32    */
 33    public abstract class AbstractTicketValidator implements TicketValidator,
 34    InitializingBean {
 35    //~ Static fields/initializers =============================================
 36   
 37    private static final Log logger = LogFactory.getLog(CasProxyTicketValidator.class);
 38   
 39    //~ Instance fields ========================================================
 40   
 41    private ServiceProperties serviceProperties;
 42    private String casValidate;
 43    private String trustStore;
 44   
 45    //~ Methods ================================================================
 46   
 47  6 public void setCasValidate(String casValidate) {
 48  6 this.casValidate = casValidate;
 49    }
 50   
 51    /**
 52    * Mandatory URL to CAS' proxy ticket valiation service.
 53    *
 54    * <P>
 55    * This is usually something like
 56    * <code>https://www.mycompany.com/cas/proxyValidate</code>.
 57    * </p>
 58    *
 59    * @return the CAS proxy ticket validation URL
 60    */
 61  5 public String getCasValidate() {
 62  5 return casValidate;
 63    }
 64   
 65  6 public void setServiceProperties(ServiceProperties serviceProperties) {
 66  6 this.serviceProperties = serviceProperties;
 67    }
 68   
 69  8 public ServiceProperties getServiceProperties() {
 70  8 return serviceProperties;
 71    }
 72   
 73  2 public void setTrustStore(String trustStore) {
 74  2 this.trustStore = trustStore;
 75    }
 76   
 77    /**
 78    * Optional property which will be used to set the system property
 79    * <code>javax.net.ssl.trustStore</code>.
 80    *
 81    * @return the <code>javax.net.ssl.trustStore</code> that will be set
 82    * during bean initialization, or <code>null</code> to leave the
 83    * system property unchanged
 84    */
 85  2 public String getTrustStore() {
 86  2 return trustStore;
 87    }
 88   
 89  4 public void afterPropertiesSet() throws Exception {
 90  4 Assert.hasLength(casValidate, "A casValidate URL must be set");
 91  3 Assert.notNull(serviceProperties, "serviceProperties must be specified");
 92   
 93  2 if ((trustStore != null) && (!"".equals(trustStore))) {
 94  1 if (logger.isDebugEnabled()) {
 95  0 logger.debug("Setting system property 'javax.net.ssl.trustStore'" +
 96    " to value [" + trustStore + "]");
 97    }
 98  1 System.setProperty("javax.net.ssl.trustStore", trustStore);
 99    }
 100    }
 101    }