Package org.springframework.beans.factory.xml

Examples of org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver


        initializeBeanBuilderForClassLoader(classLoader);
    }

    protected void initializeBeanBuilderForClassLoader(ClassLoader classLoader) {
        xmlBeanDefinitionReader.setBeanClassLoader(classLoader);
        namespaceHandlerResolver = new DefaultNamespaceHandlerResolver(this.classLoader);
        readerContext = new XmlReaderContext(beanBuildResource, new FailFastProblemReporter(), new EmptyReaderEventListener(),
                new NullSourceExtractor(), xmlBeanDefinitionReader, namespaceHandlerResolver);
    }
View Full Code Here


    protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) {
        // Spring always creates a new one of these, which takes a fair amount
        // of time on startup (nearly 1/2 second) as it gets created for every
        // spring context on the classpath
        if (nsHandlerResolver == null) {
            nsHandlerResolver = new DefaultNamespaceHandlerResolver();
        }
        reader.setNamespaceHandlerResolver(nsHandlerResolver);
       
        String mode = SystemUtils.getSpringValidationMode();
        if (null != mode) {
View Full Code Here

    protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) {
        // Spring always creates a new one of these, which takes a fair amount
        // of time on startup (nearly 1/2 second) as it gets created for every
        // spring context on the classpath
        if (nsHandlerResolver == null) {
            nsHandlerResolver = new DefaultNamespaceHandlerResolver();
        }
        reader.setNamespaceHandlerResolver(nsHandlerResolver);
       
        String mode = System.getProperty("org.apache.cxf.spring.validation.mode");
        if (mode == null) {
View Full Code Here

    protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) {
        // Spring always creates a new one of these, which takes a fair amount
        // of time on startup (nearly 1/2 second) as it gets created for every
        // spring context on the classpath
        if (nsHandlerResolver == null) {
            nsHandlerResolver = new DefaultNamespaceHandlerResolver();
        }
        reader.setNamespaceHandlerResolver(nsHandlerResolver);
       
        String mode = System.getProperty("org.apache.cxf.spring.validation.mode");
        if (mode == null) {
View Full Code Here

    protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) {
        // Spring always creates a new one of these, which takes a fair amount
        // of time on startup (nearly 1/2 second) as it gets created for every
        // spring context on the classpath
        if (nsHandlerResolver == null) {
            nsHandlerResolver = new DefaultNamespaceHandlerResolver();
        }
        reader.setNamespaceHandlerResolver(nsHandlerResolver);
       
        String mode = SystemUtils.getSpringValidationMode();
        if (null != mode) {
View Full Code Here

*/
public class DefaultNamespaceHandlerResolverTests {

  @Test
  public void testResolvedMappedHandler() {
    DefaultNamespaceHandlerResolver resolver = new DefaultNamespaceHandlerResolver(getClass().getClassLoader());
    NamespaceHandler handler = resolver.resolve("http://www.springframework.org/schema/util");
    assertNotNull("Handler should not be null.", handler);
    assertEquals("Incorrect handler loaded", UtilNamespaceHandler.class, handler.getClass());
  }
View Full Code Here

    assertEquals("Incorrect handler loaded", UtilNamespaceHandler.class, handler.getClass());
  }

  @Test
  public void testResolvedMappedHandlerWithNoArgCtor() {
    DefaultNamespaceHandlerResolver resolver = new DefaultNamespaceHandlerResolver();
    NamespaceHandler handler = resolver.resolve("http://www.springframework.org/schema/util");
    assertNotNull("Handler should not be null.", handler);
    assertEquals("Incorrect handler loaded", UtilNamespaceHandler.class, handler.getClass());
  }
View Full Code Here

  @Test
  public void testNonExistentHandlerClass() throws Exception {
    String mappingPath = "org/springframework/beans/factory/xml/support/nonExistent.properties";
    try {
      new DefaultNamespaceHandlerResolver(getClass().getClassLoader(), mappingPath);
      // pass
    }
    catch (Throwable ex) {
      fail("Non-existent handler classes must be ignored: " + ex);
    }
View Full Code Here

  @Test
  public void testResolveInvalidHandler() throws Exception {
    String mappingPath = "org/springframework/beans/factory/xml/support/invalid.properties";
    try {
      new DefaultNamespaceHandlerResolver(getClass().getClassLoader(), mappingPath);
      fail("Should not be able to map a class that doesn't implement NamespaceHandler");
    }
    catch (Throwable expected) {
    }
  }
View Full Code Here

  }

  @Test
  public void testCtorWithNullClassLoaderArgument() throws Exception {
    // simply must not bail...
    new DefaultNamespaceHandlerResolver(null);
  }
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.