Package org.springframework.context.support

Examples of org.springframework.context.support.StaticApplicationContext.registerSingleton()


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"});
View Full Code Here


    @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);
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

    }

    @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

    }

    @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

    }

    @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

    @Test
    public void runAsManagerIsSetCorrectly() throws Exception {
        StaticApplicationContext parent = new StaticApplicationContext();
        MutablePropertyValues props = new MutablePropertyValues();
        props.addPropertyValue("key", "blah");
        parent.registerSingleton("runAsMgr", RunAsManagerImpl.class, props);
        parent.refresh();

        setContext("<global-method-security run-as-manager-ref='runAsMgr'/>" + AUTH_PROVIDER_XML, parent);
        RunAsManagerImpl ram = (RunAsManagerImpl) appContext.getBean("runAsMgr");
        MethodSecurityMetadataSourceAdvisor msi = (MethodSecurityMetadataSourceAdvisor)
View Full Code Here

    }

    @Test
    public void testDetectStrategies() throws Exception {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("mapping", PayloadRootQNameEndpointMapping.class);
        applicationContext.registerSingleton("adapter", PayloadEndpointAdapter.class);
        applicationContext.registerSingleton("resolver", SimpleSoapExceptionResolver.class);
        dispatcher.setApplicationContext(applicationContext);
        Assert.assertEquals("Invalid amount of mappings detected", 1, dispatcher.getEndpointMappings().size());
        Assert.assertTrue("Invalid mappings detected",
View Full Code Here

    @Test
    public void testDetectStrategies() throws Exception {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("mapping", PayloadRootQNameEndpointMapping.class);
        applicationContext.registerSingleton("adapter", PayloadEndpointAdapter.class);
        applicationContext.registerSingleton("resolver", SimpleSoapExceptionResolver.class);
        dispatcher.setApplicationContext(applicationContext);
        Assert.assertEquals("Invalid amount of mappings detected", 1, dispatcher.getEndpointMappings().size());
        Assert.assertTrue("Invalid mappings detected",
                dispatcher.getEndpointMappings().get(0) instanceof PayloadRootQNameEndpointMapping);
View Full Code Here

    @Test
    public void testDetectStrategies() throws Exception {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("mapping", PayloadRootQNameEndpointMapping.class);
        applicationContext.registerSingleton("adapter", PayloadEndpointAdapter.class);
        applicationContext.registerSingleton("resolver", SimpleSoapExceptionResolver.class);
        dispatcher.setApplicationContext(applicationContext);
        Assert.assertEquals("Invalid amount of mappings detected", 1, dispatcher.getEndpointMappings().size());
        Assert.assertTrue("Invalid mappings detected",
                dispatcher.getEndpointMappings().get(0) instanceof PayloadRootQNameEndpointMapping);
        Assert.assertEquals("Invalid amount of adapters detected", 1, dispatcher.getEndpointAdapters().size());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.