use of com.att.aro.core.datacollector.pojo.StatusResult in project VideoOptimzer by attdevsupport.
the class RootedAndroidCollectorImplTest method teststopCollector_returnIsErrorCode211.
@Test
public void teststopCollector_returnIsErrorCode211() {
StatusResult testResult = rootedAndroidCollectorImpl.stopCollector();
assertEquals(211, testResult.getError().getCode());
}
use of com.att.aro.core.datacollector.pojo.StatusResult in project VideoOptimzer by attdevsupport.
the class RootedAndroidCollectorImplTest method teststartCollector_returnIsErrorCode207.
// @Ignore
@Test
public void teststartCollector_returnIsErrorCode207() {
when(filemanager.directoryExist(any(String.class))).thenReturn(false);
StatusResult testResult = rootedAndroidCollectorImpl.startCollector(true, "", VideoOption.NONE, false, "abc", null, null);
assertEquals(207, testResult.getError().getCode());
}
use of com.att.aro.core.datacollector.pojo.StatusResult in project VideoOptimzer by attdevsupport.
the class RootedAndroidCollectorImplTest method teststartCollector_returnIsSuccess.
@Ignore
@Test
public void teststartCollector_returnIsSuccess() {
when(filemanager.directoryExist(any(String.class))).thenReturn(true);
IDevice mockDevice = mock(IDevice.class);
when(mockDevice.isEmulator()).thenReturn(true);
IDevice[] devlist = { mockDevice };
when(mockDevice.getSerialNumber()).thenReturn("abc");
try {
when(adbservice.getConnectedDevices()).thenReturn(devlist);
} catch (Exception e) {
e.printStackTrace();
}
try {
when(androidev.isAndroidRooted(any(IDevice.class))).thenReturn(true);
} catch (Exception e) {
e.printStackTrace();
}
when(android.isSDCardEnoughSpace(any(IDevice.class), any(long.class))).thenReturn(true);
when(filemanager.fileExist(any(String.class))).thenReturn(true);
when(extractor.extractFiles(any(String.class), any(String.class), any(ClassLoader.class))).thenReturn(true);
when(android.pushFile(any(IDevice.class), any(String.class), any(String.class))).thenReturn(true);
when(android.setExecutePermission(any(IDevice.class), any(String.class))).thenReturn(true);
when(android.checkTcpDumpRunning(any(IDevice.class))).thenReturn(false).thenReturn(true);
StatusResult testResult = rootedAndroidCollectorImpl.startCollector(true, "", VideoOption.NONE, false, "abc", null, null);
assertEquals(true, testResult.isSuccess());
}
use of com.att.aro.core.datacollector.pojo.StatusResult in project VideoOptimzer by attdevsupport.
the class RootedAndroidCollectorImplTest method teststopCollector_ThrowException.
@Test
public void teststopCollector_ThrowException() throws TimeoutException, AdbCommandRejectedException, IOException {
when(device.getSyncService()).thenThrow(new IOException());
Date date = new Date();
when(videocapture.getVideoStartTime()).thenReturn(date);
StatusResult testResult = rootedAndroidCollectorImpl.stopCollector();
assertEquals(211, testResult.getError().getCode());
}
use of com.att.aro.core.datacollector.pojo.StatusResult in project VideoOptimzer by attdevsupport.
the class RootedAndroidCollectorImplTest method teststopCollector_returnIsSuccess.
@Ignore
@Test
public void teststopCollector_returnIsSuccess() throws TimeoutException, AdbCommandRejectedException, IOException {
doReturn(5).when(rootedAndroidCollectorImpl).getMilliSecondsForTimeout();
when(filemanager.directoryExist(any(String.class))).thenReturn(true);
IDevice mockDevice = mock(IDevice.class);
when(mockDevice.isEmulator()).thenReturn(true);
SyncService service = mock(SyncService.class);
when(mockDevice.getSyncService()).thenReturn(service);
IDevice[] devlist = { mockDevice };
when(mockDevice.getSerialNumber()).thenReturn("abc");
try {
when(adbservice.getConnectedDevices()).thenReturn(devlist);
} catch (Exception e) {
e.printStackTrace();
}
try {
when(androidev.isAndroidRooted(any(IDevice.class))).thenReturn(true);
} catch (Exception e) {
e.printStackTrace();
}
when(android.isSDCardEnoughSpace(any(IDevice.class), any(long.class))).thenReturn(true);
when(filemanager.fileExist(any(String.class))).thenReturn(true);
when(extractor.extractFiles(any(String.class), any(String.class), any(ClassLoader.class))).thenReturn(true);
when(android.pushFile(any(IDevice.class), any(String.class), any(String.class))).thenReturn(true);
when(android.setExecutePermission(any(IDevice.class), any(String.class))).thenReturn(true);
rootedAndroidCollectorImpl.startCollector(true, "", VideoOption.LREZ, false, "abc", null, null);
when(android.checkTcpDumpRunning(any(IDevice.class))).thenReturn(true);
when(android.stopTcpDump(any(IDevice.class))).thenReturn(true);
when(android.isTraceRunning()).thenReturn(false);
Date date = new Date();
when(mockDevice.isEmulator()).thenReturn(false);
when(videocapture.getVideoStartTime()).thenReturn(date);
when(videocapture.isVideoCaptureActive()).thenReturn(true);
StatusResult testResult = rootedAndroidCollectorImpl.stopCollector();
assertEquals(true, testResult.isSuccess());
}
Aggregations