1 17 package org.apache.servicemix.eip.support; 18 19 import org.apache.xbean.spring.context.ClassPathXmlApplicationContext; 20 import org.springframework.context.support.AbstractApplicationContext; 21 22 import junit.framework.TestCase; 23 24 public class NamespaceContextImplTest extends TestCase { 25 26 public void testNsContext() throws Exception { 27 AbstractApplicationContext springContext = new ClassPathXmlApplicationContext("org/apache/servicemix/eip/support/nscontext.xml"); 28 Object objNsContext = springContext.getBean("nsContext"); 29 assertNotNull(objNsContext); 30 assertTrue(objNsContext instanceof NamespaceContextImpl); 31 NamespaceContextImpl nsContext = (NamespaceContextImpl) objNsContext; 32 assertEquals("urn:test", nsContext.getNamespaceURI("test")); 33 assertEquals("test", nsContext.getPrefix("urn:test")); 34 } 35 36 } 37 | Popular Tags |