Clover Coverage Report - Kuali Student 1.2-M3-SNAPSHOT (Aggregated)
Coverage timestamp: Mon Jun 6 2011 05:02:46 EDT
../../../../../../../../img/srcFileCovDistChart6.png 44% of files have more coverage
22   96   11   2.75
6   65   0.5   8
8     1.38  
1    
 
  DictionaryServiceSpringImpl       Line # 34 22 0% 11 17 52.8% 0.5277778
 
  (2)
 
1    /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10    * software distributed under the License is distributed on an "AS IS"
11    * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12    * or implied. See the License for the specific language governing
13    * permissions and limitations under the License.
14    */
15   
16    package org.kuali.student.common.dictionary.service.impl.old;
17   
18    import java.util.ArrayList;
19    import java.util.HashMap;
20    import java.util.List;
21    import java.util.Map;
22   
23    import javax.jws.WebService;
24   
25    import org.kuali.student.common.dictionary.old.dto.ObjectStructure;
26    import org.kuali.student.common.dictionary.service.old.DictionaryService;
27    import org.springframework.context.ApplicationContext;
28    import org.springframework.context.ConfigurableApplicationContext;
29    import org.springframework.context.support.ClassPathXmlApplicationContext;
30    import org.springframework.util.StringUtils;
31   
32    @WebService(endpointInterface = "org.kuali.student.core.dictionary.service.DictionaryService", serviceName = "DictionaryService", portName = "DictionaryService", targetNamespace = "http://student.kuali.org/wsdl/dictionary")
33    @Deprecated
 
34    public class DictionaryServiceSpringImpl implements DictionaryService {
35   
36    private String[] dictionaryContext;
37    private Map<String, ObjectStructure> objectStructures;
38   
 
39  4 toggle public DictionaryServiceSpringImpl() {
40  4 super();
41    }
42   
 
43  4 toggle public DictionaryServiceSpringImpl(String dictionaryContext) {
44  4 super();
45  4 String[] locations = StringUtils.tokenizeToStringArray(dictionaryContext, ConfigurableApplicationContext.CONFIG_LOCATION_DELIMITERS);
46  4 this.dictionaryContext = locations;
47  4 init();
48    }
49   
 
50  0 toggle public DictionaryServiceSpringImpl(String[] dictionaryContext) {
51  0 super();
52  0 this.dictionaryContext = dictionaryContext;
53  0 init();
54    }
55   
 
56  4 toggle @SuppressWarnings("unchecked")
57    public void init() {
58  4 ApplicationContext ac = new ClassPathXmlApplicationContext(dictionaryContext);
59   
60  4 Map<String, ObjectStructure> beansOfType = (Map<String, ObjectStructure>) ac.getBeansOfType(ObjectStructure.class);
61  4 objectStructures = new HashMap<String, ObjectStructure>();
62  4 for (ObjectStructure objStr : beansOfType.values()){
63    //Only add top level structures
64  195 if(objStr.getId()!=null){
65  0 if(objStr.getId().startsWith("object.")){
66  0 if(!objStr.getId().startsWith("object.field.")){
67  0 objectStructures.put(objStr.getKey(), objStr);
68    }
69    }else{
70  0 objectStructures.put(objStr.getKey(), objStr);
71    }
72    }else{
73  195 objectStructures.put(objStr.getKey(), objStr);
74    }
75    }
76    }
77   
 
78  2 toggle @Override
79    public ObjectStructure getObjectStructure(String objectTypeKey) {
80  2 return objectStructures.get(objectTypeKey);
81    }
82   
 
83  1 toggle @Override
84    public List<String> getObjectTypes() {
85  1 return new ArrayList<String>(objectStructures.keySet());
86    }
87   
 
88  0 toggle public String[] getDictionaryContext() {
89  0 return dictionaryContext;
90    }
91   
 
92  0 toggle public void setDictionaryContext(String[] dictionaryContext) {
93  0 this.dictionaryContext = dictionaryContext;
94    }
95   
96    }