Examples of SmbSession


Examples of org.springframework.integration.smb.session.SmbSession

    assertTrue(messageSource instanceof SmbInboundFileSynchronizingMessageSource);

    // retrieve the session factory bean to place a couple of test files remotely using a new session
    SmbSessionFactory smbSessionFactory = ac.getBean("smbSessionFactory", SmbSessionFactory.class);
    smbSessionFactory.setReplaceFile(true);
    SmbSession smbSession = smbSessionFactory.getSession();

    // place text files onto the share
    smbSession.mkdir(testRemoteDir);

    String[] fileNames = createTestFileNames(5);
    for (int i = 0; i < fileNames.length; i++) {
      smbSession.write(("File [" + fileNames[i] + "] written by test case [" + getMethodName() + "].").getBytes(), testRemoteDir + fileNames[i]);
    }

    // allow time for the files to arrive locally
    Thread.sleep(5000);
View Full Code Here

Examples of org.springframework.integration.smb.session.SmbSession

    Thread.sleep(3000);

    // retrieve the session factory bean to check the test files are present in the remote location
    SmbSessionFactory smbSessionFactory = ac.getBean("smbSessionFactory", SmbSessionFactory.class);
    smbSessionFactory.setReplaceFile(false);
    SmbSession smbSession = smbSessionFactory.getSession();

    for (int i = 0; i < fileNames.length; i++) {
      String remoteFile = testRemoteDir + fileNames[i];
      assertTrue("Remote file [" + remoteFile + "] does not exist.", smbSession.exists(remoteFile));
    }

  }
View Full Code Here

Examples of org.springframework.integration.smb.session.SmbSession

  public static class TestSessionFactoryBean implements FactoryBean<SmbSessionFactory> {

    public SmbSessionFactory getObject() throws Exception {
      SmbSessionFactory smbFactory = mock(SmbSessionFactory.class);
      SmbSession session = mock(SmbSession.class);
      when(smbFactory.getSession()).thenReturn(session);
      return smbFactory;
    }
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.