Search in sources :

Example 61 with AbstractBestPracticeResult

use of com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult in project VideoOptimzer by attdevsupport.

the class ConnectionClosingImplTest method runTest_resIsNoErrTypeIsFail.

@Test
public void runTest_resIsNoErrTypeIsFail() {
    Mockito.when(burst01.getBurstCategory()).thenReturn(BurstCategory.TCP_PROTOCOL);
    Mockito.when(burst01.getEnergy()).thenReturn(1.0);
    Mockito.when(burst01.getBeginTime()).thenReturn(2.0);
    List<Burst> burstCollection = new ArrayList<Burst>();
    burstCollection.add(burst01);
    Mockito.when(burstCollectionAnalysisData.getBurstCollection()).thenReturn(burstCollection);
    Mockito.when(burstCollectionAnalysisData.getTotalEnergy()).thenReturn(1.0);
    Mockito.when(tracedata.getBurstCollectionAnalysisData()).thenReturn(burstCollectionAnalysisData);
    connClsImpl = (ConnectionClosingImpl) context.getBean("connectionClosing");
    AbstractBestPracticeResult result = connClsImpl.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) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 62 with AbstractBestPracticeResult

use of com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult in project VideoOptimzer by attdevsupport.

the class ConnectionClosingImplTest method runTest_resIsNoErrTypeIsPass.

@Test
public void runTest_resIsNoErrTypeIsPass() {
    Mockito.when(burstCollectionAnalysisData.getTotalEnergy()).thenReturn(0.0);
    Mockito.when(tracedata.getBurstCollectionAnalysisData()).thenReturn(burstCollectionAnalysisData);
    connClsImpl = (ConnectionClosingImpl) context.getBean("connectionClosing");
    AbstractBestPracticeResult result = connClsImpl.runTest(tracedata);
    assertEquals(BPResultType.PASS, result.getResultType());
}
Also used : AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 63 with AbstractBestPracticeResult

use of com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult in project VideoOptimzer by attdevsupport.

the class VideoBestPractices method analyze.

