Package org.springframework.context.support

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


  }

  public void testClassPathXmlApplicationContext() throws IOException {
    ApplicationContext context = new ClassPathXmlApplicationContext(
        "/org/springframework/web/context/WEB-INF/applicationContext.xml");
    assertTrue("Has father", context.containsBean("father"));
    assertTrue("Has rod", context.containsBean("rod"));
    assertFalse("Hasn't kerry", context.containsBean("kerry"));
    assertTrue("Doesn't have spouse", ((TestBean) context.getBean("rod")).getSpouse() == null);
    assertTrue("myinit not evaluated", "Roderick".equals(((TestBean) context.getBean("rod")).getName()));
View Full Code Here


  public void testClassPathXmlApplicationContext() throws IOException {
    ApplicationContext context = new ClassPathXmlApplicationContext(
        "/org/springframework/web/context/WEB-INF/applicationContext.xml");
    assertTrue("Has father", context.containsBean("father"));
    assertTrue("Has rod", context.containsBean("rod"));
    assertFalse("Hasn't kerry", context.containsBean("kerry"));
    assertTrue("Doesn't have spouse", ((TestBean) context.getBean("rod")).getSpouse() == null);
    assertTrue("myinit not evaluated", "Roderick".equals(((TestBean) context.getBean("rod")).getName()));

    context = new ClassPathXmlApplicationContext(new String[] {
View Full Code Here

  public void testClassPathXmlApplicationContext() throws IOException {
    ApplicationContext context = new ClassPathXmlApplicationContext(
        "/org/springframework/web/context/WEB-INF/applicationContext.xml");
    assertTrue("Has father", context.containsBean("father"));
    assertTrue("Has rod", context.containsBean("rod"));
    assertFalse("Hasn't kerry", context.containsBean("kerry"));
    assertTrue("Doesn't have spouse", ((TestBean) context.getBean("rod")).getSpouse() == null);
    assertTrue("myinit not evaluated", "Roderick".equals(((TestBean) context.getBean("rod")).getName()));

    context = new ClassPathXmlApplicationContext(new String[] {
      "/org/springframework/web/context/WEB-INF/applicationContext.xml",
View Full Code Here

    assertTrue("myinit not evaluated", "Roderick".equals(((TestBean) context.getBean("rod")).getName()));

    context = new ClassPathXmlApplicationContext(new String[] {
      "/org/springframework/web/context/WEB-INF/applicationContext.xml",
      "/org/springframework/web/context/WEB-INF/context-addition.xml" });
    assertTrue("Has father", context.containsBean("father"));
    assertTrue("Has rod", context.containsBean("rod"));
    assertTrue("Has kerry", context.containsBean("kerry"));
  }

  public void testSingletonDestructionOnStartupFailure() throws IOException {
View Full Code Here

    context = new ClassPathXmlApplicationContext(new String[] {
      "/org/springframework/web/context/WEB-INF/applicationContext.xml",
      "/org/springframework/web/context/WEB-INF/context-addition.xml" });
    assertTrue("Has father", context.containsBean("father"));
    assertTrue("Has rod", context.containsBean("rod"));
    assertTrue("Has kerry", context.containsBean("kerry"));
  }

  public void testSingletonDestructionOnStartupFailure() throws IOException {
    try {
View Full Code Here

    context = new ClassPathXmlApplicationContext(new String[] {
      "/org/springframework/web/context/WEB-INF/applicationContext.xml",
      "/org/springframework/web/context/WEB-INF/context-addition.xml" });
    assertTrue("Has father", context.containsBean("father"));
    assertTrue("Has rod", context.containsBean("rod"));
    assertTrue("Has kerry", context.containsBean("kerry"));
  }

  public void testSingletonDestructionOnStartupFailure() throws IOException {
    try {
      new ClassPathXmlApplicationContext(new String[] {
View Full Code Here

public class ComponentScanParserWithUserDefinedStrategiesTests extends AbstractDependencyInjectionSpringContextTests {

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

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