Search in sources :

Example 1 with IVideoImageSubscriber

use of com.att.aro.core.datacollector.IVideoImageSubscriber in project VideoOptimzer by attdevsupport.

the class VideoCaptureImplTest method run_test2.

@SuppressWarnings("rawtypes")
@Test
public void run_test2() throws TimeoutException, AdbCommandRejectedException, IOException {
    videoCapture.setDevice(device);
    RawImage testRaw = new RawImage();
    testRaw.data = imagedata;
    testRaw.width = 10;
    testRaw.height = 10;
    testRaw.bpp = 16;
    when(device.getScreenshot()).thenReturn(testRaw);
    when(videoWriter.getTimeUnits()).thenReturn((int) 1000f);
    IVideoImageSubscriber videoImageSub = mock(IVideoImageSubscriber.class);
    videoCapture.addSubscriber(videoImageSub);
    videoCapture.setDeviceManufacturer("somethingHTC");
    doAnswer(new Answer() {

        public Object answer(InvocationOnMock invocation) {
            ((Runnable) invocation.getArguments()[0]).run();
            videoCapture.stopRecording();
            return null;
        }
    }).when(threadPool).execute(any(Runnable.class));
    videoCapture.run();
    assertEquals(0, videoCapture.getiExceptionCount());
    assertTrue(videoCapture.isAllDone());
}
Also used : Answer(org.mockito.stubbing.Answer) Mockito.doAnswer(org.mockito.Mockito.doAnswer) IVideoImageSubscriber(com.att.aro.core.datacollector.IVideoImageSubscriber) RawImage(com.android.ddmlib.RawImage) InvocationOnMock(org.mockito.invocation.InvocationOnMock) BaseTest(com.att.aro.core.BaseTest) Test(org.junit.Test)

Example 2 with IVideoImageSubscriber

use of com.att.aro.core.datacollector.IVideoImageSubscriber in project VideoOptimzer by attdevsupport.

the class RootedAndroidCollectorImplTest method testaddVideoImageSubscriber_returnIsTrue.

@Test
public void testaddVideoImageSubscriber_returnIsTrue() {
    IVideoImageSubscriber mockSubscriber = mock(IVideoImageSubscriber.class);
    rootedAndroidCollectorImpl.addVideoImageSubscriber(mockSubscriber);
}
Also used : IVideoImageSubscriber(com.att.aro.core.datacollector.IVideoImageSubscriber) Test(org.junit.Test)

Aggregations

IVideoImageSubscriber (com.att.aro.core.datacollector.IVideoImageSubscriber)2 Test (org.junit.Test)2 RawImage (com.android.ddmlib.RawImage)1 BaseTest (com.att.aro.core.BaseTest)1 Mockito.doAnswer (org.mockito.Mockito.doAnswer)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1 Answer (org.mockito.stubbing.Answer)1