当前位置: 首页>>代码示例>>Java>>正文


Java ExitCallback类代码示例

本文整理汇总了Java中org.apache.sshd.server.ExitCallback的典型用法代码示例。如果您正苦于以下问题:Java ExitCallback类的具体用法?Java ExitCallback怎么用?Java ExitCallback使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ExitCallback类属于org.apache.sshd.server包,在下文中一共展示了ExitCallback类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: starts

import org.apache.sshd.server.ExitCallback; //导入依赖的package包/类
/**
 * MkCommand can start.
 * @throws Exception If something goes wrong.
 */
@Test
public void starts() throws Exception {
    final ByteArrayOutputStream output = new ByteArrayOutputStream();
    final String text = "test mkcommand";
    final MkCommand command = new MkCommand(text);
    command.setOutputStream(output);
    command.setExitCallback(Mockito.mock(ExitCallback.class));
    command.start(Mockito.mock(Environment.class));
    MatcherAssert.assertThat(
        output.toString(), Matchers.equalTo(text)
    );
}
 
开发者ID:jcabi,项目名称:jcabi-ssh,代码行数:17,代码来源:MkCommandTest.java

示例2: create

import org.apache.sshd.server.ExitCallback; //导入依赖的package包/类
@Override
public Command create() {
    return new Command() {
        @Override
        public void setInputStream(InputStream in) {
            SshEchoCommandFactory.this.in = in;
        }

        @Override
        public void setOutputStream(OutputStream out) {
            SshEchoCommandFactory.this.out = out;
        }

        @Override
        public void setErrorStream(OutputStream err) {

        }

        @Override
        public void setExitCallback(ExitCallback callback) {

        }

        @Override
        public void start(Environment env) throws IOException {
            executor.scheduleWithFixedDelay(
                    SshEchoCommandFactory.this,
                    0,
                    100,
                    TimeUnit.MILLISECONDS);
        }

        @Override
        public void destroy() {
            executor.shutdownNow();
        }
    };
}
 
开发者ID:Alexey1Gavrilov,项目名称:ExpectIt,代码行数:39,代码来源:SshEchoCommandFactory.java

示例3: getFailureScpCommand

import org.apache.sshd.server.ExitCallback; //导入依赖的package包/类
@SuppressWarnings({"boxing", "resource"})
NewScpCommand getFailureScpCommand(int returnVal, ExitCallback callback) throws IOException {
    String filePath = "/mep-testing-gradle/foo/bar/maven-metadata.xml";
    FileSystemView viewMock = Mockito.mock(FileSystemView.class);

    Mockito.when(viewMock.getFile(Matchers.any(SshFile.class), Matchers.anyString())).thenReturn(null);

    OutputStream osMock = Mockito.mock(OutputStream.class);
    InputStream isMock = Mockito.mock(InputStream.class);
    LoggingHelper loggingHelper = Mockito.mock(LoggingHelper.class);

    Mockito.when(isMock.read()).thenReturn(returnVal);

    final NewScpHelper helperMocked = new NewScpHelper(isMock, osMock, viewMock, loggingHelper, null, null) {
        @Override
        public String readLine() throws IOException {
            return "filename";
        }

    };


    SshRequestLog requestLog = Mockito.mock(SshRequestLog.class);
    NewScpCommand scpCommand = new NewScpCommand("scp -t " + filePath, requestLog, null) {
        @Override
        protected NewScpHelper createScpHelper() {
            return helperMocked;
        }
    };

    scpCommand.setFileSystemView(viewMock);
    scpCommand.setOutputStream(osMock);
    scpCommand.setInputStream(isMock);
    scpCommand.setExitCallback(callback);

    return scpCommand;
}
 
开发者ID:yahoo,项目名称:artifactory_ssh_proxy,代码行数:38,代码来源:TestNewScpCommand.java

示例4: testFileFailure

import org.apache.sshd.server.ExitCallback; //导入依赖的package包/类
@Test
public void testFileFailure() throws IOException {
    ExitCallback callback = Mockito.mock(ExitCallback.class);
    NewScpCommand scpCommand = getFailureScpCommand((int) 'C', callback);
    scpCommand.run();

    Mockito.verify(callback).onExit(Matchers.anyInt(), Matchers.anyString());
}
 
开发者ID:yahoo,项目名称:artifactory_ssh_proxy,代码行数:9,代码来源:TestNewScpCommand.java

示例5: testDirFailure

import org.apache.sshd.server.ExitCallback; //导入依赖的package包/类
@Test
public void testDirFailure() throws IOException {
    ExitCallback callback = Mockito.mock(ExitCallback.class);
    NewScpCommand scpCommand = getFailureScpCommand((int) 'D', callback);
    scpCommand.run();

    Mockito.verify(callback).onExit(Matchers.anyInt(), Matchers.anyString());
}
 
开发者ID:yahoo,项目名称:artifactory_ssh_proxy,代码行数:9,代码来源:TestNewScpCommand.java

示例6: setExitCallback

import org.apache.sshd.server.ExitCallback; //导入依赖的package包/类
@Override
public void setExitCallback(ExitCallback callback) {
	this.callback = callback;
}
 
开发者ID:jesse-gallagher,项目名称:xsp-groovy-shell,代码行数:5,代码来源:GroovyShellCommand.java

示例7: setExitCallback

import org.apache.sshd.server.ExitCallback; //导入依赖的package包/类
@Override
public void setExitCallback(ExitCallback callback) {
    this.callback = callback;
}
 
开发者ID:RationaleEmotions,项目名称:SimpleSSH,代码行数:5,代码来源:FakeCommandFactory.java

示例8: setExitCallback

import org.apache.sshd.server.ExitCallback; //导入依赖的package包/类
@Override
public void setExitCallback(ExitCallback ec) {
    callback = ec;
}
 
开发者ID:anand1st,项目名称:sshd-shell-spring-boot,代码行数:5,代码来源:SshSessionInstance.java

示例9: setExitCallback

import org.apache.sshd.server.ExitCallback; //导入依赖的package包/类
public void setExitCallback(ExitCallback callback) {
    this.callback = callback;
}
 
开发者ID:nerdammer,项目名称:spash,代码行数:4,代码来源:SpashShell.java

示例10: setExitCallback

import org.apache.sshd.server.ExitCallback; //导入依赖的package包/类
@Override
public void setExitCallback(ExitCallback callback) {
    this.exitCallback = callback;
}
 
开发者ID:aeshell,项目名称:aesh-readline,代码行数:5,代码来源:TtyCommand.java

示例11: setExitCallback

import org.apache.sshd.server.ExitCallback; //导入依赖的package包/类
@Override
public void setExitCallback(ExitCallback callback) {

    this.callback = callback;
}
 
开发者ID:kantega,项目名称:respiro,代码行数:6,代码来源:TestSshdPlugin.java

示例12: setExitCallback

import org.apache.sshd.server.ExitCallback; //导入依赖的package包/类
@Override
public void setExitCallback(ExitCallback callback) {
  this.exit = callback;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:5,代码来源:BaseCommand.java

示例13: setExitCallback

import org.apache.sshd.server.ExitCallback; //导入依赖的package包/类
@Override
public void setExitCallback(ExitCallback exitCallback) {
	this.exitCallback = exitCallback;
}
 
开发者ID:litesolutions,项目名称:scm-ssh-plugin,代码行数:5,代码来源:AbstractCommand.java

示例14: setExitCallback

import org.apache.sshd.server.ExitCallback; //导入依赖的package包/类
@Override
public void setExitCallback(final ExitCallback cllbck) {
    this.callback = cllbck;
}
 
开发者ID:jcabi,项目名称:jcabi-ssh,代码行数:5,代码来源:MkCommand.java

示例15: setExitCallback

import org.apache.sshd.server.ExitCallback; //导入依赖的package包/类
@Override
public void setExitCallback(ExitCallback callback) {
  this.exitCallback = callback;
}
 
开发者ID:termd,项目名称:termd,代码行数:5,代码来源:TtyCommand.java


注:本文中的org.apache.sshd.server.ExitCallback类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。