public AROTraceData analyze(AROTraceData traceDataresult) {
    PacketAnalyzerResult result = null;
    if (null == traceDataresult) {
        return null;
    }
    result = traceDataresult.getAnalyzerResult();
    if (result == null) {
        return null;
    }
    VideoStallResult videoStallResult = null;
    VideoStartUpDelayResult videoStartUpDelayResult = null;
    BufferOccupancyResult bufferOccupancyResult = null;
    VideoNetworkComparisonResult videoNetworkComparisonResult = null;
    VideoTcpConnectionResult videoTcpConnectionResult = null;
    VideoChunkSizeResult videoChunkSizeResult = null;
    VideoChunkPacingResult videoChunkPacingResult = null;
    VideoRedundancyResult videoRedundancyResult = null;
    VideoConcurrentSessionResult videoConcurrentSessionResult = null;
    VideoVariableBitrateResult videoVariableBitrateResult = null;
    VideoAdaptiveBitrateLadderResult videoSegmentQualityResult = null;
    VideoResolutionQualityResult videoResolutionQualityResult = null;
    AudioStreamResult videoSeparateAudioResult = null;
    List<BestPracticeType> requests = BestPracticeType.getByCategory(Category.VIDEO);
    List<AbstractBestPracticeResult> bpResults = traceDataresult.getBestPracticeResults();
    List<AbstractBestPracticeResult> videoBestPracticeResults = aroService.analyze(result, requests);
    for (AbstractBestPracticeResult videoBPResult : videoBestPracticeResults) {
        BestPracticeType bpType = videoBPResult.getBestPracticeType();
        switch(bpType) {
            case VIDEO_STALL:
                videoStallResult = (VideoStallResult) videoBPResult;
                break;
            case STARTUP_DELAY:
                videoStartUpDelayResult = (VideoStartUpDelayResult) videoBPResult;
                break;
            case BUFFER_OCCUPANCY:
                bufferOccupancyResult = (BufferOccupancyResult) videoBPResult;
                break;
            case NETWORK_COMPARISON:
                videoNetworkComparisonResult = (VideoNetworkComparisonResult) videoBPResult;
                break;
            case TCP_CONNECTION:
                videoTcpConnectionResult = (VideoTcpConnectionResult) videoBPResult;
                break;
            case CHUNK_SIZE:
                videoChunkSizeResult = (VideoChunkSizeResult) videoBPResult;
                break;
            case CHUNK_PACING:
                videoChunkPacingResult = (VideoChunkPacingResult) videoBPResult;
                break;
            case VIDEO_REDUNDANCY:
                videoRedundancyResult = (VideoRedundancyResult) videoBPResult;
                break;
            case VIDEO_CONCURRENT_SESSION:
                videoConcurrentSessionResult = (VideoConcurrentSessionResult) videoBPResult;
                break;
            case VIDEO_VARIABLE_BITRATE:
                videoVariableBitrateResult = (VideoVariableBitrateResult) videoBPResult;
                break;
            case VIDEO_RESOLUTION_QUALITY:
                videoResolutionQualityResult = (VideoResolutionQualityResult) videoBPResult;
                break;
            case VIDEO_ABR_LADDER:
                videoSegmentQualityResult = (VideoAdaptiveBitrateLadderResult) videoBPResult;
                break;
            case AUDIO_STREAM:
                videoSeparateAudioResult = (AudioStreamResult) videoBPResult;
                break;
            default:
                break;
        }
    }
    sendGAVideoBPResult(videoBestPracticeResults);
    for (AbstractBestPracticeResult bestPractice : bpResults) {
        if (bestPractice instanceof VideoStallResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoStallResult);
        } else if (bestPractice instanceof VideoStartUpDelayResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoStartUpDelayResult);
        } else if (bestPractice instanceof BufferOccupancyResult) {
            bpResults.set(bpResults.indexOf(bestPractice), bufferOccupancyResult);
        } else if (bestPractice instanceof VideoNetworkComparisonResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoNetworkComparisonResult);
        } else if (bestPractice instanceof VideoTcpConnectionResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoTcpConnectionResult);
        } else if (bestPractice instanceof VideoChunkSizeResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoChunkSizeResult);
        } else if (bestPractice instanceof VideoChunkPacingResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoChunkPacingResult);
        } else if (bestPractice instanceof VideoChunkPacingResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoChunkPacingResult);
        } else if (bestPractice instanceof VideoRedundancyResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoRedundancyResult);
        } else if (bestPractice instanceof VideoConcurrentSessionResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoConcurrentSessionResult);
        } else if (bestPractice instanceof VideoVariableBitrateResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoVariableBitrateResult);
        } else if (bestPractice instanceof VideoResolutionQualityResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoResolutionQualityResult);
        } else if (bestPractice instanceof VideoAdaptiveBitrateLadderResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoSegmentQualityResult);
        } else if (bestPractice instanceof AudioStreamResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoSeparateAudioResult);
        }
    }
    traceDataresult.setBestPracticeResults(bpResults);
    return traceDataresult;
}
Also used : VideoRedundancyResult(com.att.aro.core.bestpractice.pojo.VideoRedundancyResult) VideoResolutionQualityResult(com.att.aro.core.bestpractice.pojo.VideoResolutionQualityResult) VideoNetworkComparisonResult(com.att.aro.core.bestpractice.pojo.VideoNetworkComparisonResult) AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) BestPracticeType(com.att.aro.core.bestpractice.pojo.BestPracticeType) VideoStallResult(com.att.aro.core.bestpractice.pojo.VideoStallResult) VideoConcurrentSessionResult(com.att.aro.core.bestpractice.pojo.VideoConcurrentSessionResult) VideoAdaptiveBitrateLadderResult(com.att.aro.core.bestpractice.pojo.VideoAdaptiveBitrateLadderResult) VideoTcpConnectionResult(com.att.aro.core.bestpractice.pojo.VideoTcpConnectionResult) VideoVariableBitrateResult(com.att.aro.core.bestpractice.pojo.VideoVariableBitrateResult) AudioStreamResult(com.att.aro.core.bestpractice.pojo.AudioStreamResult) BufferOccupancyResult(com.att.aro.core.bestpractice.pojo.BufferOccupancyResult) PacketAnalyzerResult(com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult) VideoChunkPacingResult(com.att.aro.core.bestpractice.pojo.VideoChunkPacingResult) VideoStartUpDelayResult(com.att.aro.core.bestpractice.pojo.VideoStartUpDelayResult) VideoChunkSizeResult(com.att.aro.core.bestpractice.pojo.VideoChunkSizeResult)

