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

COVERAGE SUMMARY FOR SOURCE FILE [SimuComFactory.java]

nameclass, %method, %block, %line, %
SimuComFactory.java0%   (0/1)0%   (0/3)0%   (0/64)0%   (0/15)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SimuComFactory0%   (0/1)0%   (0/3)0%   (0/64)0%   (0/15)
<static initializer> 0%   (0/1)0%   (0/4)0%   (0/2)
SimuComFactory (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getSimuComModel (SimuComConfig, SimuComStatus, boolean): SimuComModel 0%   (0/1)0%   (0/57)0%   (0/13)

1package de.uka.ipd.sdq.simucomframework;
2 
3import org.apache.log4j.Logger;
4import org.eclipse.core.runtime.CoreException;
5import org.eclipse.core.runtime.IConfigurationElement;
6import org.eclipse.core.runtime.Platform;
7 
8import de.uka.ipd.sdq.simucomframework.model.SimuComModel;
9import de.uka.ipd.sdq.simucomframework.simucomstatus.SimuComStatus;
10import de.uka.ipd.sdq.simulation.abstractsimengine.ISimEngineFactory;
11 
12/**
13 * Factory for creating simulation objects. The created objects are already attached
14 * to a desmo-j experiment
15 * @author Steffen Becker
16 *
17 */
18public class SimuComFactory {
19        /** Logger for this class. */
20        private static final Logger logger = Logger.getLogger(SimuComFactory.class);
21 
22        /**
23         * Create a new simulation model as needed by desmo-j
24         * @param name The name of the simulation model
25         * @param showInReport Should desmoj report on our experiment
26         * @param showInTrance Should desmoj trace our experiment
27         * @return The created simulation model
28         */
29        public static SimuComModel getSimuComModel(SimuComConfig config, SimuComStatus simuComStatus, boolean isRemote) {
30                ISimEngineFactory factory = null;
31 
32                for(IConfigurationElement configurationElement : Platform.getExtensionRegistry().
33                                getConfigurationElementsFor("de.uka.ipd.sdq.simulation.abstractsimengine.engine")){
34 
35                        try {
36                                if (configurationElement.getAttribute("id").equals(config.getEngine()))
37                                factory = (ISimEngineFactory)configurationElement.createExecutableExtension("class");
38                        } catch (CoreException e) {
39                                logger.warn("Could not get factory for registered simulation engine.", e);
40                                factory = null;
41                        }
42                }
43                if (factory == null)
44                        throw new RuntimeException("No Simulation Engine available. Please install at least one engine.");
45                else {
46                        SimuComModel model = new SimuComModel(
47                                        config, simuComStatus, factory, isRemote);
48 
49                        return model;
50                }
51        }
52 
53}

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