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 static org.junit.Assert.fail; |
9 |
|
|
|
|
| 57.1% |
Uncovered Elements: 9 (21) |
Complexity: 3 |
Complexity Density: 0.18 |
|
10 |
|
public class TestClusetUiObjectDictionary |
11 |
|
{ |
12 |
|
|
|
|
| 84.6% |
Uncovered Elements: 2 (13) |
Complexity: 2 |
Complexity Density: 0.18 |
1
PASS
|
|
13 |
1
|
@Test... |
14 |
|
public void testLoadCluSetInfoDictionary () |
15 |
|
{ |
16 |
1
|
Set<String> startingClasses = new LinkedHashSet (); |
17 |
1
|
startingClasses.add ("cluset"); |
18 |
1
|
startingClasses.add ("courseSet"); |
19 |
1
|
startingClasses.add ("programSet"); |
20 |
1
|
startingClasses.add ("testSet"); |
21 |
1
|
String contextFile = "ks-cluset-ui-object-dictionary-context"; |
22 |
1
|
String outFile = "target/" + contextFile + ".txt"; |
23 |
1
|
DictionaryTesterHelper helper = new DictionaryTesterHelper (outFile, |
24 |
|
startingClasses, |
25 |
|
contextFile |
26 |
|
+ ".xml", |
27 |
|
true); |
28 |
1
|
List<String> errors = helper.doTest (); |
29 |
1
|
if (errors.size () > 0) |
30 |
|
{ |
31 |
0
|
fail ("failed dictionary validation:\n" + formatAsString (errors)); |
32 |
|
} |
33 |
|
} |
34 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
35 |
0
|
private String formatAsString (List<String> errors)... |
36 |
|
{ |
37 |
0
|
int i = 0; |
38 |
0
|
StringBuilder builder = new StringBuilder (); |
39 |
0
|
for (String error : errors) |
40 |
|
{ |
41 |
0
|
i ++; |
42 |
0
|
builder.append (i + ". " + error + "\n"); |
43 |
|
} |
44 |
0
|
return builder.toString (); |
45 |
|
} |
46 |
|
} |