Example usage for org.springframework.beans.factory.parsing BeanDefinitionParsingException getMessage

List of usage examples for org.springframework.beans.factory.parsing BeanDefinitionParsingException getMessage

Introduction

In this page you can find the example usage for org.springframework.beans.factory.parsing BeanDefinitionParsingException getMessage.

Prototype

@Override
@Nullable
public String getMessage() 

Source Link

Document

Return the detail message, including the message from the nested exception if there is one.

Usage

From source file:org.springframework.integration.amqp.config.AmqpOutboundChannelAdapterParserTests.java

@Test
public void testInt2971HeaderMapperAndMappedHeadersExclusivity() {
    try {/* w  w w . j  a  v a  2  s . c  o  m*/
        new ClassPathXmlApplicationContext(
                "AmqpOutboundChannelAdapterParserTests-headerMapper-fail-context.xml", this.getClass()).close();
    } catch (BeanDefinitionParsingException e) {
        assertTrue(e.getMessage().startsWith("Configuration problem: The 'header-mapper' attribute "
                + "is mutually exclusive with 'mapped-request-headers' or 'mapped-reply-headers'"));
    }
}

From source file:org.springframework.security.config.SecurityNamespaceHandlerTests.java

@Test
public void pre32SchemaAreNotSupported() throws Exception {
    try {/*from   w w w.j a  v  a  2s . com*/
        new InMemoryXmlApplicationContext("<user-service id='us'>"
                + "  <user name='bob' password='bobspassword' authorities='ROLE_A' />" + "</user-service>",
                "3.0.3", null);
        fail("Expected BeanDefinitionParsingException");
    } catch (BeanDefinitionParsingException expected) {
        assertThat(expected.getMessage().contains("You cannot use a spring-security-2.0.xsd"));
    }
}