Example usage for org.springframework.security.config.util InMemoryXmlApplicationContext InMemoryXmlApplicationContext

List of usage examples for org.springframework.security.config.util InMemoryXmlApplicationContext InMemoryXmlApplicationContext

Introduction

In this page you can find the example usage for org.springframework.security.config.util InMemoryXmlApplicationContext InMemoryXmlApplicationContext.

Prototype

public InMemoryXmlApplicationContext(String xml, String secVersion, ApplicationContext parent) 

Source Link

Usage

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

@Test
public void pre32SchemaAreNotSupported() throws Exception {
    try {/*  w w w  . ja  v a 2s.co  m*/
        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"));
    }
}