Package org.springframework.context.support

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


    System.setProperty("basePackage", "example.scannable, test");
    System.setProperty("scanInclude", "example.scannable.FooService+");
    System.setProperty("scanExclude", "example..Scoped*Test*");
    try {
      ClassPathXmlApplicationContext context = loadContext("aspectjTypeFilterTestsWithPlaceholders.xml");
      assertTrue(context.containsBean("fooServiceImpl"));
      assertTrue(context.containsBean("stubFooDao"));
      assertFalse(context.containsBean("scopedProxyTestBean"));
      context.close();
    }
    finally {
View Full Code Here


    System.setProperty("scanInclude", "example.scannable.FooService+");
    System.setProperty("scanExclude", "example..Scoped*Test*");
    try {
      ClassPathXmlApplicationContext context = loadContext("aspectjTypeFilterTestsWithPlaceholders.xml");
      assertTrue(context.containsBean("fooServiceImpl"));
      assertTrue(context.containsBean("stubFooDao"));
      assertFalse(context.containsBean("scopedProxyTestBean"));
      context.close();
    }
    finally {
      System.clearProperty("basePackage");
View Full Code Here

    System.setProperty("scanExclude", "example..Scoped*Test*");
    try {
      ClassPathXmlApplicationContext context = loadContext("aspectjTypeFilterTestsWithPlaceholders.xml");
      assertTrue(context.containsBean("fooServiceImpl"));
      assertTrue(context.containsBean("stubFooDao"));
      assertFalse(context.containsBean("scopedProxyTestBean"));
      context.close();
    }
    finally {
      System.clearProperty("basePackage");
      System.clearProperty("scanInclude");
View Full Code Here

  }

  @Test
  public void nonMatchingResourcePattern() {
    ClassPathXmlApplicationContext context = loadContext("nonMatchingResourcePatternTests.xml");
    assertFalse(context.containsBean("fooServiceImpl"));
    context.close();
  }

  @Test
  public void matchingResourcePattern() {
View Full Code Here

  }

  @Test
  public void matchingResourcePattern() {
    ClassPathXmlApplicationContext context = loadContext("matchingResourcePatternTests.xml");
    assertTrue(context.containsBean("fooServiceImpl"));
    context.close();
  }

  @Test
  public void componentScanWithAutowiredQualifier() {
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

  @Test
  public void testCustomBeanNameGenerator() {
    ApplicationContext context = new ClassPathXmlApplicationContext(
        "org/springframework/context/annotation/customNameGeneratorTests.xml");
    assertTrue(context.containsBean("testing.fooServiceImpl"));
  }

  @Test
  public void testCustomScopeMetadataResolver() {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
View Full Code Here

public class ComponentScanParserTests extends TestCase {

  public void testAspectJTypeFilter() {
    ApplicationContext context = new ClassPathXmlApplicationContext(
        "org/springframework/context/annotation/aspectjTypeFilterTests.xml");
    assertTrue(context.containsBean("fooServiceImpl"));
    assertTrue(context.containsBean("stubFooDao"));
    assertFalse(context.containsBean("scopedProxyTestBean"));
  }

  public void testNonMatchingResourcePattern() {
View Full Code Here

  public void testAspectJTypeFilter() {
    ApplicationContext context = new ClassPathXmlApplicationContext(
        "org/springframework/context/annotation/aspectjTypeFilterTests.xml");
    assertTrue(context.containsBean("fooServiceImpl"));
    assertTrue(context.containsBean("stubFooDao"));
    assertFalse(context.containsBean("scopedProxyTestBean"));
  }

  public void testNonMatchingResourcePattern() {
    ApplicationContext context = new ClassPathXmlApplicationContext(
View Full Code Here

  public void testAspectJTypeFilter() {
    ApplicationContext context = new ClassPathXmlApplicationContext(
        "org/springframework/context/annotation/aspectjTypeFilterTests.xml");
    assertTrue(context.containsBean("fooServiceImpl"));
    assertTrue(context.containsBean("stubFooDao"));
    assertFalse(context.containsBean("scopedProxyTestBean"));
  }

  public void testNonMatchingResourcePattern() {
    ApplicationContext context = new ClassPathXmlApplicationContext(
        "org/springframework/context/annotation/nonMatchingResourcePatternTests.xml");
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.