Coverage Report - org.kuali.student.lum.kim.role.type.HierarchyNodeTestRoleTypeServiceBase
 
Classes in this File Line Coverage Branch Coverage Complexity
HierarchyNodeTestRoleTypeServiceBase
0%
0/14
0%
0/2
1.5
 
 1  
 /**
 2  
  * Copyright 2010 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.lum.kim.role.type;
 17  
 
 18  
 import java.util.ArrayList;
 19  
 import java.util.List;
 20  
 
 21  
 import org.apache.commons.lang.StringUtils;
 22  
 import org.kuali.rice.kim.bo.Role;
 23  
 import org.kuali.rice.kim.bo.role.dto.RoleMembershipInfo;
 24  
 import org.kuali.rice.kim.bo.types.dto.AttributeSet;
 25  
 import org.kuali.rice.kim.service.support.impl.KimDerivedRoleTypeServiceBase;
 26  
 
 27  
 /**
 28  
  * Dummy class to test Hierarchy Node Test
 29  
  * 
 30  
  * @author delyea
 31  
  *
 32  
  */
 33  0
 public class HierarchyNodeTestRoleTypeServiceBase extends KimDerivedRoleTypeServiceBase {
 34  
 
 35  
         /* (non-Javadoc)
 36  
          * @see org.kuali.rice.kim.service.support.impl.KimDerivedRoleTypeServiceBase#getRoleMembersFromApplicationRole(java.lang.String, java.lang.String, org.kuali.rice.kim.bo.types.dto.AttributeSet)
 37  
          */
 38  
         @Override
 39  
         public List<RoleMembershipInfo> getRoleMembersFromApplicationRole(String namespaceCode, String roleName, AttributeSet qualification) {
 40  0
                 List<RoleMembershipInfo> roleMembers = new ArrayList<RoleMembershipInfo>();
 41  0
                 roleMembers.add(new RoleMembershipInfo(null,null,"eric",Role.PRINCIPAL_MEMBER_TYPE,null));
 42  0
                 roleMembers.add(new RoleMembershipInfo(null,null,"fran",Role.PRINCIPAL_MEMBER_TYPE,null));
 43  0
                 roleMembers.add(new RoleMembershipInfo(null,null,"user1",Role.PRINCIPAL_MEMBER_TYPE,null));
 44  0
                 roleMembers.add(new RoleMembershipInfo(null,null,"user4",Role.PRINCIPAL_MEMBER_TYPE,null));
 45  0
                 return roleMembers;
 46  
         }
 47  
 
 48  
         /* (non-Javadoc)
 49  
          * @see org.kuali.rice.kim.service.support.impl.KimRoleTypeServiceBase#sortRoleMembers(java.util.List)
 50  
          */
 51  
         @Override
 52  
         public List<RoleMembershipInfo> sortRoleMembers(List<RoleMembershipInfo> roleMembers) {
 53  0
                 List<RoleMembershipInfo> sortedRoleMembers = new ArrayList<RoleMembershipInfo>();
 54  0
         int group = 0; // counter for the group number to add to the roleSortingCode
 55  0
                 for (RoleMembershipInfo roleMembershipInfo : roleMembers) {
 56  0
                         roleMembershipInfo.setRoleSortingCode( StringUtils.leftPad(Integer.toString(group), 3, '0') );
 57  0
                         sortedRoleMembers.add(roleMembershipInfo);
 58  0
                         group++;
 59  
                 }
 60  0
                 return sortedRoleMembers;
 61  
         }
 62  
 
 63  
 }