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.algorithms;
23
24 import fr.ens.transcriptome.doelan.data.DoelanDataUtils;
25 import fr.ens.transcriptome.doelan.data.QualityUnitTestResult;
26 import fr.ens.transcriptome.doelan.data.QualityUnitTestResultData;
27 import fr.ens.transcriptome.doelan.data.TestSuiteResult;
28 import fr.ens.transcriptome.nividic.om.BioAssay;
29 import fr.ens.transcriptome.nividic.platform.PlatformException;
30 import fr.ens.transcriptome.nividic.platform.workflow.Container;
31 import fr.ens.transcriptome.nividic.platform.workflow.SimpleAlgorithmEvent;
32 import fr.ens.transcriptome.nividic.util.parameter.Parameters;
33
34 /***
35 * This class define a quality unit test.
36 * @author Laurent Jourdren
37 */
38 public abstract class QualityUnitTest extends QualityTest {
39
40 protected void doIt(final Container c, final Parameters parameters)
41 throws PlatformException {
42
43 BioAssay bioassay = DoelanDataUtils.getBioAssay(c);
44 BioAssay arraylist = DoelanDataUtils.getArrayList(c);
45 TestSuiteResult tsr = DoelanDataUtils.getTestSuiteResult(c);
46
47 QualityUnitTestResult result = test(bioassay, arraylist, parameters);
48
49 tsr.addTestId(result.getTestId());
50
51 if (result == null)
52 throw new PlatformException("The result of " + getId() + " ("
53 + aboutModule().getName() + ") is null");
54
55 c.add(new QualityUnitTestResultData(result));
56
57 sendEvent(new SimpleAlgorithmEvent(this, RESULT_EVENT, result,
58 "result data"));
59 }
60
61 /***
62 * Test if the test is deletable().
63 * @return true if the test is deletable
64 */
65 public boolean isDeletable() {
66 return true;
67 }
68
69 /***
70 * Test if only one instance of the test could be created.
71 * @return true if only one instance of the test could be created
72 */
73 public boolean isUniqueInstance() {
74 return false;
75 }
76
77 /***
78 * Test if the test is modifiable.
79 * @return true if the test is modifiable
80 */
81 public boolean isModifiable() {
82 return true;
83 }
84
85 /***
86 * Test if the test could be showed.
87 * @return true if the test could be showed
88 */
89 public boolean isShowable() {
90 return true;
91 }
92
93 /***
94 * Test if the test could be diplayed in the list of tests to add.
95 * @return true if the test could be showed
96 */
97 public boolean isAddable() {
98 return true;
99 }
100
101
102
103
104
105 /***
106 * Test the quality of the bioassay.
107 * @param bioassay BioAssay to test
108 * @param parameters Parameters of the test
109 * @param arrayList The array list
110 * @return A QualityObjectResultTest Object
111 * @throws PlatformException if an error occurs while executing the test.
112 */
113 protected abstract QualityUnitTestResult test(final BioAssay bioassay,
114 final BioAssay arrayList, final Parameters parameters)
115 throws PlatformException;
116
117
118
119
120
121 /***
122 * Public constructor.
123 * @throws PlatformException If the name or the version of the element is
124 * <b>null </b>.
125 */
126 public QualityUnitTest() throws PlatformException {
127
128 }
129 }