Clover Coverage Report - Kuali Student 1.2-M5-SNAPSHOT (Aggregated)
Coverage timestamp: Mon Aug 29 2011 05:04:27 EDT
../../../../../../../../../img/srcFileCovDistChart0.png 42% of files have more coverage
22   97   14   2
2   82   0.64   11
11     1.27  
1    
 
  CluSetDataService       Line # 26 22 0% 14 35 0% 0.0
 
No Tests
 
1    package org.kuali.student.lum.lu.ui.tools.server.gwt;
2   
3    import java.util.List;
4    import java.util.Map;
5   
6    import org.apache.log4j.Logger;
7    import org.kuali.student.common.assembly.data.AssemblyException;
8    import org.kuali.student.common.assembly.data.Data;
9    import org.kuali.student.common.assembly.data.Metadata;
10    import org.kuali.student.common.assembly.dictionary.MetadataServiceImpl;
11    import org.kuali.student.common.assembly.old.Assembler;
12    import org.kuali.student.common.assembly.old.data.SaveResult;
13    import org.kuali.student.common.assembly.transform.MetadataFilter;
14    import org.kuali.student.common.assembly.transform.TransformFilter;
15    import org.kuali.student.common.exceptions.DataValidationErrorException;
16    import org.kuali.student.common.exceptions.DoesNotExistException;
17    import org.kuali.student.common.exceptions.InvalidParameterException;
18    import org.kuali.student.common.exceptions.MissingParameterException;
19    import org.kuali.student.common.exceptions.OperationFailedException;
20    import org.kuali.student.common.rice.authorization.PermissionType;
21    import org.kuali.student.common.ui.client.service.DataSaveResult;
22    import org.kuali.student.common.ui.server.gwt.DataService;
23    import org.kuali.student.common.ui.shared.IdAttributes;
24    import org.kuali.student.common.validation.dto.ValidationResultInfo;
25   
 
26    public class CluSetDataService implements DataService{
27   
28    final static Logger LOG = Logger.getLogger(CluSetDataService.class);
29    private Assembler<Data, Void> assembler;
30    private MetadataServiceImpl metadataService;
31   
 
32  0 toggle public MetadataServiceImpl getMetadataService() {
33  0 return metadataService;
34    }
35   
 
36  0 toggle public void setMetadataService(MetadataServiceImpl metadataService) {
37  0 this.metadataService = metadataService;
38    }
39   
 
40  0 toggle public Assembler<Data, Void> getAssembler() {
41  0 return assembler;
42    }
43   
 
44  0 toggle public void setAssembler(Assembler<Data, Void> assembler) {
45  0 this.assembler = assembler;
46    }
47   
 
48  0 toggle @Override
49    public Data getData(String dataId) throws OperationFailedException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException {
50  0 Data result = null;
51  0 try {
52  0 result = assembler.get(dataId);
53    } catch (Exception e){
54  0 throw new OperationFailedException("Failed to retrieve data from id " + dataId, e);
55    }
56  0 return result;
57    }
58   
 
59  0 toggle @Override
60    public Metadata getMetadata(String id, Map<String,String> idAttributes) {
61  0 Metadata metadata = metadataService.getMetadata(id);
62  0 return metadata;
63    }
64   
 
65  0 toggle protected String getDefaultMetaDataType() {
66  0 return null; //DEFAULT_METADATA_STATE;
67    }
68   
 
69  0 toggle protected String getDefaultMetaDataState() {
70  0 return null; //DEFAULT_METADATA_STATE;
71    }
72   
 
73  0 toggle @Override
74    public Boolean isAuthorized(PermissionType type, Map<String, String> attributes) {
75  0 return new Boolean(true);
76    }
77   
 
78  0 toggle @Override
79    public DataSaveResult saveData(Data data) throws OperationFailedException {
80  0 try {
81  0 SaveResult<Data> saveResult = assembler.save(data);
82  0 if (saveResult != null) {
83  0 return new DataSaveResult(saveResult.getValidationResults(), saveResult.getValue());
84    }
85    } catch (Exception e) {
86  0 LOG.error("Unable to save", e);
87  0 throw new OperationFailedException("Unable to save");
88    }
89  0 return null;
90    }
91   
 
92  0 toggle @Override
93    public List<ValidationResultInfo> validateData(Data data)
94    throws OperationFailedException {
95  0 return null;
96    }
97    }