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

COVERAGE SUMMARY FOR SOURCE FILE [AbstractSimulationLaunchConfigurationBasedConfigBuilder.java]

nameclass, %method, %block, %line, %
AbstractSimulationLaunchConfigurationBasedConfigBuilder.java0%   (0/1)0%   (0/3)0%   (0/103)0%   (0/27)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AbstractSimulationLaunchConfigurationBasedConfigBuilder0%   (0/1)0%   (0/3)0%   (0/103)0%   (0/27)
AbstractSimulationLaunchConfigurationBasedConfigBuilder (ILaunchConfiguration... 0%   (0/1)0%   (0/5)0%   (0/2)
fillConfiguration (AbstractWorkflowBasedRunConfiguration): void 0%   (0/1)0%   (0/72)0%   (0/21)
hasValidSensitvityVariableAttribute (String): boolean 0%   (0/1)0%   (0/26)0%   (0/4)

1package de.uka.ipd.sdq.codegen.simucontroller.runconfig;
2 
3import org.eclipse.core.runtime.CoreException;
4import org.eclipse.debug.core.ILaunchConfiguration;
5 
6import de.uka.ipd.sdq.simucomframework.SimuComConfig;
7import de.uka.ipd.sdq.workflow.launchconfig.AbstractWorkflowBasedRunConfiguration;
8import de.uka.ipd.sdq.workflow.launchconfig.AbstractWorkflowConfigurationBuilder;
9import de.uka.ipd.sdq.workflow.pcm.ConstantsContainer;
10import de.uka.ipd.sdq.workflow.pcm.configurations.AbstractCodeGenerationWorkflowRunConfiguration.CodeGenerationAdvice;
11import de.uka.ipd.sdq.workflow.pcm.runconfig.SensitivityAnalysisConfiguration;
12 
13public abstract class AbstractSimulationLaunchConfigurationBasedConfigBuilder
14extends AbstractWorkflowConfigurationBuilder {
15 
16        public AbstractSimulationLaunchConfigurationBasedConfigBuilder(
17                        ILaunchConfiguration configuration, String mode) throws CoreException {
18                super(configuration,mode);
19        }
20 
21        @Override
22        public void fillConfiguration(AbstractWorkflowBasedRunConfiguration configuration) throws CoreException {
23                AbstractSimulationWorkflowConfiguration config = (AbstractSimulationWorkflowConfiguration) configuration;
24 
25                config.setCodeGenerationAdvicesFile(CodeGenerationAdvice.SIMULATION);
26 
27                config.setDebug(this.isDebug);
28                if (hasAttribute(SimuComConfig.SHOULD_THROW_EXCEPTION))
29                        config.setInteractive(getBooleanAttribute(SimuComConfig.SHOULD_THROW_EXCEPTION));
30                else
31                        config.setInteractive(true);
32 
33                config.setSimulateLinkingResources(getBooleanAttribute(ConstantsContainer.SIMULATE_LINKING_RESOURCES));
34 
35                //This loads the feature config for Steffen's Connector Completions
36                //TODO: Integrate this in CIP process.
37                config.setFeatureConfigFile( getStringAttribute(ConstantsContainer.FEATURE_CONFIG) );
38 
39                config.setSensitivityAnalysisEnabled(
40                                hasValidSensitvityVariableAttribute(ConstantsContainer.VARIABLE_TEXT));
41                if (config.isSensitivityAnalysisEnabled()) {
42                        SensitivityAnalysisConfiguration sensitivityConfig =
43                                new SensitivityAnalysisConfiguration(
44                                                "",
45                                                //TODO: getStringAttribute(ConstantsContainer.VARIABLE_SHORT_NAME),
46                                                getStringAttribute(ConstantsContainer.VARIABLE_TEXT),
47                                                getDoubleAttribute(ConstantsContainer.MINIMUM_TEXT),
48                                                getDoubleAttribute(ConstantsContainer.MAXIMUM_TEXT),
49                                                getDoubleAttribute(ConstantsContainer.STEP_WIDTH_TEXT));
50                        config.setSensitivityAnalysisConfiguration(sensitivityConfig);
51                }
52                
53                config.setCompletionConfiguration(new PCMCompletionRunConfiguration(config, properties));
54        }
55 
56        private boolean hasValidSensitvityVariableAttribute(String attribute) throws CoreException {
57                if (!configuration.hasAttribute(attribute))
58                        return false;
59                Object value = getStringAttribute(attribute);
60                //Anne: I sometimes get a "NO ELEMENT SELECTED" result from the LaunchConfig even if I deleted the string from the field
61                //I have no idea how to fix it directly, so I need to catch it here.
62                //It seems to only appear in the Design Space Exploration tab.
63                return value instanceof String && !value.equals("") && !value.equals("NO ELEMENT SELECTED");
64        }
65 
66}

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