Package org.springframework.context

Examples of org.springframework.context.ConfigurableApplicationContext.containsBean()


    ctx.refresh();
    assertEnvironmentBeanRegistered(ctx);
    assertHasEnvironment(ctx, prodEnv);
    assertEnvironmentAwareInvoked(ctx, ctx.getEnvironment());
    assertThat(ctx.containsBean(DEV_BEAN_NAME), is(false));
    assertThat(ctx.containsBean(PROD_BEAN_NAME), is(true));
  }

  @Test
  public void annotationConfigApplicationContext_withPojos() {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
View Full Code Here


    { // ensure the same works for AbstractRefreshableApplicationContext impls too
      ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(new String[] { xmlLocation },
        false);
      context.getEnvironment().setActiveProfiles(ProfileAnnotatedComponent.PROFILE_NAME);
      context.refresh();
      assertThat(context.containsBean(ProfileAnnotatedComponent.BEAN_NAME), is(true));
      context.close();
    }
  }

View Full Code Here

    try {
      applicationContext = createApplicationContext(
        "/org/springframework/data/gemfire/allowRegionBeanDefinitionOverridesTest.xml");

      assertNotNull(applicationContext);
      assertTrue(applicationContext.containsBean("regionOne"));

      Region appDataRegion = applicationContext.getBean("regionOne", Region.class);

      assertNotNull(appDataRegion);
      assertEquals("AppDataRegion", appDataRegion.getName());
View Full Code Here

    try {
      applicationContext = createApplicationContext("/org/springframework/data/gemfire/enableRegionLookupsTest.xml");

      assertNotNull(applicationContext);
      assertTrue(applicationContext.containsBean("NativeLocalRegion"));
      assertTrue(applicationContext.containsBean("NativePartitionRegion"));
      assertTrue(applicationContext.containsBean("NativeReplicateRegion"));
      assertTrue(applicationContext.containsBean("NativeParentRegion"));
      assertTrue(applicationContext.containsBean("/NativeParentRegion/NativeChildRegion"));
      assertTrue(applicationContext.containsBean("SpringReplicateRegion"));
View Full Code Here

    try {
      applicationContext = createApplicationContext("/org/springframework/data/gemfire/enableRegionLookupsTest.xml");

      assertNotNull(applicationContext);
      assertTrue(applicationContext.containsBean("NativeLocalRegion"));
      assertTrue(applicationContext.containsBean("NativePartitionRegion"));
      assertTrue(applicationContext.containsBean("NativeReplicateRegion"));
      assertTrue(applicationContext.containsBean("NativeParentRegion"));
      assertTrue(applicationContext.containsBean("/NativeParentRegion/NativeChildRegion"));
      assertTrue(applicationContext.containsBean("SpringReplicateRegion"));
View Full Code Here

      applicationContext = createApplicationContext("/org/springframework/data/gemfire/enableRegionLookupsTest.xml");

      assertNotNull(applicationContext);
      assertTrue(applicationContext.containsBean("NativeLocalRegion"));
      assertTrue(applicationContext.containsBean("NativePartitionRegion"));
      assertTrue(applicationContext.containsBean("NativeReplicateRegion"));
      assertTrue(applicationContext.containsBean("NativeParentRegion"));
      assertTrue(applicationContext.containsBean("/NativeParentRegion/NativeChildRegion"));
      assertTrue(applicationContext.containsBean("SpringReplicateRegion"));

      Region nativeLocalRegion = applicationContext.getBean("NativeLocalRegion", Region.class);
View Full Code Here

      assertNotNull(applicationContext);
      assertTrue(applicationContext.containsBean("NativeLocalRegion"));
      assertTrue(applicationContext.containsBean("NativePartitionRegion"));
      assertTrue(applicationContext.containsBean("NativeReplicateRegion"));
      assertTrue(applicationContext.containsBean("NativeParentRegion"));
      assertTrue(applicationContext.containsBean("/NativeParentRegion/NativeChildRegion"));
      assertTrue(applicationContext.containsBean("SpringReplicateRegion"));

      Region nativeLocalRegion = applicationContext.getBean("NativeLocalRegion", Region.class);
View Full Code Here

      assertNotNull(applicationContext);
      assertTrue(applicationContext.containsBean("NativeLocalRegion"));
      assertTrue(applicationContext.containsBean("NativePartitionRegion"));
      assertTrue(applicationContext.containsBean("NativeReplicateRegion"));
      assertTrue(applicationContext.containsBean("NativeParentRegion"));
      assertTrue(applicationContext.containsBean("/NativeParentRegion/NativeChildRegion"));
      assertTrue(applicationContext.containsBean("SpringReplicateRegion"));

      Region nativeLocalRegion = applicationContext.getBean("NativeLocalRegion", Region.class);

      assertNotNull(nativeLocalRegion);
View Full Code Here

      assertTrue(applicationContext.containsBean("NativeLocalRegion"));
      assertTrue(applicationContext.containsBean("NativePartitionRegion"));
      assertTrue(applicationContext.containsBean("NativeReplicateRegion"));
      assertTrue(applicationContext.containsBean("NativeParentRegion"));
      assertTrue(applicationContext.containsBean("/NativeParentRegion/NativeChildRegion"));
      assertTrue(applicationContext.containsBean("SpringReplicateRegion"));

      Region nativeLocalRegion = applicationContext.getBean("NativeLocalRegion", Region.class);

      assertNotNull(nativeLocalRegion);
      assertEquals("NativeLocalRegion", nativeLocalRegion.getName());
View Full Code Here

    try {
      applicationContext = createApplicationContext("/org/springframework/data/gemfire/enableClientRegionLookupsTest.xml");

      assertNotNull(applicationContext);
      assertTrue(applicationContext.containsBean("NativeClientRegion"));
      assertTrue(applicationContext.containsBean("NativeClientParentRegion"));
      assertTrue(applicationContext.containsBean("/NativeClientParentRegion/NativeClientChildRegion"));

      Region nativeClientRegion = applicationContext.getBean("NativeClientRegion", Region.class);
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.