Example 64 with AbstractBestPracticeResult

use of com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult in project VideoOptimzer by attdevsupport.

the class VideoChunksPlot method refreshPlot.

// StartupDelay calculations
public AROTraceData refreshPlot(XYPlot plot, AROTraceData traceData, double startTime, VideoEvent selectedChunk) {
    chunkPlayTime.clear();
    chunkPlayTime.put(selectedChunk, startTime);
    videoChunkPlotter.setChunkPlayTimeList(chunkPlayTime);
    setChunkPlayBackTimeCollection(traceData);
    bufferInSecondsPlot.setChunkPlayTimeMap(chunkPlayTime);
    populate(plot, traceData);
    AbstractBestPracticeResult startupDelayBPResult = videoChunkPlotter.refreshStartUpDelayBP(traceData);
    if (traceData.getAnalyzerResult().getStreamingVideoData().getStreamingVideoCompiled().getChunksBySegmentID().isEmpty()) {
        return refreshBPVideoResults(traceData, startupDelayBPResult, null, null);
    }
    bufferInSecondsPlot.populate(bufferTimeXYPlot, traceData);
    bufferOccupancyPlot.populate(bufferOccupancyXYPlot, traceData);
    refreshVCPlot(plot, traceData);
    AbstractBestPracticeResult stallBPResult = null;
    AbstractBestPracticeResult bufferOccupancyBPResult = null;
    List<BestPracticeType> bpList = SettingsUtil.retrieveBestPractices();
    if (bpList.contains(BestPracticeType.VIDEO_STALL)) {
        stallBPResult = videoChunkPlotter.refreshVideoStallBP(traceData);
    }
    if (bpList.contains(BestPracticeType.BUFFER_OCCUPANCY)) {
        bufferOccupancyBPResult = videoChunkPlotter.refreshVideoBufferOccupancyBP(traceData);
    }
    return refreshBPVideoResults(traceData, startupDelayBPResult, stallBPResult, bufferOccupancyBPResult);
}
Also used : AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) BestPracticeType(com.att.aro.core.bestpractice.pojo.BestPracticeType)

Example 65 with AbstractBestPracticeResult

use of com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult in project VideoOptimzer by attdevsupport.

the class BpTestsConductedPanel method addTestsConductedSummary.

private void addTestsConductedSummary() {
    int bpRunCt = 0;
    if (bpResults != null) {
        for (AbstractBestPracticeResult bestPracticeResult : bpResults) {
            if (bestPracticeResult.getResultType() != BPResultType.NONE) {
                bpRunCt++;
            }
        }
        int gridY1 = 1;
        int column = 0;
        int rows = bpRunCt / 2 + 1;
        for (AbstractBestPracticeResult bestPracticeResult : bpResults) {
            if (bestPracticeResult.getResultType() == BPResultType.NONE) {
                continue;
            }
            if (gridY1 > rows) {
                gridY1 = 1;
                column = 2;
            }
            bestPracticeResult.getOverviewTitle();
            bestPracticeResult.getResultText();
            ImageIcon icon = loadImageIcon(bestPracticeResult);
            addGridCell(gridY1++, column, icon, bestPracticeResult.getOverviewTitle());
        }
    }
    if (bpRunCt == 0) {
        addGridCell(1, 0, null, "No tests conducted");
    }
}
Also used : ImageIcon(javax.swing.ImageIcon) AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) Point(java.awt.Point)

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