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

COVERAGE SUMMARY FOR SOURCE FILE [FileExperimentDAO.java]

nameclass, %method, %block, %line, %
FileExperimentDAO.java100% (1/1)60%  (3/5)46%  (28/61)53%  (8/15)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FileExperimentDAO100% (1/1)60%  (3/5)46%  (28/61)53%  (8/15)
findByExperimentName (String): Collection 0%   (0/1)0%   (0/28)0%   (0/5)
removeExperiment (Experiment, boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
FileExperimentDAO (IDAOFactory, IDGenerator): void 100% (1/1)100% (6/6)100% (2/2)
addExperiment (String): Experiment 100% (1/1)100% (19/19)100% (5/5)
getExperiments (): Collection 100% (1/1)100% (3/3)100% (1/1)

1/**
2 * 
3 */
4package de.uka.ipd.sdq.sensorframework.dao.file;
5 
6import java.util.ArrayList;
7import java.util.Collection;
8import java.util.Collections;
9import java.util.List;
10 
11import de.uka.ipd.sdq.sensorframework.dao.file.entities.ExperimentImpl;
12import de.uka.ipd.sdq.sensorframework.entities.Experiment;
13import de.uka.ipd.sdq.sensorframework.entities.dao.IDAOFactory;
14import de.uka.ipd.sdq.sensorframework.entities.dao.IExperimentDAO;
15 
16/**
17 * @author Ihssane El-Oudghiri 
18 * @author Steffen Becker
19 * 
20 * Data Access Object (DAO) for persistence of Experiment Objects.
21 * 
22 */
23public class FileExperimentDAO extends AbstractFileDAO<Experiment> implements IExperimentDAO {
24 
25        public FileExperimentDAO(IDAOFactory factory, IDGenerator idGen) {
26                super(factory,idGen,FileDAOFactory.EXP_FILE_NAME_PREFIX);
27        }
28 
29        public Experiment addExperiment(String p_experimentname) {
30                ExperimentImpl exp = new ExperimentImpl(factory);
31                exp.setExperimentID(idGen.getNextExperimentID());
32                exp.setExperimentName(p_experimentname);
33 
34                this.putEntity(exp);
35                
36                return exp;
37        }
38 
39        /**{@inheritDoc}*/
40        public Collection<Experiment> findByExperimentName(String searchKey) {
41                List<Experiment> result = new ArrayList<Experiment>();
42                for (Experiment exp : getAllEntities())
43                        if (exp.getExperimentName().equals(searchKey))
44                                result.add(exp);
45 
46                return Collections.unmodifiableCollection(result);
47        }
48 
49        public Collection<Experiment> getExperiments() {
50                return this.getAllEntities();
51        }
52 
53        public void removeExperiment(Experiment experiment, boolean doCascade) {
54                this.removeEntity(experiment, doCascade);
55        }
56}

[all classes][de.uka.ipd.sdq.sensorframework.dao.file]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov