Clover Coverage Report - KS LUM Impl 1.1.0-M10-SNAPSHOT
Coverage timestamp: Fri Dec 17 2010 07:00:10 EST
17   46   3   8.5
2   42   0.18   2
2     1.5  
1    
 
  TestClusetUiObjectDictionary       Line # 10 17 0% 3 9 57.1% 0.5714286
 
  (1)
 
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   
 
10    public class TestClusetUiObjectDictionary
11    {
12   
 
13  1 toggle @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   
 
35  0 toggle 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    }