Package org.springframework.context.support

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


  }

  public void testNonMatchingResourcePattern() {
    ApplicationContext context = new ClassPathXmlApplicationContext(
        "org/springframework/context/annotation/nonMatchingResourcePatternTests.xml");
    assertFalse(context.containsBean("fooServiceImpl"));
  }

  public void testMatchingResourcePattern() {
    ApplicationContext context = new ClassPathXmlApplicationContext(
        "org/springframework/context/annotation/matchingResourcePatternTests.xml");
View Full Code Here


  }

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

  public void testComponentScanWithAutowiredQualifier() {
    ApplicationContext context = new ClassPathXmlApplicationContext(
        "org/springframework/context/annotation/componentScanWithAutowiredQualifierTests.xml");
View Full Code Here

public class BootstrapTests {

  @Test
  public void testBootstrapConfiguration() throws Exception {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath*:/META-INF/spring/batch/bootstrap/**/*.xml");
    assertTrue(context.containsBean("jobRepository"));
    context.close();
  }

  @Test
  public void testWebappRootConfiguration() throws Exception {
View Full Code Here

  @Test
  public void testWebappRootConfiguration() throws Exception {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
        "classpath:/org/springframework/batch/admin/web/resources/webapp-config.xml");
    assertTrue(context.containsBean("jobRepository"));
    context.close();
  }

  @Test
  public void testServletConfiguration() throws Exception {
View Full Code Here

    ClassPathXmlApplicationContext parent = new ClassPathXmlApplicationContext(
        "classpath:/org/springframework/batch/admin/web/resources/webapp-config.xml");
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
        new String[] { "classpath:/org/springframework/batch/admin/web/resources/servlet-config.xml" }, parent);

    assertTrue(context.containsBean("jobRepository"));
    String[] beanNames = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(context.getBeanFactory(),
        JobController.class);
    assertEquals(1, beanNames.length);

    Job job = context.getBean(JobRegistry.class).getJob("job1");
View Full Code Here

  @Test
  public void testBootstrapConfiguration() throws Exception {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {
        ClassUtils.addResourcePathToPackagePath(getClass(), "dummy-context.xml"),
        "classpath:/META-INF/spring/batch/bootstrap/**/*.xml" });
    assertTrue(context.containsBean("jobRepository"));
    context.close();
  }

  @Test
  public void testWebappRootConfiguration() throws Exception {
View Full Code Here

  @Test
  public void testWebappRootConfiguration() throws Exception {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
        "classpath:/org/springframework/batch/admin/web/resources/webapp-config.xml");
    assertTrue(context.containsBean("jobRepository"));
    context.close();
  }

  @Test
  public void testServletConfiguration() throws Exception {
View Full Code Here

    ClassPathXmlApplicationContext parent = new ClassPathXmlApplicationContext(
        "classpath:/org/springframework/batch/admin/web/resources/webapp-config.xml");
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
        new String[] { "classpath:/org/springframework/batch/admin/web/resources/servlet-config.xml" }, parent);

    assertTrue(context.containsBean("jobRepository"));
    String[] beanNames = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(context.getBeanFactory(),
        JobController.class);
    assertEquals(1, beanNames.length);

    MenuManager menuManager = context.getBean(MenuManager.class);
View Full Code Here

public class ImportWithSpecifiedResolverTest {

    @Test
    public void givenDevelopmentEnvironmentTheCorrectImportsAreProcessed() {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("org/constretto/spring/namespacehandler/ImportWithSpecifiedResolverTest-context.xml");
        Assert.assertTrue(ctx.containsBean("inMainConfig"));
        Assert.assertFalse(ctx.containsBean("inJunitConfig"));
        Assert.assertTrue(ctx.containsBean("inDevelopmentConfig"));
    }
}
View Full Code Here

    @Test
    public void givenDevelopmentEnvironmentTheCorrectImportsAreProcessed() {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("org/constretto/spring/namespacehandler/ImportWithSpecifiedResolverTest-context.xml");
        Assert.assertTrue(ctx.containsBean("inMainConfig"));
        Assert.assertFalse(ctx.containsBean("inJunitConfig"));
        Assert.assertTrue(ctx.containsBean("inDevelopmentConfig"));
    }
}
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.