Clover Coverage Report - Kuali Student 1.2-M2-SNAPSHOT (Aggregated)
Coverage timestamp: Fri Apr 22 2011 04:03:20 EST
../../../../../../../../img/srcFileCovDistChart0.png 53% of files have more coverage
25   89   14   2.78
6   67   0.56   9
9     1.56  
1    
 
  DependencyAnalysisRpcServlet       Line # 17 25 0% 14 40 0% 0.0
 
No Tests
 
1    package org.kuali.student.lum.lu.ui.dependency.server;
2   
3    import java.util.ArrayList;
4    import java.util.List;
5   
6    import org.kuali.student.core.statement.dto.ReqComponentInfo;
7    import org.kuali.student.core.statement.dto.StatementTreeViewInfo;
8    import org.kuali.student.core.statement.service.StatementService;
9    import org.kuali.student.core.statement.ui.client.widgets.rules.ReqComponentInfoUi;
10    import org.kuali.student.core.statement.ui.client.widgets.rules.RulesUtil;
11    import org.kuali.student.lum.lu.ui.dependency.client.service.DependencyAnalysisRpcService;
12    import org.kuali.student.lum.program.dto.ProgramRequirementInfo;
13    import org.kuali.student.lum.program.service.ProgramService;
14   
15    import com.google.gwt.user.server.rpc.RemoteServiceServlet;
16   
 
17    public class DependencyAnalysisRpcServlet extends RemoteServiceServlet implements DependencyAnalysisRpcService{
18   
19    private static final long serialVersionUID = 1L;
20   
21    StatementService statementService;
22    ProgramService programService;
23   
 
24  0 toggle @Override
25    public String getRequirementComponentNL(String reqComponentId) {
26  0 return null;
27    }
28   
 
29  0 toggle @Override
30    public List<String> getRequirementComponentNL(List<String> reqComponentIds) throws Exception{
31  0 List<String> reqComponents = new ArrayList<String>();
32  0 for (String reqComponentId:reqComponentIds){
33  0 String reqCompNL = statementService.getNaturalLanguageForReqComponent(reqComponentId, "KUALI.RULE", "en");
34  0 reqComponents.add(reqCompNL);
35    }
36   
37  0 return reqComponents;
38    }
39   
40   
 
41  0 toggle @Override
42    public ProgramRequirementInfo getProgramRequirement(String reqId) throws Exception {
43  0 ProgramRequirementInfo programRequirementInfo = programService.getProgramRequirement(reqId, null, null);
44   
45  0 setProgReqNL(programRequirementInfo);
46  0 return programRequirementInfo;
47    }
48   
 
49  0 toggle public StatementService getStatementService() {
50  0 return statementService;
51    }
52   
 
53  0 toggle public void setStatementService(StatementService statementService) {
54  0 this.statementService = statementService;
55    }
56   
 
57  0 toggle public ProgramService getProgramService() {
58  0 return programService;
59    }
60   
 
61  0 toggle public void setProgramService(ProgramService programService) {
62  0 this.programService = programService;
63    }
64   
 
65  0 toggle private void setProgReqNL(ProgramRequirementInfo programRequirementInfo) throws Exception {
66  0 setReqCompNL(programRequirementInfo.getStatement());
67    }
68   
 
69  0 toggle private void setReqCompNL(StatementTreeViewInfo tree) throws Exception {
70  0 List<StatementTreeViewInfo> statements = tree.getStatements();
71  0 List<ReqComponentInfo> reqComponentInfos = tree.getReqComponents();
72   
73  0 if ((statements != null) && (statements.size() > 0)) {
74    // retrieve all statements
75  0 for (StatementTreeViewInfo statement : statements) {
76  0 setReqCompNL(statement); // inside set the children of this statementTreeViewInfo
77    }
78  0 } else if ((reqComponentInfos != null) && (reqComponentInfos.size() > 0)) {
79    // retrieve all req. component LEAFS
80  0 for (int i = 0; i < reqComponentInfos.size(); i++) {
81  0 ReqComponentInfoUi reqUi = RulesUtil.clone(reqComponentInfos.get(i));
82  0 reqUi.setNaturalLanguageTranslation(statementService.translateReqComponentToNL(reqUi, "KUALI.RULE", "en"));
83  0 reqUi.setPreviewNaturalLanguageTranslation(statementService.translateReqComponentToNL(reqUi, "KUALI.RULE.PREVIEW", "en"));
84  0 reqComponentInfos.set(i, reqUi);
85    }
86    }
87    }
88   
89    }