Package

Source Code of Spr8582Tests

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
* Proof of different behaviour using java configuration versus xml configuration
*/
public class Spr8582Tests {

  @Test
  public void testXML() {
    ApplicationContext ctx =
      new ClassPathXmlApplicationContext("applicationcontext.xml");
    System.out.println((ctx.getBean("theOtherBean")));
  }


  @Test
  public void testJavaConfig() {
    ApplicationContext ctx = new AnnotationConfigApplicationContext(Config.class);
    System.out.println((ctx.getBean("theOtherBean")));
  }

}
TOP

Related Classes of Spr8582Tests

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.