1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package fr.ens.transcriptome.doelan.data;
23
24 import org.apache.log4j.Logger;
25
26 import fr.ens.transcriptome.nividic.platform.PlatformException;
27 import fr.ens.transcriptome.nividic.platform.data.Data;
28 import fr.ens.transcriptome.nividic.platform.data.DataDefaults;
29 import fr.ens.transcriptome.nividic.platform.module.AboutModule;
30 import fr.ens.transcriptome.nividic.platform.module.Module;
31 import fr.ens.transcriptome.nividic.platform.module.ModuleDescription;
32 import fr.ens.transcriptome.nividic.util.SystemUtils;
33
34 /***
35 * This class define a nividic data object for testsuite results.
36 * @author Laurent Jourdren
37 */
38 public class TestSuiteResultData extends Data implements Module {
39
40
41 private static Logger log = Logger.getLogger(TestSuiteResultData.class);
42
43 /***
44 * Get the name of the data.
45 * @return The name of the data
46 */
47 public String getName() {
48 return SystemUtils.getClassNameWithoutPackage(TestSuiteResultData.class);
49 }
50
51 /***
52 * Get the format of the data.
53 * @return The name of the format of the data
54 */
55 public String getFormat() {
56 return DataDefaults.OM_FORMAT;
57 }
58
59 /***
60 * Get the type of the data.
61 * @return The type of the data.
62 */
63 public String getType() {
64 return DoelanDataDefaults.TESTSUITE_RESULT_TYPE;
65 }
66
67 /***
68 * Get the class of the data.
69 * @return The class of the data.
70 */
71 public Class getDataClass() {
72 return TestSuiteResult.class;
73 }
74
75 /***
76 * Set the Result.
77 * @param result Result to set
78 */
79 public void setData(final TestSuiteResult result) {
80
81 try {
82 super.setData(result);
83 } catch (PlatformException e) {
84 log.error("Cast exception");
85 }
86
87 }
88
89 /***
90 * Get the description of the module.
91 * @return The description of the module
92 */
93 public AboutModule aboutModule() {
94
95 ModuleDescription md = null;
96 try {
97 md = new ModuleDescription("TestSuiteResult",
98 "QualityTestSuiteResult result data type");
99 } catch (PlatformException e) {
100 log.error("Unable to create module description");
101 }
102 return md;
103 }
104
105
106
107
108
109 /***
110 * Public constructor.
111 * @param result Result of a QualityUnitTest
112 */
113 public TestSuiteResultData(final TestSuiteResult result) {
114 setData(result);
115 }
116
117 }