use of com.att.aro.core.datacollector.pojo.StatusResult in project VideoOptimzer by attdevsupport.
the class RootedAndroidCollectorImplTest method teststartCollector_returnIsErrorCode204.
// @Ignore
@Test
public void teststartCollector_returnIsErrorCode204() {
when(filemanager.directoryExist(any(String.class))).thenReturn(true);
IDevice mockDevice = mock(IDevice.class);
IDevice[] devlist = { mockDevice };
when(mockDevice.getSerialNumber()).thenReturn("abc");
try {
when(adbservice.getConnectedDevices()).thenReturn(devlist);
} catch (Exception e) {
e.printStackTrace();
}
StatusResult testResult = rootedAndroidCollectorImpl.startCollector(true, "", VideoOption.NONE, false, "cde", null, null);
assertEquals(204, testResult.getError().getCode());
}
use of com.att.aro.core.datacollector.pojo.StatusResult in project VideoOptimzer by attdevsupport.
the class RootedAndroidCollectorImplTest method teststartCollector_returnIsErrorCode206.
@Ignore
@Test
public void teststartCollector_returnIsErrorCode206() {
when(filemanager.directoryExist(any(String.class))).thenReturn(true);
IDevice mockDevice = mock(IDevice.class);
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.checkTcpDumpRunning(any(IDevice.class))).thenReturn(true);
StatusResult testResult = rootedAndroidCollectorImpl.startCollector(true, "", VideoOption.NONE, false, "abc", null, null);
assertEquals(206, testResult.getError().getCode());
}
use of com.att.aro.core.datacollector.pojo.StatusResult in project VideoOptimzer by attdevsupport.
the class RootedAndroidCollectorImplTest method teststartCollector_returnIsErrorCode213.
@Ignore
@Test
public void teststartCollector_returnIsErrorCode213() {
when(filemanager.directoryExist(any(String.class))).thenReturn(true);
IDevice mockDevice = mock(IDevice.class);
IDevice[] devlist = { mockDevice };
when(mockDevice.getSerialNumber()).thenReturn("abc");
try {
when(adbservice.getConnectedDevices()).thenReturn(devlist);
} catch (Exception e) {
e.printStackTrace();
}
StatusResult testResult = rootedAndroidCollectorImpl.startCollector(true, "", VideoOption.NONE, false, "abc", null, null);
assertEquals(213, testResult.getError().getCode());
}
use of com.att.aro.core.datacollector.pojo.StatusResult in project VideoOptimzer by attdevsupport.
the class Compressor method run.
@Override
public void run() {
LOG.info("preparingPayload");
// message status update
notifyListeners(new StatusResult(null, null, State.COMPRESSING.toString() + ": " + new File(targetFolder).getName()));
String base64WrappedZipFile = null;
try {
base64WrappedZipFile = zipBase64();
} catch (Exception e1) {
String error = "Exception :" + e1.getMessage();
LOG.error(error);
// message status failed
notifyListeners(new StatusResult(false, null, error));
return;
}
// message completed success, zip base64 filename
notifyListeners(new StatusResult(true, null, base64WrappedZipFile));
}
use of com.att.aro.core.datacollector.pojo.StatusResult in project VideoOptimzer by attdevsupport.
the class NorootedAndroidCollectorImpl method stopCollector.
/**
* issue commands to stop the collector on vpn This cannot halt the vpn connection programmatically. VPN must be
* revoked through gestures. Best done by human interaction. With sufficient knowledge of screen size, VPN
* implementation, Android Version gestures can be programmatically performed to close the connection.
*/
@Override
public StatusResult stopCollector() {
StatusResult result = new StatusResult();
if (!stopAllServices()) {
LOG.error("Cannot stop all services, please check services in device Settings->Apps->Running");
}
if (!forceStopProcess()) {
LOG.error("Cannot force stop VPN Collector");
}
userInputTraceCollector.stopUserInputTraceCapture(this.device);
if (isAndroidVersionNougatOrHigher(device) == true)
cpuTraceCollector.stopCpuTraceCapture(this.device);
if (isVideo()) {
LOG.debug("stopping video capture");
this.stopCaptureVideo();
}
if (this.attnrScriptRun) {
attnr.stopAtenuationScript(this.device);
}
uiXmlCollector.stopUiXmlCapture(this.device);
LOG.info("pulling trace to local dir");
new LogcatCollector(adbService, device.getSerialNumber()).collectLogcat(localTraceFolder, "Logcat.log");
result = pullTrace(this.mDataDeviceCollectortraceFileNames);
if (result.isSuccess()) {
try {
metaDataHelper.initMetaData(localTraceFolder, traceDesc, traceType, targetedApp, appProducer);
} catch (Exception e) {
LOG.warn("Exception while initializing meta data", e);
}
}
GoogleAnalyticsUtil.getGoogleAnalyticsInstance().sendAnalyticsEvents(GoogleAnalyticsUtil.getAnalyticsEvents().getNonRootedCollector(), // GA Request
GoogleAnalyticsUtil.getAnalyticsEvents().getEndTrace());
running = false;
return result;
}
Aggregations