Package org.springframework.context.support

Examples of org.springframework.context.support.GenericXmlApplicationContext.load()


  }

  private void repro(String xml) {
    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.getEnvironment().setIgnoreUnresolvableNestedPlaceholders(true);
    ctx.load("classpath:org/springframework/issues/" + xml);
    ctx.refresh();

    Foo foo = ctx.getBean(Foo.class);
    assertEquals(foo.getAbc(), "${none}");
    assertEquals(foo.getAbc2(), "test");
View Full Code Here


    StopWatch stopWatch = new StopWatch("Prototyped Bean Creation");
   
    // initial load
        stopWatch.start("Initializing");
        GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
        ctx.load("classpath:org/springframework/issues/ReproTests-context.xml");
        ctx.refresh();
    ctx.getBean("ParentBeanGroup");
    stopWatch.stop();
   
    stopWatch.start("Creating");
View Full Code Here

  @Test
  public void testJmsConnectionFactory() {
    GenericXmlApplicationContext applicationContext = new GenericXmlApplicationContext();
    applicationContext.getEnvironment().setActiveProfiles("test");
    applicationContext.load("/jmsContext.xml");
    applicationContext.refresh();
    String[] profiles = applicationContext.getEnvironment().getActiveProfiles();
    Assert.assertTrue(ArrayUtils.contains(profiles, "test"));
    String[] beanNames = applicationContext.getBeanDefinitionNames();
    Assert.assertTrue(ArrayUtils.contains(beanNames, "jmsConnectionFactory"));
View Full Code Here

public class ReproTests {

  @Test
  public void repro() {
    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.load("classpath:org/springframework/issues/ReproTests-context.xml");
    ctx.refresh();

    Bar bar = ctx.getBean(Bar.class);

    Calendar c = Calendar.getInstance();
View Full Code Here

public class ReproTests {

  @Test
  public void repro() {
    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.load("classpath:org/springframework/issues/ReproTests-context.xml");
    ctx.refresh();

    // First time works
    Bar bar = ctx.getBean(Bar.class);
    bar.getFoo().getProviderClass();
View Full Code Here

public class ReproTests {

  @Test
  public void repro() {
    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.load("classpath:org/springframework/issues/ReproTests-context.xml");
    ctx.refresh();
    File file = ctx.getBean("theFile", File.class);
    assertTrue(file.exists());
  }
View Full Code Here

    }
  }

  private void reproOnce(int threads) throws Exception {
    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.load("classpath:org/springframework/issues/ReproTests-context.xml");
    ctx.refresh();

    List<Foo> foos = getFoos(ctx, threads);
    for (Foo foo : foos) {
      assertThat(foo.getBar(), CoreMatchers.notNullValue());
View Full Code Here

public class ReproTests {

  @Test
  public void repro() {
    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.load("classpath:org/springframework/issues/ReproTests-context.xml");
    ctx.refresh();

    Foo foo = ctx.getBean(Foo.class);

    assertThat(foo.isMogoSlaveOk(), equalTo(true));
View Full Code Here

public class ReproTests {

  @Test
  public void xml() {
    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.load("classpath:module.xml");
    ctx.refresh();
    Foo foo = ctx.getBean(Foo.class);
    assertNotNull(foo);
    ctx.close();
  }
View Full Code Here

    Appender appender = nothingLoggedAppender();
    logger.addAppender(appender);
    try {
      GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
      ctx.load("classpath:org/springframework/issues/ReproTests-context.xml");
      ctx.refresh();

      ctx.getBean("foo");

      ctx.close();
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.