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