View Javadoc

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  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.common.assembly.data.Metadata;
27  import org.kuali.student.common.assembly.dictionary.old.MetadataServiceImpl;
28  
29  /**
30   *
31   * @author nwright
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 }