Package org.springframework.core.io

Examples of org.springframework.core.io.ClassPathResource


    }
  }

  public void testGetObject() throws Exception {
    FSDirectoryFactoryBean fsDirectoryFactoryBean = new FSDirectoryFactoryBean();
    fsDirectoryFactoryBean.setLocation(new ClassPathResource("/org/springmodules/lucene/index/support"));
    try {
      fsDirectoryFactoryBean.afterPropertiesSet();
     
      unlockIndexIfNecessary((Directory)fsDirectoryFactoryBean.getObject());
     
View Full Code Here


    }
  }

  public void testGetObjectWithoutCreationWriter() throws Exception {
    FSDirectoryFactoryBean fsDirectoryFactoryBean = new FSDirectoryFactoryBean();
    fsDirectoryFactoryBean.setLocation(new ClassPathResource("/org/springmodules/lucene/index/support/"));
    fsDirectoryFactoryBean.setCreate(false);

    IndexWriter writer = null;
    try {
      fsDirectoryFactoryBean.afterPropertiesSet();
View Full Code Here

    }
  }

  public void testGetObjectWithCreationWriter() throws Exception {
    FSDirectoryFactoryBean fsDirectoryFactoryBean = new FSDirectoryFactoryBean();
    fsDirectoryFactoryBean.setLocation(new ClassPathResource("/org/springmodules/lucene/index/support/"));
    fsDirectoryFactoryBean.setCreate(true);

    IndexWriter writer = null;
    try {
      fsDirectoryFactoryBean.afterPropertiesSet();
View Full Code Here

    }
  }

  public void testGetObjectWithoutCreationReader() throws Exception {
    FSDirectoryFactoryBean fsDirectoryFactoryBean = new FSDirectoryFactoryBean();
    fsDirectoryFactoryBean.setLocation(new ClassPathResource("/org/springmodules/lucene/index/support/"));
    fsDirectoryFactoryBean.setCreate(false);
   
    IndexReader reader = null;
    try {
      fsDirectoryFactoryBean.afterPropertiesSet();
View Full Code Here

    }
  }

  public void testGetObjectWithCreationReader() throws Exception {
    FSDirectoryFactoryBean fsDirectoryFactoryBean = new FSDirectoryFactoryBean();
    fsDirectoryFactoryBean.setLocation(new ClassPathResource("/org/springmodules/lucene/index/support/"));
    fsDirectoryFactoryBean.setCreate(true);

    IndexReader reader = null;
    try {
      fsDirectoryFactoryBean.afterPropertiesSet();
View Full Code Here

                 "META-INF/velocity/LostPasswordEmail.vm", resources);
    }


    private void addInlineResource(MimeMessageHelper messageHelper, String resourcePath, String resourceIdentifier) throws MessagingException {
        Resource resource = new ClassPathResource(resourcePath);
        messageHelper.addInline(resourceIdentifier, resource);
    }
View Full Code Here

    reader = new XmlBeanDefinitionReader(factory);
  }

  @Test
  public void readsCouchbaseTemplateAttributesCorrectly() {
    reader.loadBeanDefinitions(new ClassPathResource("namespace/couchbase-template-bean.xml"));

    BeanDefinition definition = factory.getBeanDefinition("couchbaseTemplate");
    assertEquals(1, definition.getConstructorArgumentValues().getArgumentCount());

    factory.getBean("couchbaseTemplate");
View Full Code Here

    factory.getBean("couchbaseTemplate");
  }

  @Test
  public void readsCouchbaseTemplateWithTranslationServiceAttributesCorrectly() {
    reader.loadBeanDefinitions(new ClassPathResource("namespace/couchbase-template-with-translation-service-bean.xml"));

    BeanDefinition definition = factory.getBeanDefinition("couchbaseTemplate");
    assertEquals(2, definition.getConstructorArgumentValues().getArgumentCount());

    factory.getBean("couchbaseTemplate");
View Full Code Here

  /**
   * Test case for DATACOUCH-47.
   */
  @Test
  public void allowsMultipleBuckets() {
    reader.loadBeanDefinitions(new ClassPathResource("namespace/couchbase-multi-bucket-bean.xml"));

    factory.getBean("cb-template-first");
    factory.getBean("cb-template-second");
  }
View Full Code Here

*/
public class InterceptHandlerParser extends AbstractBeanDefinitionParser {

    @Override
    protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {
        XmlBeanFactory factory = new XmlBeanFactory(new ClassPathResource("com/tacitknowledge/flip/spring/context.xml"));
       
        BeanDefinitionBuilder beanBuilder = BeanDefinitionBuilder.rootBeanDefinition(FlipSpringAspect.class);
        String defaultUrlValue = element.getAttribute("default-url");
        MutablePropertyValues propertyValues = new MutablePropertyValues();
        propertyValues.addPropertyValue("defaultValue", defaultUrlValue);
View Full Code Here

TOP

Related Classes of org.springframework.core.io.ClassPathResource

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.