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

COVERAGE SUMMARY FOR SOURCE FILE [TestCrossingMeanWarmUpFilter.java]

nameclass, %method, %block, %line, %
TestCrossingMeanWarmUpFilter.java0%   (0/1)0%   (0/2)0%   (0/99)0%   (0/23)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TestCrossingMeanWarmUpFilter0%   (0/1)0%   (0/2)0%   (0/99)0%   (0/23)
TestCrossingMeanWarmUpFilter (): void 0%   (0/1)0%   (0/3)0%   (0/1)
testWarmUpFilter (): void 0%   (0/1)0%   (0/96)0%   (0/22)

1package de.uka.ipd.sdq.statistics.test;
2 
3import java.io.File;
4import java.util.ArrayList;
5import java.util.Collection;
6import java.util.List;
7 
8import junit.framework.TestCase;
9import de.uka.ipd.sdq.sensorframework.dao.file.FileDAOFactory;
10import de.uka.ipd.sdq.sensorframework.entities.Measurement;
11import de.uka.ipd.sdq.sensorframework.entities.TimeSpanMeasurement;
12import de.uka.ipd.sdq.sensorframework.entities.dao.IDAOFactory;
13import de.uka.ipd.sdq.statistics.CrossingMeanWarmUpFilter;
14 
15/**
16 * Tests the {@link CrossingMeanWarmUpFilter}. This test case is intended for
17 * manual testing only. For evaluating the outcome the date series needs to be
18 * plotted (e.g. as time series) and compared manually.
19 * 
20 * @author Philipp Merkle
21 * 
22 */
23public class TestCrossingMeanWarmUpFilter extends TestCase {
24 
25        public void testWarmUpFilter() {
26                // Adjust path to data store here!
27                String dataStorePath = "D:\\Studium\\Master\\HiWi IPD\\runtime-150909\\brs\\Data4";
28 
29                File dataStoreFolder = new File(dataStorePath);
30                if (dataStoreFolder.exists()) {
31                        IDAOFactory factory = new FileDAOFactory(dataStorePath);
32                        Collection<Measurement> measurements = TestUtils.loadMeasurements(
33                                        factory, 0, 0, 24);
34 
35                        List<Double> samples = new ArrayList<Double>(measurements.size());
36                        for (Measurement m : measurements) {
37                                TimeSpanMeasurement tsm = (TimeSpanMeasurement) m;
38                                samples.add(tsm.getTimeSpan());
39                        }
40 
41                        CrossingMeanWarmUpFilter filter = new CrossingMeanWarmUpFilter();
42                        int i = 0;
43                        for (Double sample : samples) {
44                                filter.offerSample(sample);
45                                if (filter.isStationary()) {
46                                        System.out.println("Warm-Up Peroid: Up to measurement " + i);
47                                        break;
48                                }
49                                ++i;
50                        }
51 
52                        factory.finalizeAndClose();
53                } else {
54                        System.err.println("Could not find data store path \""
55                                        + dataStorePath + "\"");
56                }
57        }
58 
59}

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