| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.kuali.student.contract.model.validation; |
| 17 |
|
|
| 18 |
|
import org.kuali.student.contract.model.DictionaryModel; |
| 19 |
|
import org.kuali.student.contract.model.OrchObj; |
| 20 |
|
import org.kuali.student.contract.model.util.ModelFinder; |
| 21 |
|
|
| 22 |
|
import java.util.ArrayList; |
| 23 |
|
import java.util.Collection; |
| 24 |
|
import java.util.List; |
| 25 |
|
|
| 26 |
|
|
| 27 |
|
|
| 28 |
|
@author |
| 29 |
|
|
|
|
|
| 0% |
Uncovered Elements: 22 (22) |
Complexity: 6 |
Complexity Density: 0.43 |
|
| 30 |
|
public class OrchestrationModelValidator implements ModelValidator { |
| 31 |
|
|
| 32 |
|
private DictionaryModel model; |
| 33 |
|
private ModelFinder finder; |
| 34 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 35 |
0
|
public OrchestrationModelValidator(DictionaryModel model) {... |
| 36 |
0
|
this.model = model; |
| 37 |
0
|
this.finder = new ModelFinder(model); |
| 38 |
|
} |
| 39 |
|
List<String> errors; |
| 40 |
|
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 41 |
0
|
@Override... |
| 42 |
|
public Collection<String> validate() { |
| 43 |
0
|
errors = new ArrayList(); |
| 44 |
0
|
validateOrchObjs(); |
| 45 |
0
|
errors.addAll(new DictionaryModelValidator(model).validate()); |
| 46 |
0
|
return errors; |
| 47 |
|
} |
| 48 |
|
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
| 49 |
0
|
private void validateOrchObjs() {... |
| 50 |
0
|
if (model.getOrchObjs().size() == 0) { |
| 51 |
0
|
addError("No orchestration objects found"); |
| 52 |
|
} |
| 53 |
0
|
for (OrchObj orch : model.getOrchObjs()) { |
| 54 |
0
|
OrchObjValidator cv = new OrchObjValidator(orch); |
| 55 |
0
|
errors.addAll(cv.validate()); |
| 56 |
|
} |
| 57 |
|
} |
| 58 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 59 |
0
|
private void addError(String msg) {... |
| 60 |
0
|
String error = "Error in orchestration dictionary spreadsheet: " + msg; |
| 61 |
0
|
if (!errors.contains(error)) { |
| 62 |
0
|
errors.add(error); |
| 63 |
|
} |
| 64 |
|
} |
| 65 |
|
} |