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.core.dictionary.service.impl.DictionaryTesterHelper; |
8 |
|
import org.kuali.student.lum.course.dto.LoDisplayInfo; |
9 |
|
import org.kuali.student.lum.lo.dto.LoLoRelationInfo; |
10 |
|
import static org.junit.Assert.*; |
11 |
|
|
|
|
| 52.6% |
Uncovered Elements: 9 (19) |
Complexity: 3 |
Complexity Density: 0.2 |
|
12 |
|
public class TestLoDictionary |
13 |
|
{ |
14 |
|
|
|
|
| 81.8% |
Uncovered Elements: 2 (11) |
Complexity: 2 |
Complexity Density: 0.22 |
1
PASS
|
|
15 |
1
|
@Test... |
16 |
|
public void testLoadCluInfoDictionary () |
17 |
|
{ |
18 |
1
|
Set<String> startingClasses = new LinkedHashSet (); |
19 |
1
|
startingClasses.add (LoDisplayInfo.class.getName ()); |
20 |
1
|
startingClasses.add (LoLoRelationInfo.class.getName ()); |
21 |
|
|
22 |
1
|
String contextFile = "ks-loInfo-dictionary-context"; |
23 |
1
|
String outFile = "target/" + contextFile + ".txt"; |
24 |
1
|
DictionaryTesterHelper helper = new DictionaryTesterHelper (outFile, |
25 |
|
startingClasses, |
26 |
|
contextFile |
27 |
|
+ ".xml", |
28 |
|
false); |
29 |
1
|
List<String> errors = helper.doTest (); |
30 |
1
|
if (errors.size () > 0) |
31 |
|
{ |
32 |
0
|
fail ("failed dictionary validation:\n" + formatAsString (errors)); |
33 |
|
} |
34 |
|
} |
35 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
36 |
0
|
private String formatAsString (List<String> errors)... |
37 |
|
{ |
38 |
0
|
int i = 0; |
39 |
0
|
StringBuilder builder = new StringBuilder (); |
40 |
0
|
for (String error : errors) |
41 |
|
{ |
42 |
0
|
i ++; |
43 |
0
|
builder.append (i + ". " + error + "\n"); |
44 |
|
} |
45 |
0
|
return builder.toString (); |
46 |
|
} |
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
} |