Search in sources :

Example 56 with AbstractBestPracticeResult

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());
}
Also used : Burst(com.att.aro.core.packetanalysis.pojo.Burst) ArrayList(java.util.ArrayList) AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) BurstCollectionAnalysisData(com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData) PacketAnalyzerResult(com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 57 with AbstractBestPracticeResult

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());
}
Also used : AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 58 with AbstractBestPracticeResult

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());
}
Also used : AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 59 with AbstractBestPracticeResult

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());
}
Also used : ArrayList(java.util.ArrayList) AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) CacheEntry(com.att.aro.core.packetanalysis.pojo.CacheEntry) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 60 with AbstractBestPracticeResult

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);
}
Also used : AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Aggregations

AbstractBestPracticeResult (com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult)66 BaseTest (com.att.aro.core.BaseTest)47 ArrayList (java.util.ArrayList)47 Test (org.junit.Test)47 Session (com.att.aro.core.packetanalysis.pojo.Session)33 HttpRequestResponseInfo (com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo)29 PacketAnalyzerResult (com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)17 Burst (com.att.aro.core.packetanalysis.pojo.Burst)8 BestPracticeType (com.att.aro.core.bestpractice.pojo.BestPracticeType)6 CacheEntry (com.att.aro.core.packetanalysis.pojo.CacheEntry)6 List (java.util.List)6 IBestPractice (com.att.aro.core.bestpractice.IBestPractice)5 BPResultType (com.att.aro.core.bestpractice.pojo.BPResultType)4 UnnecessaryConnectionResult (com.att.aro.core.bestpractice.pojo.UnnecessaryConnectionResult)4 BufferOccupancyResult (com.att.aro.core.bestpractice.pojo.BufferOccupancyResult)3 TsharkException (com.att.aro.core.exception.TsharkException)3 BurstCollectionAnalysisData (com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData)3 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)3 AROTraceData (com.att.aro.core.pojo.AROTraceData)3 IOException (java.io.IOException)3