use of com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult in project VideoOptimzer by attdevsupport.
the class ScreenRotationImplTest method runTest_resIsNoErr_Fail.
@Test
public void runTest_resIsNoErr_Fail() {
tracedata = Mockito.mock(PacketAnalyzerResult.class);
burstCollectionAnalysisData = Mockito.mock(BurstCollectionAnalysisData.class);
burst01 = mock(Burst.class);
Mockito.when(burst01.getBurstCategory()).thenReturn(BurstCategory.SCREEN_ROTATION);
Mockito.when(burst01.getBeginTime()).thenReturn(1.0);
List<Burst> burstCollection = new ArrayList<Burst>();
burstCollection.add(burst01);
Mockito.when(tracedata.getBurstCollectionAnalysisData()).thenReturn(burstCollectionAnalysisData);
Mockito.when(burstCollectionAnalysisData.getBurstCollection()).thenReturn(burstCollection);
screenRotationImpl = (ScreenRotationImpl) context.getBean("screenRotation");
AbstractBestPracticeResult result = screenRotationImpl.runTest(tracedata);
assertEquals(BPResultType.FAIL, result.getResultType());
}
use of com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult in project VideoOptimzer by attdevsupport.
the class AccessingPeripheralImplTest method runTest_resIsNoErrResultTypeIsFail.
@Test
public void runTest_resIsNoErrResultTypeIsFail() {
Mockito.when(tracedata.getFilter()).thenReturn(analysisFilter);
Mockito.when(timeRange.getBeginTime()).thenReturn(0.0);
Mockito.when(timeRange.getEndTime()).thenReturn(100.0);
Mockito.when(traceResult.getCameraActiveDuration()).thenReturn(10.0);
Mockito.when(traceResult.getBluetoothActiveDuration()).thenReturn(10.0);
Mockito.when(traceResult.getGpsActiveDuration()).thenReturn(10.0);
Mockito.when(traceResult.getTraceResultType()).thenReturn(TraceResultType.TRACE_DIRECTORY);
Mockito.when((TraceDirectoryResult) tracedata.getTraceresult()).thenReturn(traceResult);
Mockito.when(analysisFilter.getTimeRange()).thenReturn(timeRange);
acPrphlImpl = (AccessingPeripheralImpl) context.getBean("accessingPeripheral");
AbstractBestPracticeResult testResult = acPrphlImpl.runTest(tracedata);
assertEquals(BPResultType.NO_DATA, testResult.getResultType());
}
use of com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult in project VideoOptimzer by attdevsupport.
the class AccessingPeripheralImplTest method runTest_resIsNoErrResultTypeIsPass.
@Test
public void runTest_resIsNoErrResultTypeIsPass() {
Mockito.when(tracedata.getFilter()).thenReturn(analysisFilter);
Mockito.when(traceResult.getTraceResultType()).thenReturn(TraceResultType.TRACE_FILE);
Mockito.when((TraceDirectoryResult) tracedata.getTraceresult()).thenReturn(traceResult);
acPrphlImpl = (AccessingPeripheralImpl) context.getBean("accessingPeripheral");
AbstractBestPracticeResult testResult = acPrphlImpl.runTest(tracedata);
assertEquals(BPResultType.NO_DATA, testResult.getResultType());
}
use of com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult in project VideoOptimzer by attdevsupport.
the class CacheControlImplTest method runTest_resTypeIsPass.
@Test
public void runTest_resTypeIsPass() {
List<CacheEntry> diagnosisResults = new ArrayList<CacheEntry>();
Mockito.when(entryArray[0].getDiagnosis()).thenReturn(Diagnosis.CACHING_DIAG_CACHE_MISSED);
diagnosisResults.add(entryArray[0]);
Mockito.when(cacheAnalysis.getDiagnosisResults()).thenReturn(diagnosisResults);
Mockito.when(tracedata.getCacheAnalysis()).thenReturn(cacheAnalysis);
cacheControlImpl = (CacheControlImpl) context.getBean("cacheControl");
AbstractBestPracticeResult testResult = cacheControlImpl.runTest(tracedata);
assertEquals(BPResultType.PASS, testResult.getResultType());
}
use of com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult in project VideoOptimzer by attdevsupport.
the class CacheControlImplTest method runTest_returnIsNull.
@Test
public void runTest_returnIsNull() {
Mockito.when(tracedata.getCacheAnalysis()).thenReturn(null);
cacheControlImpl = (CacheControlImpl) context.getBean("cacheControl");
AbstractBestPracticeResult testResult = cacheControlImpl.runTest(tracedata);
assertNull(testResult);
}
Aggregations