View Javadoc
1   /*
2    * Copyright 2010 the original author or authors.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *     
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.openehealth.ipf.modules.hl7.config;
17  
18  import static org.junit.Assert.assertEquals;
19  import static org.junit.Assert.assertTrue;
20  
21  import java.util.Map;
22  
23  import org.junit.Test;
24  import org.junit.runner.RunWith;
25  import org.springframework.beans.factory.annotation.Autowired;
26  import org.springframework.test.context.ContextConfiguration;
27  import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
28  
29  @RunWith(SpringJUnit4ClassRunner.class)
30  @ContextConfiguration(locations = { "/context-custom-configurer.xml",
31  		"/context-custom-classes.xml" })
32  public class CustomModelClassFactoryConfigurerTest {
33  
34      @Autowired
35      private CustomModelClassFactoryConfigurer<?> configurer;
36      
37      @Test
38      public void testMappings() {
39      	Map<String, String[]> map = configurer.getCustomModelClassFactory().getCustomModelClasses();
40      	assertTrue(map.containsKey("2.5"));
41      	assertEquals("org.openehealth.ipf.modules.hl7.parser.test.hl7v2.def.v25", map.get("2.5")[0]);
42      }	
43  }