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) 

Source Link

Usage

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

@Test
public void filterNoClassDefFoundError() throws Exception {
    String className = "javax.servlet.Filter";
    thrown.expect(BeanDefinitionParsingException.class);
    thrown.expectMessage("NoClassDefFoundError: " + className);
    spy(ClassUtils.class);
    doThrow(new NoClassDefFoundError(className)).when(ClassUtils.class, "forName",
            eq(FILTER_CHAIN_PROXY_CLASSNAME), any(ClassLoader.class));
    new InMemoryXmlApplicationContext(XML_AUTHENTICATION_MANAGER + XML_HTTP_BLOCK);
}

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

@Test
public void filterNoClassDefFoundErrorNoHttpBlock() throws Exception {
    String className = "javax.servlet.Filter";
    spy(ClassUtils.class);
    doThrow(new NoClassDefFoundError(className)).when(ClassUtils.class, "forName",
            eq(FILTER_CHAIN_PROXY_CLASSNAME), any(ClassLoader.class));
    new InMemoryXmlApplicationContext(XML_AUTHENTICATION_MANAGER);
    // should load just fine since no http block
}

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

@Test
public void filterChainProxyClassNotFoundException() throws Exception {
    String className = FILTER_CHAIN_PROXY_CLASSNAME;
    thrown.expect(BeanDefinitionParsingException.class);
    thrown.expectMessage("ClassNotFoundException: " + className);
    spy(ClassUtils.class);
    doThrow(new ClassNotFoundException(className)).when(ClassUtils.class, "forName",
            eq(FILTER_CHAIN_PROXY_CLASSNAME), any(ClassLoader.class));
    new InMemoryXmlApplicationContext(XML_AUTHENTICATION_MANAGER + XML_HTTP_BLOCK);
}

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

@Test
public void filterChainProxyClassNotFoundExceptionNoHttpBlock() throws Exception {
    String className = FILTER_CHAIN_PROXY_CLASSNAME;
    spy(ClassUtils.class);
    doThrow(new ClassNotFoundException(className)).when(ClassUtils.class, "forName",
            eq(FILTER_CHAIN_PROXY_CLASSNAME), any(ClassLoader.class));
    new InMemoryXmlApplicationContext(XML_AUTHENTICATION_MANAGER);
    // should load just fine since no http block
}

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

@Test
public void websocketNotFoundExceptionNoMessageBlock() throws Exception {
    String className = FILTER_CHAIN_PROXY_CLASSNAME;
    spy(ClassUtils.class);
    doThrow(new ClassNotFoundException(className)).when(ClassUtils.class, "forName",
            eq(Message.class.getName()), any(ClassLoader.class));
    new InMemoryXmlApplicationContext(XML_AUTHENTICATION_MANAGER);
    // should load just fine since no websocket block
}