Coverage Report - org.kuali.student.process.poc.krms.termresolver.CurrentDateResolver
 
Classes in this File Line Coverage Branch Coverage Complexity
CurrentDateResolver
0%
0/8
N/A
1
 
 1  
 /**
 2  
  * Copyright 2011 The Kuali Foundation Licensed under the
 3  
  * Educational Community License, Version 2.0 (the "License"); you may
 4  
  * not use this file except in compliance with the License. You may
 5  
  * obtain a copy of the License at
 6  
  *
 7  
  * http://www.osedu.org/licenses/ECL-2.0
 8  
  *
 9  
  * Unless required by applicable law or agreed to in writing,
 10  
  * software distributed under the License is distributed on an "AS IS"
 11  
  * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 12  
  * or implied. See the License for the specific language governing
 13  
  * permissions and limitations under the License.
 14  
  */
 15  
 
 16  
 package org.kuali.student.process.poc.krms.termresolver;
 17  
 
 18  
 import org.kuali.rice.krms.api.engine.TermResolutionException;
 19  
 import org.kuali.rice.krms.api.engine.TermResolver;
 20  
 import org.kuali.student.common.util.krms.RulesExecutionConstants;
 21  
 
 22  
 import java.util.Calendar;
 23  
 import java.util.Collections;
 24  
 import java.util.Date;
 25  
 import java.util.Map;
 26  
 import java.util.Set;
 27  
 
 28  
 /**
 29  
  * Created by IntelliJ IDEA.
 30  
  * User: andy
 31  
  * Date: 12/16/11
 32  
  * Time: 3:19 PM
 33  
  * To change this template use File | Settings | File Templates.
 34  
  */
 35  0
 public class CurrentDateResolver implements TermResolver<Date> {
 36  
 
 37  
     @Override
 38  
     public Set<String> getPrerequisites() {
 39  0
         return Collections.emptySet();
 40  
     }
 41  
 
 42  
     @Override
 43  
     public String getOutput() {
 44  0
         return RulesExecutionConstants.CURRENT_DATE_TERM_NAME;
 45  
     }
 46  
 
 47  
     @Override
 48  
     public Set<String> getParameterNames() {
 49  0
         return Collections.emptySet();
 50  
     }
 51  
 
 52  
     @Override
 53  
     public int getCost() {
 54  
         // TODO Analyze, though probably not much to check here
 55  0
         return 0;
 56  
     }
 57  
 
 58  
     @Override
 59  
     public Date resolve(Map<String, Object> resolvedPrereqs, Map<String, String> parameters) throws TermResolutionException {
 60  0
         Calendar cal = Calendar.getInstance();
 61  
 
 62  0
         cal.set(2011, 11, 30);
 63  
 
 64  0
         return cal.getTime();
 65  
     }
 66  
 }