protected void doTest(SshServer server, Session<LsEntry> session) throws IOException { assertEquals(1, server.getActiveSessions().size()); LsEntry[] list = session.list("."); if (list.length > 0) { session.remove("*"); } session.write(new ByteArrayInputStream("foo".getBytes()), "bar"); list = session.list("."); assertEquals("bar", list[1].getFilename()); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); session.read("bar", outputStream); assertEquals("foo", new String(outputStream.toByteArray())); session.remove("bar"); session.close(); }
@Override public List<AbstractSession> call() { return sshd.getActiveSessions(); } });
while (n++ < 100 && server.getActiveSessions().size() > 0) { Thread.sleep(100); assertEquals(0, server.getActiveSessions().size());
channel.open().verify(7L, TimeUnit.SECONDS); try (Channel serverChannel = sshd.getActiveSessions().iterator().next().getService(ServerConnectionService.class).getChannels().iterator().next()) { Window clientLocal = channel.getLocalWindow(); Window clientRemote = channel.getRemoteWindow();
channel.open().verify(7L, TimeUnit.SECONDS); try (Channel serverChannel = sshd.getActiveSessions().iterator().next().getService(ServerConnectionService.class).getChannels().iterator().next()) { Window clientLocal = channel.getLocalWindow(); Window clientRemote = channel.getRemoteWindow();
channel.open().verify(7L, TimeUnit.SECONDS); try (Channel serverChannel = sshd.getActiveSessions().iterator().next().getService(ServerConnectionService.class).getChannels().iterator().next()) { Window clientLocal = channel.getLocalWindow(); Window clientRemote = channel.getRemoteWindow();
channel.open().verify(5L, TimeUnit.SECONDS); try (Channel serverChannel = sshd.getActiveSessions().iterator().next().getService(ServerConnectionService.class).getChannels().iterator().next()) { Window clientLocal = channel.getLocalWindow(); Window clientRemote = channel.getRemoteWindow();
channel.open().verify(5L, TimeUnit.SECONDS); try (Channel serverChannel = sshd.getActiveSessions().iterator().next().getService(ServerConnectionService.class).getChannels().iterator().next()) { Window clientLocal = channel.getLocalWindow(); Window clientRemote = channel.getRemoteWindow();
channel.open().verify(5L, TimeUnit.SECONDS); try (Channel serverChannel = sshd.getActiveSessions().iterator().next().getService(ServerConnectionService.class).getChannels().iterator().next()) { Window clientLocal = channel.getLocalWindow(); Window clientRemote = channel.getRemoteWindow();
assertTrue("No open server side channels", GenericUtils.size(channelListener.getOpenChannels()) > 0); try (AbstractSession serverSession = sshd.getActiveSessions().iterator().next()) { AbstractConnectionService<?> service = serverSession.getService(AbstractConnectionService.class); Collection<? extends Channel> channels = service.getChannels();
assertTrue("No open server side channels", GenericUtils.size(channelListener.getOpenChannels()) > 0); try (AbstractSession serverSession = sshd.getActiveSessions().iterator().next()) { AbstractConnectionService<?> service = serverSession.getService(AbstractConnectionService.class); Collection<? extends Channel> channels = service.getChannels();
assertTrue("No open server side channels", GenericUtils.size(channelListener.getOpenChannels()) > 0); try (AbstractSession serverSession = sshd.getActiveSessions().iterator().next()) { AbstractConnectionService<?> service = serverSession.getService(AbstractConnectionService.class); Collection<? extends Channel> channels = service.getChannels();
channel.open().verify(5L, TimeUnit.SECONDS); try (Channel serverChannel = sshd.getActiveSessions().iterator().next().getService(ServerConnectionService.class).getChannels().iterator().next()) { Window clientLocal = channel.getLocalWindow(); Window clientRemote = channel.getRemoteWindow();
channel.open().verify(5L, TimeUnit.SECONDS); try (Channel serverChannel = sshd.getActiveSessions().iterator().next().getService(ServerConnectionService.class).getChannels().iterator().next()) { Window clientLocal = channel.getLocalWindow(); Window clientRemote = channel.getRemoteWindow();
channel.open().verify(5L, TimeUnit.SECONDS); try (Channel serverChannel = sshd.getActiveSessions().iterator().next().getService(ServerConnectionService.class).getChannels().iterator().next()) { Window clientLocal = channel.getLocalWindow(); Window clientRemote = channel.getRemoteWindow();