Package org.springframework.context.support

Examples of org.springframework.context.support.ClassPathXmlApplicationContext.refresh()


public class BeanDefinitionOverrideTests {
  @Test
  public void testAllowBeanOverride() {
    ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext();
    applicationContext.setConfigLocation("org/springframework/batch/core/configuration/xml/BeanDefinitionOverrideTests-context.xml");
    applicationContext.refresh();
  }

  @Test
  public void testAllowBeanOverrideFalse() {
    ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext();
View Full Code Here


  @Test
  public void testAllowBeanOverrideFalse() {
    ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext();
    applicationContext.setAllowBeanDefinitionOverriding(false);
    applicationContext.setConfigLocation("org/springframework/batch/core/configuration/xml/BeanDefinitionOverrideTests-context.xml");
    applicationContext.refresh();
  }
}
View Full Code Here

  @Test
  public void dropsEventIfNotForCorrectDomainType() {

    AbstractApplicationContext context = new ClassPathXmlApplicationContext();
    context.refresh();

    SamplePersonEventListener listener = new SamplePersonEventListener();
    context.addApplicationListener(listener);

    context.publishEvent(new BeforeConvertEvent<Person>(new Person("Dave", "Matthews")));
View Full Code Here

    checkDBVersion();

    try {
      ClassPathXmlApplicationContext parentSpringAppContext =
          new ClassPathXmlApplicationContext();
      parentSpringAppContext.refresh();
      ConfigurableListableBeanFactory factory = parentSpringAppContext.
          getBeanFactory();
      factory.registerSingleton("guiceInjector",
          injector);
      factory.registerSingleton("passwordEncoder",
View Full Code Here

    @Test
    public void testCustomPasswordProvider() {
        ClassPathXmlApplicationContext appContext =
            new ClassPathXmlApplicationContext("classpath*:/passwordSecurityContext.xml");
        appContext.refresh();

        List<GeoServerPasswordEncoder> encoders =
            GeoServerExtensions.extensions(GeoServerPasswordEncoder.class, appContext);
        boolean found = false;
        for (GeoServerPasswordEncoder enc : encoders) {
View Full Code Here

    @Test
    public void testLoadBusWithApplicationContext() throws BusException {
        ClassPathXmlApplicationContext ctx =
            new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/systest/bus/basic.xml"});
        Bus bus = ctx.getBean("cxf", Bus.class);
        ctx.refresh();
        bus = ctx.getBean("cxf", Bus.class);
        checkBindingExtensions(bus);
        checkHTTPTransportFactories(bus);
        checkOtherCoreExtensions(bus);
        ctx.destroy();
View Full Code Here

public class BusApplicationListenerTest extends Assert {
   
    @Test
    public void testParentApplicationEvent() {
        AbstractRefreshableApplicationContext parent = new ClassPathXmlApplicationContext();
        parent.refresh();
        SpringBusFactory factory = new SpringBusFactory(parent);
        Bus bus = factory.createBus();
        CXFBusLifeCycleManager manager = bus.getExtension(CXFBusLifeCycleManager.class);
        BusLifeCycleListener listener = EasyMock.createMock(BusLifeCycleListener.class);
        manager.registerLifeCycleListener(listener);
View Full Code Here

    context.setConfigLocation("org/springframework/amqp/rabbit/config/MismatchedQueueDeclarationTests-context.xml");
    StandardEnvironment env = new StandardEnvironment();
    env.addActiveProfile("basicAdmin");
    env.addActiveProfile("basic");
    context.setEnvironment(env);
    context.refresh();
    context.getBean(CachingConnectionFactory.class).createConnection();
    context.destroy();
    Channel channel = this.connectionFactory.createConnection().createChannel(false);
    channel.queueDeclarePassive("mismatch.bar");
    this.admin.deleteQueue("mismatch.bar");
View Full Code Here

    env = new StandardEnvironment();
    env.addActiveProfile("basicAdmin");
    env.addActiveProfile("ttl");
    context.setEnvironment(env);
    context.refresh();
    channel = this.connectionFactory.createConnection().createChannel(false);
    try {
      context.getBean(CachingConnectionFactory.class).createConnection();
      fail("Expected exception - basic admin fails with mismatched declarations");
    }
View Full Code Here

    context.setConfigLocation("org/springframework/amqp/rabbit/config/MismatchedQueueDeclarationTests-context.xml");
    StandardEnvironment env = new StandardEnvironment();
    env.addActiveProfile("advancedAdmin");
    env.addActiveProfile("basic");
    context.setEnvironment(env);
    context.refresh();
    context.getBean(CachingConnectionFactory.class).createConnection();
    context.destroy();
    Channel channel = this.connectionFactory.createConnection().createChannel(false);
    channel.queueDeclarePassive("mismatch.bar");
    this.admin.deleteQueue("mismatch.bar");
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.