Clover Coverage Report - KS Common 1.1.0-SNAPSHOT (Aggregated)
Coverage timestamp: Tue Feb 15 2011 04:43:03 EST
26   82   2   13
0   43   0.08   2
2     1  
1    
 
  TestMetadataServiceImpl       Line # 33 26 0% 2 0 100% 1.0
 
  (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.assembly.dictionary.old;
17   
18    import static org.junit.Assert.assertTrue;
19   
20    import java.util.Map;
21   
22    import org.junit.Test;
23    import org.kuali.student.core.assembly.data.Metadata;
24    import org.kuali.student.core.assembly.dictionary.old.MetadataServiceImpl;
25    import org.kuali.student.core.dictionary.service.impl.old.DictionaryServiceSpringImpl;
26   
27    /**
28    * Tests for MetadataServiceImpl
29    *
30    * @author Kuali Student Team
31    *
32    */
 
33    public class TestMetadataServiceImpl {
34   
35    public static final String DICTIONARY_CONFIG_LOCATION = "classpath:messages-test-dictionary-config.xml";
36    public static final String ORCH_DICTIONARY_CONFIG_LOCATION = "classpath:test-orchestration-dictionary.xml";
37   
38   
 
39  1 toggle @Test
40    public void testDictionaryBasedMetadata(){
41  1 MockDictionaryService mockDictionaryService = new MockDictionaryService();
42  1 mockDictionaryService.setDictionaryServiceDelegate(new DictionaryServiceSpringImpl(DICTIONARY_CONFIG_LOCATION));
43   
44  1 MetadataServiceImpl metadataService = new MetadataServiceImpl(mockDictionaryService);
45  1 Metadata metadata = metadataService.getMetadata("Message", "default", "default");
46   
47  1 Map<String, Metadata> properties = metadata.getProperties();
48  1 assertTrue(properties.containsKey("groupName"));
49  1 assertTrue(properties.containsKey("locale"));
50  1 assertTrue(properties.containsKey("value"));
51   
52    }
53   
 
54  1 toggle @Test
55    public void testOrchestrationDictionaryMetadata(){
56  1 MetadataServiceImpl metadataService = new MetadataServiceImpl(ORCH_DICTIONARY_CONFIG_LOCATION);
57   
58  1 Metadata metadata = metadataService.getMetadata("CreditCourseProposal", "default", "default");
59   
60  1 Map<String, Metadata> properties = metadata.getProperties();
61  1 assertTrue(properties.containsKey("course"));
62  1 metadata = properties.get("course");
63   
64  1 properties = metadata.getProperties();
65  1 assertTrue(properties.containsKey("formats"));
66  1 metadata = properties.get("formats");
67   
68  1 properties = metadata.getProperties();
69  1 assertTrue(properties.containsKey("*"));
70  1 metadata = properties.get("*");
71   
72  1 properties = metadata.getProperties();
73  1 assertTrue(properties.containsKey("activities"));
74   
75  1 metadata = metadataService.getMetadata("joints", "default", "default");
76  1 properties = metadata.getProperties();
77   
78  1 metadata = properties.get("_runtimeData");
79  1 properties = metadata.getProperties();
80  1 assertTrue(properties.containsKey("created"));
81    }
82    }