Package org.springframework.test.context

Examples of org.springframework.test.context.ContextConfigurationAttributes


    if (logger.isTraceEnabled()) {
      logger.trace(String.format("Retrieved @ContextConfiguration [%s] for declaring class [%s].",
        contextConfiguration, declaringClass.getName()));
    }

    ContextConfigurationAttributes attributes = new ContextConfigurationAttributes(declaringClass,
      contextConfiguration);
    if (logger.isTraceEnabled()) {
      logger.trace("Resolved context configuration attributes: " + attributes);
    }
    attributesList.add(attributes);
View Full Code Here


    if (logger.isTraceEnabled()) {
      logger.trace(String.format("Retrieved @ContextConfiguration attributes [%s] for declaring class [%s].",
        annAttrs, declaringClass.getName()));
    }

    ContextConfigurationAttributes attributes = new ContextConfigurationAttributes(declaringClass, annAttrs);
    if (logger.isTraceEnabled()) {
      logger.trace("Resolved context configuration attributes: " + attributes);
    }
    attributesList.add(attributes);
  }
View Full Code Here

  public void processContextConfigurationWithoutLocationsAndConfigurationClassesForBogusTestClass() {
    expectedException.expect(IllegalStateException.class);
    expectedException.expectMessage(startsWith("Neither"));
    expectedException.expectMessage(containsString("was able to detect defaults"));

    ContextConfigurationAttributes configAttributes = new ContextConfigurationAttributes(getClass(),
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, true, null, true, ContextLoader.class);
    loader.processContextConfiguration(configAttributes);
  }
View Full Code Here

    loader.processContextConfiguration(configAttributes);
  }

  @Test
  public void processContextConfigurationWithDefaultXmlConfigGeneration() {
    ContextConfigurationAttributes configAttributes = new ContextConfigurationAttributes(XmlTestCase.class,
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, true, null, true, ContextLoader.class);
    loader.processContextConfiguration(configAttributes);
    assertEquals(1, configAttributes.getLocations().length);
    assertEmpty(configAttributes.getClasses());
  }
View Full Code Here

    assertEmpty(configAttributes.getClasses());
  }

  @Test
  public void processContextConfigurationWithDefaultConfigurationClassGeneration() {
    ContextConfigurationAttributes configAttributes = new ContextConfigurationAttributes(ConfigClassTestCase.class,
      EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, true, null, true, ContextLoader.class);
    loader.processContextConfiguration(configAttributes);
    assertEquals(1, configAttributes.getClasses().length);
    assertEmpty(configAttributes.getLocations());
  }
View Full Code Here

  @Test
  public void processContextConfigurationWithDefaultXmlConfigAndConfigurationClassGeneration() {
    expectedException.expect(IllegalStateException.class);
    expectedException.expectMessage(containsString("both default locations AND default configuration classes were detected"));

    ContextConfigurationAttributes configAttributes = new ContextConfigurationAttributes(
      ImproperDuplicateDefaultXmlAndConfigClassTestCase.class, EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY, true, null,
      true, ContextLoader.class);
    loader.processContextConfiguration(configAttributes);
  }
View Full Code Here

  }

  @Test
  public void processContextConfigurationWithLocation() {
    String[] locations = new String[] { "classpath:/foo.xml" };
    ContextConfigurationAttributes configAttributes = new ContextConfigurationAttributes(getClass(), locations,
      EMPTY_CLASS_ARRAY, true, null, true, ContextLoader.class);
    loader.processContextConfiguration(configAttributes);
    assertArrayEquals(locations, configAttributes.getLocations());
    assertEmpty(configAttributes.getClasses());
  }
View Full Code Here

  }

  @Test
  public void processContextConfigurationWithConfigurationClass() {
    Class<?>[] classes = new Class<?>[] { getClass() };
    ContextConfigurationAttributes configAttributes = new ContextConfigurationAttributes(getClass(),
      EMPTY_STRING_ARRAY, classes, true, null, true, ContextLoader.class);
    loader.processContextConfiguration(configAttributes);
    assertArrayEquals(classes, configAttributes.getClasses());
    assertEmpty(configAttributes.getLocations());
  }
View Full Code Here

TOP

Related Classes of org.springframework.test.context.ContextConfigurationAttributes

Copyright © 2018 www.massapicom. 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.