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

COVERAGE SUMMARY FOR SOURCE FILE [SetupPipesAndFiltersStrategy.java]

nameclass, %method, %block, %line, %
SetupPipesAndFiltersStrategy.java0%   (0/2)0%   (0/6)0%   (0/86)0%   (0/27)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SetupPipesAndFiltersStrategy0%   (0/1)0%   (0/4)0%   (0/69)0%   (0/24)
<static initializer> 0%   (0/1)0%   (0/4)0%   (0/2)
SetupPipesAndFiltersStrategy (SimuComModel): void 0%   (0/1)0%   (0/6)0%   (0/3)
createWriteStrategy (): IRawWriteStrategy 0%   (0/1)0%   (0/36)0%   (0/13)
setupDataSink (Calculator, MetaDataInit): PipesAndFiltersManager 0%   (0/1)0%   (0/23)0%   (0/6)
     
class SetupPipesAndFiltersStrategy$10%   (0/1)0%   (0/2)0%   (0/17)0%   (0/4)
SetupPipesAndFiltersStrategy$1 (SetupPipesAndFiltersStrategy, PipesAndFilters... 0%   (0/1)0%   (0/9)0%   (0/2)
calculated (Vector): void 0%   (0/1)0%   (0/8)0%   (0/2)

1package de.uka.ipd.sdq.simucomframework.calculator;
2 
3import java.util.Vector;
4 
5import javax.measure.Measure;
6import javax.measure.quantity.Quantity;
7 
8import org.apache.log4j.Logger;
9import org.eclipse.core.runtime.CoreException;
10 
11import de.uka.ipd.sdq.pipesandfilters.framework.MetaDataInit;
12import de.uka.ipd.sdq.pipesandfilters.framework.PipeData;
13import de.uka.ipd.sdq.pipesandfilters.framework.PipesAndFiltersManager;
14import de.uka.ipd.sdq.pipesandfilters.framework.recorder.IRawWriteStrategy;
15import de.uka.ipd.sdq.pipesandfilters.framework.recorder.RawRecorder;
16import de.uka.ipd.sdq.pipesandfilters.framework.recorder.Recorder;
17import de.uka.ipd.sdq.pipesandfilters.framework.recorder.launch.RecorderExtensionHelper;
18import de.uka.ipd.sdq.probespec.framework.calculator.Calculator;
19import de.uka.ipd.sdq.probespec.framework.calculator.ICalculatorListener;
20import de.uka.ipd.sdq.simucomframework.model.SimuComModel;
21 
22public class SetupPipesAndFiltersStrategy implements ISetupDataSinkStrategy {
23        /** Logger for this class. */
24        private static final Logger logger = Logger.getLogger(SetupPipesAndFiltersStrategy.class);
25 
26        private SimuComModel model;
27 
28        public SetupPipesAndFiltersStrategy(SimuComModel model) {
29                this.model = model;
30        }
31 
32        public PipesAndFiltersManager setupDataSink(Calculator calculator, MetaDataInit metaData) {
33                // Initialize recorder and Pipes-and-Filters-Manger
34                Recorder recorder = new RawRecorder(createWriteStrategy());
35                final PipesAndFiltersManager pipeManager = new PipesAndFiltersManager(
36                                recorder);
37                pipeManager.initialize(metaData);
38 
39                calculator.addCalculatorListener(new ICalculatorListener() {
40 
41                        public void calculated(Vector<Measure<?, ? extends Quantity>> resultTuple) {
42                                pipeManager.processData(new PipeData(resultTuple));
43                        }
44                });
45 
46                return pipeManager;
47        }
48 
49        private IRawWriteStrategy createWriteStrategy() {
50                try {
51                        String writeStrategyClass = RecorderExtensionHelper
52                                        .getWriteStrategyClassNameForName(model.getConfiguration()
53                                                        .getRecorderName());
54                        return (IRawWriteStrategy) Class.forName(writeStrategyClass).newInstance();
55                } catch (CoreException e) {
56                        logger.error("Could not create write strategy.", e);
57                } catch (InstantiationException e) {
58                        logger.error("Could not create write strategy.", e);
59                } catch (IllegalAccessException e) {
60                        logger.error("Could not create write strategy.", e);
61                } catch (ClassNotFoundException e) {
62                        logger.error("Could not create write strategy.", e);
63                }
64                return null;
65        }
66 
67}

[all classes][de.uka.ipd.sdq.simucomframework.calculator]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov