Package hudson.plugins.analysis.util.model

Examples of hudson.plugins.analysis.util.model.AnnotationContainer


        modules = new HashSet<String>(result.getModules());
        numberOfModules = modules.size();
        errors = new ArrayList<String>(result.getErrorMessages());
        numberOfWarnings = result.getNumberOfAnnotations();
        AnnotationContainer referenceResult = history.getReferenceAnnotations();

        delta = result.getNumberOfAnnotations() - referenceResult.getNumberOfAnnotations();
        lowDelta = computeDelta(result, referenceResult, Priority.LOW);
        normalDelta = computeDelta(result, referenceResult, Priority.NORMAL);
        highDelta = computeDelta(result, referenceResult, Priority.HIGH);

        Set<FileAnnotation> allWarnings = result.getAnnotations();

        Set<FileAnnotation> newWarnings = AnnotationDifferencer.getNewAnnotations(allWarnings, referenceResult.getAnnotations());
        numberOfNewWarnings = newWarnings.size();
        newWarningsReference = new WeakReference<Collection<FileAnnotation>>(newWarnings);

        Set<FileAnnotation> fixedWarnings = AnnotationDifferencer.getFixedAnnotations(allWarnings, referenceResult.getAnnotations());
        numberOfFixedWarnings = fixedWarnings.size();
        fixedWarningsReference = new WeakReference<Collection<FileAnnotation>>(fixedWarnings);

        highWarnings = result.getNumberOfAnnotations(Priority.HIGH);
        normalWarnings = result.getNumberOfAnnotations(Priority.NORMAL);
View Full Code Here


            FileNotFoundException, InterruptedException {
        FilePath directory = new FilePath(buildRoot, AbstractAnnotation.WORKSPACE_FILES);
        if (!directory.exists()) {
            directory.mkdirs();
        }
        AnnotationContainer container = new DefaultAnnotationContainer(annotations);
        for (WorkspaceFile file : container.getFiles()) {
            FilePath masterFile = new FilePath(directory, file.getTempName());
            if (!masterFile.exists()) {
                try {
                    new FilePath((Channel)null, file.getName()).copyTo(masterFile);
                }
View Full Code Here

        TestResultAction action = mockAction(withResult);
        when(withResult.getAction(TestResultAction.class)).thenReturn(action);
        BuildResult result = mock(BuildResult.class);
        when(action.getResult()).thenReturn(result);
        AnnotationContainer container = mock(AnnotationContainer.class);
        when(result.getContainer()).thenReturn(container);
        BuildHistory history = createHistory(baseline);

        assertTrue("Build has no previous result", history.hasPreviousResult());
        assertSame("Build has wrong previous result", result, history.getPreviousResult());
View Full Code Here

        TestResultAction action = mockAction(withResult);
        when(withResult.getAction(TestResultAction.class)).thenReturn(action);
        BuildResult result = mock(BuildResult.class);
        when(action.getResult()).thenReturn(result);
        AnnotationContainer container = mock(AnnotationContainer.class);
        when(result.getContainer()).thenReturn(container);
        when(result.getPluginResult()).thenReturn(pluginResult);
        BuildHistory history = createHistory(baseline);

        assertEquals("Build has previous result", expectedResult, history.hasPreviousResult());
View Full Code Here

        when(withFailureResult.getPreviousBuild()).thenReturn(noResult2);
        when(noResult2.getPreviousBuild()).thenReturn(withSuccessResult);

        BuildResult failureResult = createFailureResult(withFailureResult);

        AnnotationContainer container = createSuccessfulResult(withSuccessResult);

        BuildHistory history = createHistory(baseline);

        assertTrue("Build has no previous result", history.hasPreviousResult());
        assertSame("Build has wrong previous result", failureResult, history.getPreviousResult());
View Full Code Here

        when(withSuccessResult.getPreviousBuild()).thenReturn(withSuccessResultAndSuccessfulBuild);

        BuildResult failureResult = createFailureResult(withFailureResult);

        createSuccessfulResult(withSuccessResult);
        AnnotationContainer used = createSuccessfulResult(withSuccessResultAndSuccessfulBuild);

        BuildHistory history = createHistory(baseline);

        assertTrue("Build has no previous result", history.hasPreviousResult());
        assertSame("Build has wrong previous result", failureResult, history.getPreviousResult());
View Full Code Here

    private AnnotationContainer createSuccessfulResult(final AbstractBuild withSuccessResult) {
        TestResultAction successAction = mockAction(withSuccessResult);
        when(withSuccessResult.getAction(TestResultAction.class)).thenReturn(successAction);
        when(successAction.isSuccessful()).thenReturn(true);
        BuildResult successResult = mock(BuildResult.class);
        AnnotationContainer container = mock(AnnotationContainer.class);
        when(successResult.getContainer()).thenReturn(container);
        when(successAction.getResult()).thenReturn(successResult);
        when(successResult.getPluginResult()).thenReturn(Result.SUCCESS);
        return container;
    }
View Full Code Here

TOP

Related Classes of hudson.plugins.analysis.util.model.AnnotationContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.