EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.workflow.pcm.jobs]

COVERAGE SUMMARY FOR SOURCE FILE [StoreAllPCMModelsJob.java]

nameclass, %method, %block, %line, %
StoreAllPCMModelsJob.java0%   (0/1)0%   (0/6)0%   (0/38)0%   (0/15)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class StoreAllPCMModelsJob0%   (0/1)0%   (0/6)0%   (0/38)0%   (0/15)
<static initializer> 0%   (0/1)0%   (0/4)0%   (0/2)
StoreAllPCMModelsJob (AbstractPCMWorkflowRunConfiguration): void 0%   (0/1)0%   (0/6)0%   (0/3)
execute (IProgressMonitor): void 0%   (0/1)0%   (0/21)0%   (0/6)
getName (): String 0%   (0/1)0%   (0/2)0%   (0/1)
rollback (IProgressMonitor): void 0%   (0/1)0%   (0/1)0%   (0/1)
setBlackboard (MDSDBlackboard): void 0%   (0/1)0%   (0/4)0%   (0/2)

1package de.uka.ipd.sdq.workflow.pcm.jobs;
2 
3import java.io.IOException;
4 
5import org.apache.log4j.Logger;
6import org.eclipse.core.runtime.IProgressMonitor;
7 
8import de.uka.ipd.sdq.workflow.IBlackboardInteractingJob;
9import de.uka.ipd.sdq.workflow.IJob;
10import de.uka.ipd.sdq.workflow.exceptions.JobFailedException;
11import de.uka.ipd.sdq.workflow.exceptions.RollbackFailedException;
12import de.uka.ipd.sdq.workflow.exceptions.UserCanceledException;
13import de.uka.ipd.sdq.workflow.mdsd.blackboard.MDSDBlackboard;
14import de.uka.ipd.sdq.workflow.pcm.blackboard.PCMResourceSetPartition;
15import de.uka.ipd.sdq.workflow.pcm.configurations.AbstractPCMWorkflowRunConfiguration;
16 
17/**
18 * Job to store the loaded PCM models.
19 *
20 * Prerequisite of this job:
21 * The working copy must have been created. E.g. by {@link CreateWorkingCopyOfModelsJob}.
22 *
23 * @author groenda
24 *
25 */
26public class StoreAllPCMModelsJob implements IJob,
27        IBlackboardInteractingJob<MDSDBlackboard> {
28 
29        /** The logger for this class */
30        private static final Logger logger = Logger.getLogger(StoreAllPCMModelsJob.class);
31 
32        /** The blackboard to interact with */
33        private MDSDBlackboard blackboard = null;
34 
35        /**
36         * Constructor requiring the necessary configuration object.
37         *
38         * @param configuration The configuration for this job.
39         */
40        public StoreAllPCMModelsJob(AbstractPCMWorkflowRunConfiguration configuration) {
41        }
42 
43        /**
44         * Execute this job and create the model copy.
45         */
46        public void execute(IProgressMonitor monitor) throws JobFailedException,
47                        UserCanceledException {
48 
49                PCMResourceSetPartition partition = (PCMResourceSetPartition) this.blackboard.getPartition(LoadPCMModelsIntoBlackboardJob.PCM_MODELS_PARTITION_ID);
50                try {
51                        partition.storeAllResources();
52                } catch (IOException e) {
53                        logger.error("unable to store all resources",e);
54                        throw new JobFailedException("Unable to store all Resources",e);
55                }
56        }
57 
58        public String getName() {
59                return "Update working copy of models";
60        }
61 
62        public void rollback(IProgressMonitor monitor)
63                        throws RollbackFailedException {
64                // nothing to roll back
65        }
66 
67        public void setBlackboard(MDSDBlackboard blackboard) {
68                this.blackboard = blackboard;
69        }
70 
71}

[all classes][de.uka.ipd.sdq.workflow.pcm.jobs]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov