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

COVERAGE SUMMARY FOR SOURCE FILE [TakeScheduledResourceStateStrategy.java]

nameclass, %method, %block, %line, %
TakeScheduledResourceStateStrategy.java0%   (0/1)0%   (0/2)0%   (0/48)0%   (0/11)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TakeScheduledResourceStateStrategy0%   (0/1)0%   (0/2)0%   (0/48)0%   (0/11)
TakeScheduledResourceStateStrategy (): void 0%   (0/1)0%   (0/3)0%   (0/1)
takeSample (String, Object []): ProbeSample 0%   (0/1)0%   (0/45)0%   (0/10)

1package de.uka.ipd.sdq.simucomframework.probes;
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;
9import de.uka.ipd.sdq.simucomframework.resources.AbstractScheduledResource;
10 
11/**
12 * ProbeStrategy which is able to measure the state of a
13 * {@link AbstractScheduledResource}. The state is the total job count of the
14 * resource.
15 *
16 * @author Philipp Merkle
17 *
18 */
19public class TakeScheduledResourceStateStrategy implements IProbeStrategy {
20 
21        /**
22         * @param o
23         *            expects a {@link Integer} representing the resource state
24         */
25        public ProbeSample<Integer, Dimensionless> takeSample(String probeId,
26                        Object... o) {
27                Integer state = null;
28                if (o.length >= 1 && o[0] instanceof Integer) {
29                        state = (Integer) o[0];
30                } else {
31                        throw new IllegalArgumentException("Expected an argument of type "
32                                        + Integer.class.getSimpleName() + ".");
33                }
34 
35                Measure<Integer, Dimensionless> stateMeasure = Measure.valueOf(state,
36                                Dimensionless.UNIT);
37                ProbeSample<Integer, Dimensionless> sample = new ProbeSample<Integer, Dimensionless>(
38                                stateMeasure, probeId, ProbeType.RESOURCE_STATE);
39 
40                return sample;
41        }
42 
43}

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