1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.kuali.student.lum.lu.assembly;
16
17 import static org.junit.Assert.assertTrue;
18
19 import java.util.Map;
20
21 import org.junit.After;
22 import org.junit.AfterClass;
23 import org.junit.Before;
24 import org.junit.BeforeClass;
25 import org.junit.Test;
26 import org.kuali.student.r1.common.assembly.data.Metadata;
27 import org.kuali.student.r1.common.assembly.dictionary.old.MetadataServiceImpl;
28
29
30
31
32
33 public class OldMetadataLoaderTest
34 {
35
36 public OldMetadataLoaderTest ()
37 {
38 }
39
40 @BeforeClass
41 public static void setUpClass ()
42 throws Exception
43 {
44 }
45
46 @AfterClass
47 public static void tearDownClass ()
48 throws Exception
49 {
50 }
51
52 @Before
53 public void setUp ()
54 {
55 }
56
57 @After
58 public void tearDown ()
59 {
60 }
61
62 public static final String ORCH_DICTIONARY_CONFIG_LOCATION =
63 "classpath:lum-orchestration-dictionary.xml";
64
65 @Test
66 public void testOrchestrationDictionaryMetadata ()
67 {
68 MetadataServiceImpl metadataService =
69 new MetadataServiceImpl (ORCH_DICTIONARY_CONFIG_LOCATION);
70
71 Metadata metadata =
72 metadataService.getMetadata ("CreditCourseProposal", "default", "default");
73
74 Map<String, Metadata> properties = metadata.getProperties ();
75 assertTrue (properties.containsKey ("course"));
76 metadata = properties.get ("course");
77
78 properties = metadata.getProperties ();
79 assertTrue (properties.containsKey ("formats"));
80 metadata = properties.get ("formats");
81
82 properties = metadata.getProperties ();
83 assertTrue (properties.containsKey ("*"));
84 metadata = properties.get ("*");
85
86 properties = metadata.getProperties ();
87 assertTrue (properties.containsKey ("activities"));
88
89 metadata = metadataService.getMetadata ("joints", "default", "default");
90 properties = metadata.getProperties ();
91
92 metadata = properties.get ("_runtimeData");
93 properties = metadata.getProperties ();
94 assertTrue (properties.containsKey ("created"));
95
96 metadata =
97 metadataService.getMetadata ("BrowseCourseCatalog", "", "");
98 properties = metadata.getProperties();
99 assertTrue (properties.containsKey( ("bySubjectArea")));
100 properties = metadata.getProperties();
101 assertTrue (properties.containsKey( ("bySchoolOrCollege")));
102 }
103
104 }