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

COVERAGE SUMMARY FOR SOURCE FILE [ExampleTakePassiveResourceState.java]

nameclass, %method, %block, %line, %
ExampleTakePassiveResourceState.java0%   (0/1)0%   (0/2)0%   (0/44)0%   (0/11)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ExampleTakePassiveResourceState0%   (0/1)0%   (0/2)0%   (0/44)0%   (0/11)
ExampleTakePassiveResourceState (): void 0%   (0/1)0%   (0/3)0%   (0/1)
takeSample (String, Object []): ProbeSample 0%   (0/1)0%   (0/41)0%   (0/10)

1package de.uka.ipd.sdq.probespec.framework.probes.example;
2 
3import javax.measure.Measure;
4import javax.measure.quantity.Dimensionless;
5 
6import de.uka.ipd.sdq.probespec.framework.ProbeSample;
7import de.uka.ipd.sdq.probespec.framework.ProbeType;
8import de.uka.ipd.sdq.probespec.framework.probes.IProbeStrategy;
9 
10public class ExampleTakePassiveResourceState implements IProbeStrategy {
11 
12        /**
13         * @param o
14         *            expects a {@link ASimpleActiveResource}
15         */
16        @Override
17        public ProbeSample<Integer, Dimensionless> takeSample(String probeId,
18                        Object... o) {
19                ASimplePassiveResource res = null;
20                if (o[0] instanceof ASimplePassiveResource) {
21                        res = (ASimplePassiveResource) o[0];
22                } else {
23                        throw new IllegalArgumentException("Expected an argument of type "
24                                        + ASimplePassiveResource.class.getSimpleName() + ".");
25                }
26 
27                Measure<Integer, Dimensionless> free = Measure.valueOf(res.getFree(),
28                                Dimensionless.UNIT);
29                ProbeSample<Integer, Dimensionless> sample = new ProbeSample<Integer, Dimensionless>(
30                                free, probeId, ProbeType.RESOURCE_STATE);
31 
32                return sample;
33        }
34 
35}

[all classes][de.uka.ipd.sdq.probespec.framework.probes.example]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov