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


Java IShellOutputReceiver.flush方法代码示例

本文整理汇总了Java中com.android.ddmlib.IShellOutputReceiver.flush方法的典型用法代码示例。如果您正苦于以下问题:Java IShellOutputReceiver.flush方法的具体用法?Java IShellOutputReceiver.flush怎么用?Java IShellOutputReceiver.flush使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.android.ddmlib.IShellOutputReceiver的用法示例。


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

示例1: createDeviceForShellCommandTest

import com.android.ddmlib.IShellOutputReceiver; //导入方法依赖的package包/类
private TestDevice createDeviceForShellCommandTest(final String output) {
  return new TestDevice() {
    @Override
    public void executeShellCommand(
        String cmd,
        IShellOutputReceiver receiver,
        long timeout,
        TimeUnit timeoutUnit) {
      byte[] outputBytes = output.getBytes();
      receiver.addOutput(outputBytes, 0, outputBytes.length);
      receiver.flush();
    }
  };
}
 
开发者ID:saleehk,项目名称:buck-cutom,代码行数:15,代码来源:AdbHelperTest.java

示例2: createDeviceForShellCommandTest

import com.android.ddmlib.IShellOutputReceiver; //导入方法依赖的package包/类
private TestDevice createDeviceForShellCommandTest(final String output) {
  return new TestDevice() {
    @Override
    public void executeShellCommand(
        String cmd, IShellOutputReceiver receiver, long timeout, TimeUnit timeoutUnit) {
      byte[] outputBytes = output.getBytes(StandardCharsets.UTF_8);
      receiver.addOutput(outputBytes, 0, outputBytes.length);
      receiver.flush();
    }
  };
}
 
开发者ID:facebook,项目名称:buck,代码行数:12,代码来源:RealAndroidDeviceTest.java

示例3: printToOutput

import com.android.ddmlib.IShellOutputReceiver; //导入方法依赖的package包/类
private final static void printToOutput(IShellOutputReceiver receiver, String message) {
    byte[] data = message.getBytes();
    receiver.addOutput(data, 0, data.length);
    receiver.flush();
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-agent,代码行数:6,代码来源:FakeDeviceShellAnswer.java

示例4: executeShellCommand

import com.android.ddmlib.IShellOutputReceiver; //导入方法依赖的package包/类
@Override
public void executeShellCommand(String command, IShellOutputReceiver receiver,
                                long maxTimeToOutputResponse, TimeUnit maxTimeUnits)
        throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException,
        IOException {
    System.out.println(String.format("EXECSHELL(%S) CALLED", name));

    // now fake out some tests result to make the test runner happy.
    addLineToReceiver("INSTRUMENTATION_STATUS: numtests=2\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: numtests=2\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: stream=\r\n", receiver);
    addLineToReceiver("com.android.tests.basic.MainTest:\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: id=InstrumentationTestRunner\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: test=testBuildConfig\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: class=com.android.tests.basic.MainTest\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: current=1\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS_CODE: 1\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: numtests=2\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: stream=.\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: id=InstrumentationTestRunner\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: test=testBuildConfig\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: class=com.android.tests.basic.MainTest\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: current=1\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS_CODE: 0\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: numtests=2\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: stream=\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: id=InstrumentationTestRunner\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: test=testPreconditions\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: class=com.android.tests.basic.MainTest\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: current=2\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS_CODE: 1\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: numtests=2\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: stream=.\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: id=InstrumentationTestRunner\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: test=testPreconditions\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: class=com.android.tests.basic.MainTest\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS: current=2\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_STATUS_CODE: 0\r\n", receiver);
    addLineToReceiver("INSTRUMENTATION_RESULT: stream=\r\n", receiver);
    addLineToReceiver("Test results for InstrumentationTestRunner=..\r\n", receiver);
    addLineToReceiver("Time: 0.247\r\n", receiver);
    addLineToReceiver("\r\n", receiver);
    addLineToReceiver("OK (2 tests)\r\n", receiver);
    receiver.flush();

    execShellCalled = true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:48,代码来源:FakeDevice.java


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