Package org.springframework.core.io

Examples of org.springframework.core.io.FileSystemResource


*
*/
public class SpringConfigTest extends TestCase {

    public void test() throws Throwable {
        XmlBeanFactory factory = new XmlBeanFactory(new FileSystemResource(
                "src/test/resources/spring-config/config-spring-1.xml"));

        DefaultFtpServer server = (DefaultFtpServer) factory.getBean("server");

        assertEquals(500, server.getConnectionConfig().getMaxLogins());
View Full Code Here


    this.classPath = classPath;
  }

  public Resource getExpected(String resourceName, boolean rewrite) {
    if (rewrite) {
      return new FileSystemResource("src/test/resources/" + classPath + "/" + resourceName);
    } else {
      return new ClassPathResource(classPath + "/" + resourceName);
    }
  }
View Full Code Here

    File file = QAUtil.createTempfile();
    FileWriter fw = new FileWriter(file);
    fw.write(SPRING_XML);
    fw.close();
   
    BeanFactory beanFactory = new XmlBeanFactory(new FileSystemResource(file));
    IServer server = (IServer) beanFactory.getBean("server");

    if (!server.isOpen()) {
      System.out.println("server should be open");
      Assert.fail("server should be open");
View Full Code Here

    File file = QAUtil.createTempfile();
    FileWriter fw = new FileWriter(file);
    fw.write(SPRING_XML2);
    fw.close();

    BeanFactory beanFactory = new XmlBeanFactory(new FileSystemResource(file));
    IServer server = (IServer) beanFactory.getBean("server");
   
    if (!server.isOpen()) {
      System.out.println("server should be open");
      Assert.fail("server should be open");
View Full Code Here

    fw.write(SPRING_XML3);
    fw.close();


   
    BeanFactory beanFactory = new XmlBeanFactory(new FileSystemResource(file));
    IServer server = (IServer) beanFactory.getBean("server");

    if (!server.isOpen()) {
      System.out.println("server should be open");
      Assert.fail("server should be open");
View Full Code Here

    fw.write(SPRING_XML4);
    fw.close();


   
    BeanFactory beanFactory = new XmlBeanFactory(new FileSystemResource(file));
    HttpClient httpClient = (HttpClient) beanFactory.getBean("httpClient");
    Assert.assertEquals(30, httpClient.getMaxIdle());
    Assert.assertEquals(60000, httpClient.getResponseTimeoutMillis());

View Full Code Here

    File file = QAUtil.createTempfile();
    FileWriter fw = new FileWriter(file);
    fw.write(SPRING_XML);
    fw.close();
   
    BeanFactory beanFactory = new XmlBeanFactory(new FileSystemResource(file));
    IServer server = (IServer) beanFactory.getBean("server");

    if (!server.isOpen()) {
      System.out.println("server should be open");
      Assert.fail("server should be open");
View Full Code Here

    File file = QAUtil.createTempfile();
    FileWriter fw = new FileWriter(file);
    fw.write(SPRING_XML2);
    fw.close();

    BeanFactory beanFactory = new XmlBeanFactory(new FileSystemResource(file));
    IServer server = (IServer) beanFactory.getBean("server");
   
    if (!server.isOpen()) {
      System.out.println("server should be open");
      Assert.fail("server should be open");
View Full Code Here

    fw.write(SPRING_XML3);
    fw.close();


   
    BeanFactory beanFactory = new XmlBeanFactory(new FileSystemResource(file));
    IServer server = (IServer) beanFactory.getBean("server");

    if (!server.isOpen()) {
      System.out.println("server should be open");
      Assert.fail("server should be open");
View Full Code Here

    fw.write(SPRING_XML4);
    fw.close();


   
    BeanFactory beanFactory = new XmlBeanFactory(new FileSystemResource(file));
    HttpClient httpClient = (HttpClient) beanFactory.getBean("httpClient");
    Assert.assertEquals(30, httpClient.getMaxIdle());
    Assert.assertEquals(60000, httpClient.getResponseTimeoutMillis());

View Full Code Here

TOP

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

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.