Package org.springframework.integration.smb.session

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


    assertTrue(consumer instanceof SourcePollingChannelAdapter);
    Object messageSource = TestUtils.getPropertyValue(consumer, "source");
    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);
View Full Code Here


    }

    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


  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

            + "\n    Please press 'q + Enter' to quit the application.    "
            + "\n                                                         "
            + "\n=========================================================" );
    }

    SmbSessionFactory smbSessionFactory = context.getBean("smbSession", SmbSessionFactory.class);

    System.out.println("Polling from Share: " + smbSessionFactory.getUrl());

    while (true) {

      final String input = scanner.nextLine();
View Full Code Here

    assertNotNull(TestUtils.getPropertyValue(messageHandler, "temporaryDirectory"));

    Object sessionFactoryProp = TestUtils.getPropertyValue(messageHandler, "sessionFactory");
    assertEquals(SmbSessionFactory.class, sessionFactoryProp.getClass());

    SmbSessionFactory smbSessionFactory = (SmbSessionFactory) sessionFactoryProp;
    assertEquals("localhost", TestUtils.getPropertyValue(smbSessionFactory, "host"));
    assertEquals(0, TestUtils.getPropertyValue(smbSessionFactory, "port"));
    assertEquals(23, TestUtils.getPropertyValue(messageHandler, "order"));

    // verify subscription order
View Full Code Here

TOP

Related Classes of org.springframework.integration.smb.session.SmbSessionFactory

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.