Search in sources :

Example 1 with InstrumentationResultParser

use of com.android.ddmlib.testrunner.InstrumentationResultParser in project buck by facebook.

the class InstrumentationTestRunnerTest method testSetTrimLinesHappyPath.

/**
   * Just verifies the reflection is legit
   */
@Test
public void testSetTrimLinesHappyPath() throws Throwable {
    IShellEnabledDevice shellEnabledDevice = EasyMock.createMock(IShellEnabledDevice.class);
    EasyMock.replay(shellEnabledDevice);
    RemoteAndroidTestRunner runner = new RemoteAndroidTestRunner("foobar", "blah", shellEnabledDevice);
    Field field = RemoteAndroidTestRunner.class.getDeclaredField("mParser");
    field.setAccessible(true);
    field.set(runner, new InstrumentationResultParser("fooBar", new ArrayList<ITestRunListener>()));
    InstrumentationTestRunner.setTrimLine(runner, true);
}
Also used : Field(java.lang.reflect.Field) IShellEnabledDevice(com.android.ddmlib.IShellEnabledDevice) InstrumentationResultParser(com.android.ddmlib.testrunner.InstrumentationResultParser) RemoteAndroidTestRunner(com.android.ddmlib.testrunner.RemoteAndroidTestRunner) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

IShellEnabledDevice (com.android.ddmlib.IShellEnabledDevice)1 InstrumentationResultParser (com.android.ddmlib.testrunner.InstrumentationResultParser)1 RemoteAndroidTestRunner (com.android.ddmlib.testrunner.RemoteAndroidTestRunner)1 Field (java.lang.reflect.Field)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1