Package org.springframework.context.support

Examples of org.springframework.context.support.ClassPathXmlApplicationContext


  private ApplicationContext loadApplicationContext(String location) throws Exception {
    String[] locations = new String[2];
    locations[0] = "/org/geomajas/spring/geomajasContext.xml";
    locations[1] = location;
    try {
      return new ClassPathXmlApplicationContext(locations);
    } catch (Exception ex) {
      Throwable ge = ex;
      while (null != ge) {
        if (ge instanceof GeomajasException) {
          throw (GeomajasException)ge;
View Full Code Here


  private ApplicationContext loadApplicationContext(String location) throws Exception {
    String[] locations = new String[2];
    locations[0] = "/org/geomajas/spring/geomajasContext.xml";
    locations[1] = location;
    try {
      return new ClassPathXmlApplicationContext(locations);
    } catch (Exception ex) {
      Throwable ge = ex;
      while (null != ge) {
        if (ge instanceof GeomajasException) {
          throw (GeomajasException) ge;
View Full Code Here

    };
   
   
    try {
      // let spring do the work
      ac = new ClassPathXmlApplicationContext(new String[] {  
          "classpath*:serviceconfig/brasatoconfig.xml",
          "classpath*:**/_spring/brasatoconfigpart.xml",
          "classpath*:serviceconfig/**/_spring/brasatoconfigpart.xml"
          });
    } catch (Exception e) {
View Full Code Here

        DependencyCheckPostProcessor.VALUE));
  }

  private ApplicationContext loadApplicationContext(String... locations) throws Exception {
    try {
      return new ClassPathXmlApplicationContext(locations);
    } catch (Exception ex) {
      Throwable ge = ex;
      while (null != ge) {
        if (ge instanceof GeomajasException) {
          throw (GeomajasException)ge;
View Full Code Here

  private static final String EXAMPLE_CONFIG = "configuredExample";

  private BeanFactory factory;

  protected void setUp() throws Exception {
    ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext(
        new String[] {"org/geomajas/spring/testContext.xml", "org/geomajas/spring/moreContext.xml"});
    // of course, an ApplicationContext is just a BeanFactory
    factory = appContext;
  }
View Full Code Here

public class ConfigurationDtoPostProcessorLayerTreeTest {

  @Test
  public void testLayerTreeCheck() throws Exception {
    try {
      ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext();
      context.setId("test");
      context.setDisplayName("test");
      context.setConfigLocation(
          "/org/geomajas/spring/geomajasContext.xml " +
          "/org/geomajas/layer/bean/beanContext.xml " +
          "/org/geomajas/layer/bean/layerBeans.xml " +
          "/org/geomajas/internal/configuration/layerTreeInvalid.xml " +
          "");
      context.refresh();
      Assert.fail("Context initialization should have failed.");
    } catch (BeanCreationException bce) {
      Assert.assertTrue(bce.getCause().getMessage().startsWith(
          "A LayerTreeNodeInfo object can only reference layers which are part of the map, layer "));
    }
View Full Code Here

  }
 
  @Test
  public void testAttributeNameCheck() {
    try {
      ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext();
      context.setId("test");
      context.setDisplayName("test");
      context.setConfigLocation(
          "/org/geomajas/spring/geomajasContext.xml " +
          "/org/geomajas/layer/bean/beanContext.xml " +
          "/org/geomajas/layer/bean/layerBeans.xml " +
          "/org/geomajas/internal/configuration/layerBeansInvalid.xml " +
          "");
      context.refresh();
      Assert.fail("Context initialization should have failed.");
    } catch (BeanCreationException bce) {
      Assert.assertTrue(bce.getCause().getCause().getMessage().contains(
          "manyToOne.stringAttr"));
    }
View Full Code Here

  public DtoGeometrySerializerTest() {
    dtoSerializer = new DtoGeometrySerializer();
    jtsSerializer = new GeometrySerializer();

    ApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[] {
        "org/geomajas/spring/geomajasContext.xml", "org/geomajas/spring/emptyApplication.xml" });
    converter = applicationContext.getBean("service.DtoConverterService", DtoConverterService.class);
  }
View Full Code Here

  private static final String DATA_SOURCE_BEAN_NAME = "dataSource";
 
  private ApplicationContext applicationContext;
 
  public JdbcLoggerSpringDemo() {
    applicationContext = new ClassPathXmlApplicationContext(SPRING_CONFIG_FILE_PATH);
  }
View Full Code Here

public class InvalidateSingleCacheTest {
    private ApplicationContext context;

    @BeforeClass
    public void beforeClass() {
        context = new ClassPathXmlApplicationContext("/test-context.xml");
    }
View Full Code Here

TOP

Related Classes of org.springframework.context.support.ClassPathXmlApplicationContext

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.