Examples of registerSingleton()


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

    }

    @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

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

    @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

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

    @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

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

public class MockWebServiceClientTest {

    @Test
    public void createServerApplicationContext() throws Exception {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("messageDispatcher", SoapMessageDispatcher.class);
        applicationContext.registerSingleton("messageFactory", SaajSoapMessageFactory.class);
        applicationContext.refresh();

        MockWebServiceClient client = MockWebServiceClient.createClient(applicationContext);
        assertNotNull(client);
View Full Code Here

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

    @Test
    public void createServerApplicationContext() throws Exception {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("messageDispatcher", SoapMessageDispatcher.class);
        applicationContext.registerSingleton("messageFactory", SaajSoapMessageFactory.class);
        applicationContext.refresh();

        MockWebServiceClient client = MockWebServiceClient.createClient(applicationContext);
        assertNotNull(client);
    }
View Full Code Here

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

    }

    @Test
    public void createServerApplicationContextWebServiceTemplate() throws Exception {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("webServiceTemplate", WebServiceTemplate.class);
        applicationContext.refresh();

        MockWebServiceServer server = MockWebServiceServer.createServer(applicationContext);
        assertNotNull(server);
    }
View Full Code Here

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

    }

    @Test
    public void createServerApplicationContextWebServiceGatewaySupport() throws Exception {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("myClient", MyClient.class);
        applicationContext.refresh();

        MockWebServiceServer server = MockWebServiceServer.createServer(applicationContext);
        assertNotNull(server);
    }
View Full Code Here

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

    }

    @Test
    public void one() {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("myBean", MyBean.class);

        MockStrategiesHelper helper = new MockStrategiesHelper(applicationContext);
        assertNotNull(helper.getStrategy(IMyBean.class));
    }
View Full Code Here

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

    }

    @Test(expected = BeanInitializationException.class)
    public void many() {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("myBean1", MyBean.class);
        applicationContext.registerSingleton("myBean2", MyBean.class);

        MockStrategiesHelper helper = new MockStrategiesHelper(applicationContext);
        helper.getStrategy(IMyBean.class);
    }
View Full Code Here

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

    @Test(expected = BeanInitializationException.class)
    public void many() {
        StaticApplicationContext applicationContext = new StaticApplicationContext();
        applicationContext.registerSingleton("myBean1", MyBean.class);
        applicationContext.registerSingleton("myBean2", MyBean.class);

        MockStrategiesHelper helper = new MockStrategiesHelper(applicationContext);
        helper.getStrategy(IMyBean.class);
    }
   
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.