EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.fzi.se.accuracy.jobs]

COVERAGE SUMMARY FOR SOURCE FILE [ShowAccuracyInfluenceAnalysisErrorsJob.java]

nameclass, %method, %block, %line, %
ShowAccuracyInfluenceAnalysisErrorsJob.java0%   (0/1)0%   (0/7)0%   (0/60)0%   (0/22)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ShowAccuracyInfluenceAnalysisErrorsJob0%   (0/1)0%   (0/7)0%   (0/60)0%   (0/22)
<static initializer> 0%   (0/1)0%   (0/4)0%   (0/2)
ShowAccuracyInfluenceAnalysisErrorsJob (AbstractWorkflowBasedRunConfiguration... 0%   (0/1)0%   (0/11)0%   (0/4)
addIssues (List): void 0%   (0/1)0%   (0/8)0%   (0/3)
displayValidationErrors (List): void 0%   (0/1)0%   (0/19)0%   (0/6)
execute (IProgressMonitor): void 0%   (0/1)0%   (0/15)0%   (0/5)
getName (): String 0%   (0/1)0%   (0/2)0%   (0/1)
rollback (IProgressMonitor): void 0%   (0/1)0%   (0/1)0%   (0/1)

1package de.fzi.se.accuracy.jobs;
2 
3import java.util.ArrayList;
4import java.util.List;
5 
6import org.apache.log4j.Logger;
7import org.eclipse.core.runtime.IProgressMonitor;
8 
9import de.uka.ipd.sdq.errorhandling.SeverityAndIssue;
10import de.uka.ipd.sdq.errorhandling.dialogs.issues.DisplayIssuesDialog;
11import de.uka.ipd.sdq.workflow.IJob;
12import de.uka.ipd.sdq.workflow.exceptions.JobFailedException;
13import de.uka.ipd.sdq.workflow.exceptions.RollbackFailedException;
14import de.uka.ipd.sdq.workflow.exceptions.UserCanceledException;
15import de.uka.ipd.sdq.workflow.launchconfig.AbstractWorkflowBasedRunConfiguration;
16import de.uka.ipd.sdq.workflow.pcm.jobs.IIssueReceiver;
17 
18public class ShowAccuracyInfluenceAnalysisErrorsJob
19implements IJob, IIssueReceiver {
20        /** Logger for this class. */
21        private static final Logger logger = Logger.getLogger(ShowAccuracyInfluenceAnalysisErrorsJob.class);
22 
23        /**        Run configuration. */
24        private final AbstractWorkflowBasedRunConfiguration configuration;
25 
26        /**List of known issues. */
27        private final List<SeverityAndIssue> issues;
28 
29        public ShowAccuracyInfluenceAnalysisErrorsJob(AbstractWorkflowBasedRunConfiguration configuration) {
30                super();
31                this.configuration = configuration;
32                issues = new ArrayList<SeverityAndIssue>();
33        }
34 
35        @Override
36        public void execute(IProgressMonitor monitor) throws JobFailedException,
37                        UserCanceledException {
38                if (issues.size() > 0) {
39                        logger.warn("Found validation problems in the models");
40                        displayValidationErrors(issues);
41                        logger.warn("Continuing workflow, ignoring model validation issues");
42                }
43 
44        }
45 
46        @Override
47        public String getName() {
48                return "Show accuracy influence analysis errors";
49        }
50 
51        @Override
52        public void rollback(IProgressMonitor monitor)
53                        throws RollbackFailedException {
54                // Intentionally left empty
55        }
56 
57        private void displayValidationErrors(
58                        List<SeverityAndIssue> overallResult)
59                        throws UserCanceledException {
60 
61                /**
62                 * Disable the IssuesDialog, if job is run in non-interactive mode.
63                 */
64                if (configuration.isInteractive()) {
65                        DisplayIssuesDialog runner = new DisplayIssuesDialog(overallResult);
66                        DisplayIssuesDialog.showDialogSync(runner);
67                        if (!runner.shouldProceedAfterErrorDialog())
68                                throw new UserCanceledException();
69                }
70        }
71 
72        /* (non-Javadoc)
73         * @see de.fzi.se.accuracy.jobs.IIssueReceiver#addIssues(java.util.List)
74         */
75        public void addIssues(List<SeverityAndIssue> issues) {
76                if (issues != null) {
77                        this.issues.addAll(issues);
78                }
79        }
80}

[all classes][de.fzi.se.accuracy.jobs]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov