| 1 |
|
package org.kuali.student.lum.course.service.impl; |
| 2 |
|
|
| 3 |
|
import java.util.LinkedHashSet; |
| 4 |
|
import java.util.List; |
| 5 |
|
import java.util.Set; |
| 6 |
|
import org.junit.Test; |
| 7 |
|
import org.kuali.student.common.dictionary.service.impl.DictionaryTesterHelper; |
| 8 |
|
import org.kuali.student.lum.lrc.dto.CredentialInfo; |
| 9 |
|
import org.kuali.student.lum.lrc.dto.CreditInfo; |
| 10 |
|
import org.kuali.student.lum.lrc.dto.GradeInfo; |
| 11 |
|
import org.kuali.student.lum.lrc.dto.ResultComponentInfo; |
| 12 |
|
import org.kuali.student.lum.lrc.dto.ScaleInfo; |
| 13 |
|
import static org.junit.Assert.*; |
| 14 |
|
|
|
|
|
| 59.1% |
Uncovered Elements: 9 (22) |
Complexity: 3 |
Complexity Density: 0.17 |
|
| 15 |
|
public class TestLrcDictionary |
| 16 |
|
{ |
| 17 |
|
|
|
|
|
| 85.7% |
Uncovered Elements: 2 (14) |
Complexity: 2 |
Complexity Density: 0.17 |
1
PASS
|
|
| 18 |
1
|
@Test... |
| 19 |
|
public void testLoadLrcDictionary () |
| 20 |
|
{ |
| 21 |
1
|
Set<String> startingClasses = new LinkedHashSet (); |
| 22 |
1
|
startingClasses.add (ResultComponentInfo.class.getName ()); |
| 23 |
1
|
startingClasses.add (CreditInfo.class.getName ()); |
| 24 |
1
|
startingClasses.add (CredentialInfo.class.getName ()); |
| 25 |
1
|
startingClasses.add (ScaleInfo.class.getName ()); |
| 26 |
1
|
startingClasses.add (GradeInfo.class.getName ()); |
| 27 |
1
|
String contextFile = "ks-lrc-dictionary-context"; |
| 28 |
1
|
String outFile = "target/" + contextFile + ".txt"; |
| 29 |
1
|
DictionaryTesterHelper helper = new DictionaryTesterHelper (outFile, |
| 30 |
|
startingClasses, |
| 31 |
|
contextFile |
| 32 |
|
+ ".xml", |
| 33 |
|
false); |
| 34 |
1
|
List<String> errors = helper.doTest (); |
| 35 |
1
|
if (errors.size () > 0) |
| 36 |
|
{ |
| 37 |
0
|
fail ("failed dictionary validation:\n" + formatAsString (errors)); |
| 38 |
|
} |
| 39 |
|
} |
| 40 |
|
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
| 41 |
0
|
private String formatAsString (List<String> errors)... |
| 42 |
|
{ |
| 43 |
0
|
int i = 0; |
| 44 |
0
|
StringBuilder builder = new StringBuilder (); |
| 45 |
0
|
for (String error : errors) |
| 46 |
|
{ |
| 47 |
0
|
i ++; |
| 48 |
0
|
builder.append (i + ". " + error + "\n"); |
| 49 |
|
} |
| 50 |
0
|
return builder.toString (); |
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
|
| 54 |
|
|
| 55 |
|
} |