Package org.springframework.context.support

Examples of org.springframework.context.support.StaticApplicationContext


    @Before
    public void setUp() throws Exception {
        messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
        XMLUnit.setIgnoreWhitespace(true);
        applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("mapping", AnnotationActionEndpointMapping.class);
      applicationContext.registerSingleton("interceptor", MyInterceptor.class);
      applicationContext.registerSingleton("endpoint", MyEndpoint.class);
      applicationContext.refresh();
        mapping = (AnnotationActionEndpointMapping) applicationContext.getBean("mapping");
View Full Code Here


*/
public class MapBasedSoapEndpointMappingTest {

    @Test
    public void testBeanNames() throws Exception {
        StaticApplicationContext context = new StaticApplicationContext();
        context.registerSingleton("endpointMapping", MyMapBasedEndpointMapping.class);
        context.registerSingleton("endpoint", Object.class);
        context.registerAlias("endpoint", "alias");
        MyMapBasedEndpointMapping mapping = new MyMapBasedEndpointMapping();
        mapping.setValidKeys(new String[]{"endpoint", "alias"});

        mapping.setRegisterBeanNames(true);
        mapping.setApplicationContext(context);
View Full Code Here

    }

    @Test
    public void testDisabledBeanNames() throws Exception {
        StaticApplicationContext context = new StaticApplicationContext();
        context.registerSingleton("endpoint", Object.class);

        MyMapBasedEndpointMapping mapping = new MyMapBasedEndpointMapping();

        mapping.setRegisterBeanNames(true);
        mapping.setApplicationContext(context);
View Full Code Here

        MyMapBasedEndpointMapping mapping = new MyMapBasedEndpointMapping();
        mapping.setValidKeys(new String[]{"endpoint1", "endpoint2"});

        mapping.setEndpointMap(endpointMap);
        mapping.setApplicationContext(new StaticApplicationContext());

        // try endpoint1
        mapping.setKey("endpoint1");
        Assert.assertNotNull("No endpoint returned", mapping.getEndpointInternal(null));
View Full Code Here

        assertEquals("Unexpected EndpointInterceptor returned", interceptor, result.getInterceptors()[0]);
    }

    @Test
    public void smartEndpointInterceptors() throws Exception {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("smartInterceptor", MySmartEndpointInterceptor.class);

        final Object endpoint = new Object();
        EndpointInterceptor interceptor = new EndpointInterceptorAdapter();
        AbstractEndpointMapping mapping = new AbstractEndpointMapping() {
            @Override
View Full Code Here

                result.getInterceptors()[1] instanceof MySmartEndpointInterceptor);
    }

    @Test
    public void endpointBeanName() throws Exception {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("endpoint", Object.class);

        AbstractEndpointMapping mapping = new AbstractEndpointMapping() {

            @Override
            protected Object getEndpointInternal(MessageContext message) throws Exception {
View Full Code Here

        assertNotNull("No endpoint returned", result);
    }

    @Test
    public void endpointInvalidBeanName() throws Exception {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("endpoint", Object.class);

        AbstractEndpointMapping mapping = new AbstractEndpointMapping() {

            @Override
            protected Object getEndpointInternal(MessageContext message) throws Exception {
View Full Code Here

        assertNull("No endpoint returned", result);
    }

    @Test
    public void endpointPrototype() throws Exception {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerPrototype("endpoint", MyEndpoint.class);

        AbstractEndpointMapping mapping = new AbstractEndpointMapping() {

            @Override
            protected Object getEndpointInternal(MessageContext message) throws Exception {
View Full Code Here

    private StaticApplicationContext applicationContext;

    @Before
    public void setUp() throws Exception {
        applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("mapping", SoapActionAnnotationMethodEndpointMapping.class);
        applicationContext.registerSingleton("endpoint", MyEndpoint.class);
        applicationContext.refresh();
        mapping = (SoapActionAnnotationMethodEndpointMapping) applicationContext.getBean("mapping");
    }
View Full Code Here

    @Override
    public void setUp() throws Exception {
        super.setUp();

        sac = new StaticApplicationContext();
        loadConfigurationProviders(new StubConfigurationProvider() {

            @Override
            public void register(ContainerBuilder builder,
                    LocatableProperties props) throws ConfigurationException {
View Full Code Here

TOP

Related Classes of org.springframework.context.support.StaticApplicationContext

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.