Examples of AnnotationConfigApplicationContext


Examples of org.springframework.context.annotation.AnnotationConfigApplicationContext

  }

  @Test
  public void bootstrapJavaConfigContainer() {

    ApplicationContext context = new AnnotationConfigApplicationContext(Config.class);
    MyComponent component = context.getBean(MyComponent.class);
    assertThat(component, is(notNullValue()));

    List<MyPlugin> plugins = component.getPlugins();
    assertThat(plugins.size(), is(2));
  }
View Full Code Here

Examples of org.springframework.context.annotation.AnnotationConfigApplicationContext

  }

  @Test
  public void bootstrapComponentScanContainer() {

    ApplicationContext context = new AnnotationConfigApplicationContext(ComponentScanConfig.class);
    MyComponent component = context.getBean(MyComponent.class);
    assertThat(component, is(notNullValue()));

    List<MyPlugin> plugins = component.getPlugins();
    assertThat(plugins.size(), is(2));
  }
View Full Code Here

Examples of org.springframework.context.annotation.AnnotationConfigApplicationContext

    private WithSecurityContextTestExecutionListener listener;

    @Before
    public void setup() {
        listener = new WithSecurityContextTestExecutionListener();
        context = new AnnotationConfigApplicationContext(Config.class);
    }
View Full Code Here

Examples of org.springframework.context.annotation.AnnotationConfigApplicationContext

        protected void configure(HttpSecurity http) throws Exception {
        }
    }

    private void loadContext(Class<?> configs) {
        AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext();
        annotationConfigApplicationContext.register(configs);
        annotationConfigApplicationContext.refresh();
        this.context = annotationConfigApplicationContext;
    }
View Full Code Here

Examples of org.springframework.context.annotation.AnnotationConfigApplicationContext

                    .withUser("user").password("password").roles("USER");
        }
    }

    private void loadConfig(Class<?>...classes) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
        context.register(classes);
        context.refresh();
        this.context = context;
        this.springSecurityFilterChain = this.context.getBean("springSecurityFilterChain",Filter.class);
    }
View Full Code Here

Examples of org.springframework.context.annotation.AnnotationConfigApplicationContext

public final class MapperScanTest {
  private AnnotationConfigApplicationContext applicationContext;

  @Before
  public void setupContext() {
    applicationContext = new AnnotationConfigApplicationContext();

    setupSqlSessionFactory("sqlSessionFactory");

    // assume support for autowiring fields is added by MapperScannerConfigurer
    // via
View Full Code Here

Examples of org.springframework.context.annotation.AnnotationConfigApplicationContext

        };
    }

    @Test
    public void beanNamesAreCorrectlyResolved() throws Exception {
        handler.setApplicationContext(new AnnotationConfigApplicationContext(TestConfiguration.class));

        Expression expression = handler.getExpressionParser().parseExpression("@number10.compareTo(@number20) < 0");
        assertTrue((Boolean) expression.getValue(handler.createEvaluationContext(mock(Authentication.class), new Object())));
    }
View Full Code Here

Examples of org.springframework.context.annotation.AnnotationConfigApplicationContext

  private ApplicationContext applicationContext;

  @Before
  public void setUp() throws Exception {
    AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
    applicationContext.register(TestConfig.class);
    applicationContext.refresh();

    this.applicationContext = applicationContext;
  }
View Full Code Here

Examples of org.springframework.context.annotation.AnnotationConfigApplicationContext

  private ApplicationContext applicationContext;

  @Before
  public void setUp() throws Exception {
    AnnotationConfigApplicationContext applicationContext =
        new AnnotationConfigApplicationContext();
    applicationContext.register(TestConfig.class);
    applicationContext.refresh();

    this.applicationContext = applicationContext;
  }
View Full Code Here

Examples of org.springframework.context.annotation.AnnotationConfigApplicationContext

  private ApplicationContext applicationContext;

  @Before
  public void setUp() throws Exception {
    AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
    applicationContext.register(TestConfig.class);
    applicationContext.refresh();

    this.applicationContext = applicationContext;
  }
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.