Package org.springframework.context.support

Examples of org.springframework.context.support.FileSystemXmlApplicationContext


     * @throws Exception
     */
    public void testHelloOperationMixed() throws Exception {
        URL url = getClass().getResource("applicationContextOnlyXml.xml");

        FileSystemXmlApplicationContext context = new FileSystemXmlApplicationContext(url.toString());

        Dispatcher dispatcher = (Dispatcher) context.getBean("dispatcher");

        final String body = "<Hello service=\"hello\" message=\"Hello world!\" version=\"1.0.0\" />";

        MockHttpServletRequest request = new MockHttpServletRequest() {
                String encoding;
View Full Code Here


    }
   
    public void testHttpErrorCodeException() throws Exception {
        URL url = getClass().getResource("applicationContext.xml");

        FileSystemXmlApplicationContext context = new FileSystemXmlApplicationContext(url.toString());

        Dispatcher dispatcher = (Dispatcher) context.getBean("dispatcher");

        MockHttpServletRequest request = new MockHttpServletRequest() {
                String encoding;

                public int getServerPort() {
View Full Code Here

public class ParserBeanFactory {
  private static ApplicationContext CONTEXT;

  public static ApplicationContext getContext() {
    if (CONTEXT == null)
      CONTEXT = new FileSystemXmlApplicationContext("beans/parserBeans.xml");
    return CONTEXT;
  }
View Full Code Here

public class PropertyPlaceholderTest extends TestCase {

    public void test() throws Throwable {
        System.setProperty("port2", "3333");
       
        FileSystemXmlApplicationContext ctx = new FileSystemXmlApplicationContext(
                "src/test/resources/spring-config/config-property-placeholder.xml");

        DefaultFtpServer server = (DefaultFtpServer) ctx.getBean("server");

        assertEquals(2222, server.getListener("listener0").getPort());
        assertEquals(3333, server.getListener("listener1").getPort());
    }
View Full Code Here

  /* (non-Javadoc)
   * @see org.springframework.test.AbstractSpringContextTests#loadContextLocations(java.lang.String[])
   */
  protected ConfigurableApplicationContext loadContextLocations(String[] paths) {
    return new FileSystemXmlApplicationContext(paths);
  }
View Full Code Here

    private ApplicationContext getApplicationContext() {
        String[] paths = new String[] {
                "./business/src/resources/applicationContext-db.xml",
                "./business/src/resources/applicationContext.xml" };

        return new FileSystemXmlApplicationContext(paths);
    }
View Full Code Here

            throws BeansException {
        ctx = applicationContext;
    }

    public static void main(String[] args) {
        ApplicationContext ctx = new FileSystemXmlApplicationContext(
                "./ch5/src/conf/appContext/aware.xml");
       
        ContextAwareDemo demo = (ContextAwareDemo) ctx.getBean("contextAware");
        demo.displayAppContext();
    }
View Full Code Here

* @author robh
*/
public class MessageSourceDemo {

    public static void main(String[] args) {
        ApplicationContext ctx = new FileSystemXmlApplicationContext(
                "./ch5/src/conf/appContext/messageSource.xml");

        Locale english = Locale.ENGLISH;
        Locale czech = new Locale("cs", "CZ");

        System.out.println(ctx.getMessage("msg", null, english));
        System.out.println(ctx.getMessage("msg", null, czech));
       
        System.out.println(ctx.getMessage("nameMsg", new Object[] { "Rob",
                "Harrop" }, english));
    }
View Full Code Here

* @author robh
*/
public class LazyInitDemo {

    public static void main(String[] args) {
        ApplicationContext ctx = new FileSystemXmlApplicationContext(
                "./ch5/src/conf/appContext/lazy.xml");

        DestructiveBeanWithInterface bean = (DestructiveBeanWithInterface) ctx
                .getBean("destructiveBean");
    }
View Full Code Here

    sender.send(msg);
  }

  public static void main(String[] args) throws Exception {
    ApplicationContext ctx = new FileSystemXmlApplicationContext(
        new String[] { "./ch15/src/conf/simpleHtmlMessageSender.xml",
            "./ch15/src/conf/javaMailSender.xml" });

    SimpleHtmlMessageSender sender = (SimpleHtmlMessageSender) ctx
        .getBean("messageSender");
    sender.sendMessage();
  }
View Full Code Here

TOP

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

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.