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

COVERAGE SUMMARY FOR SOURCE FILE [PcmResourceEnvironmentSelectorPage.java]

nameclass, %method, %block, %line, %
PcmResourceEnvironmentSelectorPage.java0%   (0/1)0%   (0/3)0%   (0/46)0%   (0/15)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ResourceEnvironmentSelectorPage0%   (0/1)0%   (0/3)0%   (0/46)0%   (0/15)
ResourceEnvironmentSelectorPage (ResourceEnvironment): void 0%   (0/1)0%   (0/14)0%   (0/5)
getSelectedResourceEnvironment (): ResourceEnvironment 0%   (0/1)0%   (0/3)0%   (0/1)
validatePage (): boolean 0%   (0/1)0%   (0/29)0%   (0/9)

1package de.uka.ipd.sdq.pcm.gmf.allocation.part;
2 
3import de.uka.ipd.sdq.pcm.resourceenvironment.ResourceEnvironment;
4 
5/**
6 * This wizard page uses the regular resource selector page, but checks
7 * the type of the resource selected by the user to be a ResourceEnvironment.
8 */
9class ResourceEnvironmentSelectorPage extends ResourceSelectorPage {
10 
11        private ResourceEnvironment myResourceEnvironment;
12        
13        protected ResourceEnvironmentSelectorPage(ResourceEnvironment selectedResourceEnvironment) {
14                super("Select resource environment",selectedResourceEnvironment);
15                setTitle("Diagram resource environment");
16                setDescription("Select the resource environment to be used for the diagram.");
17                myResourceEnvironment = selectedResourceEnvironment;
18        }
19        
20        protected ResourceEnvironment getSelectedResourceEnvironment() {
21                return myResourceEnvironment;
22        }
23 
24        @Override
25        protected boolean validatePage() {
26                if (getResolvedObject() == null) {
27                        setErrorMessage("No resource environment selected");
28                        return false;
29                }
30 
31                if (getResolvedObject() instanceof ResourceEnvironment) {
32                        myResourceEnvironment = (ResourceEnvironment) getResolvedObject(); 
33                }
34                else {
35                        setErrorMessage("Wrong resource type selected");
36                        return false;
37                }
38 
39                setErrorMessage(null);
40                return super.validatePage();
41        }
42}

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