3586 |
20 Jul 07 |
nicklas |
1 |
/* |
3586 |
20 Jul 07 |
nicklas |
$Id$ |
3586 |
20 Jul 07 |
nicklas |
3 |
|
3675 |
16 Aug 07 |
jari |
Copyright (C) 2007 Nicklas Nordborg |
3586 |
20 Jul 07 |
nicklas |
5 |
|
3586 |
20 Jul 07 |
nicklas |
This file is part of BASE - BioArray Software Environment. |
3586 |
20 Jul 07 |
nicklas |
Available at http://base.thep.lu.se/ |
3586 |
20 Jul 07 |
nicklas |
8 |
|
3586 |
20 Jul 07 |
nicklas |
BASE is free software; you can redistribute it and/or |
3586 |
20 Jul 07 |
nicklas |
modify it under the terms of the GNU General Public License |
4480 |
05 Sep 08 |
jari |
as published by the Free Software Foundation; either version 3 |
3586 |
20 Jul 07 |
nicklas |
of the License, or (at your option) any later version. |
3586 |
20 Jul 07 |
nicklas |
13 |
|
3586 |
20 Jul 07 |
nicklas |
BASE is distributed in the hope that it will be useful, |
3586 |
20 Jul 07 |
nicklas |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
3586 |
20 Jul 07 |
nicklas |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3586 |
20 Jul 07 |
nicklas |
GNU General Public License for more details. |
3586 |
20 Jul 07 |
nicklas |
18 |
|
3586 |
20 Jul 07 |
nicklas |
You should have received a copy of the GNU General Public License |
4514 |
11 Sep 08 |
jari |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
3586 |
20 Jul 07 |
nicklas |
21 |
*/ |
3586 |
20 Jul 07 |
nicklas |
22 |
|
6921 |
26 May 15 |
nicklas |
23 |
import net.sf.basedb.core.Annotation; |
3586 |
20 Jul 07 |
nicklas |
24 |
import net.sf.basedb.core.AnnotationType; |
3586 |
20 Jul 07 |
nicklas |
25 |
import net.sf.basedb.core.BaseException; |
3586 |
20 Jul 07 |
nicklas |
26 |
import net.sf.basedb.core.DbControl; |
3586 |
20 Jul 07 |
nicklas |
27 |
import net.sf.basedb.core.File; |
3586 |
20 Jul 07 |
nicklas |
28 |
import net.sf.basedb.core.Item; |
3586 |
20 Jul 07 |
nicklas |
29 |
import net.sf.basedb.core.Job; |
3586 |
20 Jul 07 |
nicklas |
30 |
import net.sf.basedb.core.ParameterType; |
3586 |
20 Jul 07 |
nicklas |
31 |
import net.sf.basedb.core.Permission; |
3586 |
20 Jul 07 |
nicklas |
32 |
import net.sf.basedb.core.PluginConfigurationRequest; |
3586 |
20 Jul 07 |
nicklas |
33 |
import net.sf.basedb.core.PluginDefinition; |
3586 |
20 Jul 07 |
nicklas |
34 |
import net.sf.basedb.core.PluginParameter; |
3586 |
20 Jul 07 |
nicklas |
35 |
import net.sf.basedb.core.PluginResponse; |
4822 |
19 Mar 09 |
nicklas |
36 |
import net.sf.basedb.core.Quantity; |
3586 |
20 Jul 07 |
nicklas |
37 |
import net.sf.basedb.core.RequestInformation; |
4822 |
19 Mar 09 |
nicklas |
38 |
import net.sf.basedb.core.SystemItems; |
3586 |
20 Jul 07 |
nicklas |
39 |
import net.sf.basedb.core.Type; |
3586 |
20 Jul 07 |
nicklas |
40 |
import net.sf.basedb.core.plugin.GuiContext; |
3586 |
20 Jul 07 |
nicklas |
41 |
import net.sf.basedb.core.plugin.Response; |
3586 |
20 Jul 07 |
nicklas |
42 |
|
3586 |
20 Jul 07 |
nicklas |
43 |
|
3586 |
20 Jul 07 |
nicklas |
44 |
public class TestAnnotationFlatFileImporter |
3586 |
20 Jul 07 |
nicklas |
45 |
{ |
3586 |
20 Jul 07 |
nicklas |
46 |
static boolean ok = true; |
3586 |
20 Jul 07 |
nicklas |
47 |
|
3586 |
20 Jul 07 |
nicklas |
48 |
public static void main(String[] args) |
3586 |
20 Jul 07 |
nicklas |
49 |
{ |
3586 |
20 Jul 07 |
nicklas |
50 |
TestUtil.checkArgs(args); |
3586 |
20 Jul 07 |
nicklas |
51 |
TestUtil.begin(); |
3586 |
20 Jul 07 |
nicklas |
52 |
test_all(); |
3586 |
20 Jul 07 |
nicklas |
53 |
TestUtil.stop(); |
3586 |
20 Jul 07 |
nicklas |
54 |
} |
3586 |
20 Jul 07 |
nicklas |
55 |
|
3586 |
20 Jul 07 |
nicklas |
56 |
static boolean test_all() |
3586 |
20 Jul 07 |
nicklas |
57 |
{ |
3586 |
20 Jul 07 |
nicklas |
58 |
write("++Testing annotation import using plugin"); |
3586 |
20 Jul 07 |
nicklas |
// Create annotation types, samples and upload file |
3586 |
20 Jul 07 |
nicklas |
60 |
|
4822 |
19 Mar 09 |
nicklas |
61 |
int timeQuantityId = SystemItems.getId(Quantity.TIME); |
4822 |
19 Mar 09 |
nicklas |
62 |
int hoursId = TestUnit.test_load_by_symbol(timeQuantityId, "h"); |
4822 |
19 Mar 09 |
nicklas |
63 |
|
4822 |
19 Mar 09 |
nicklas |
64 |
int timeId = TestAnnotationType.test_create("Time (hours)", Type.INT, hoursId, null, 25, Item.SAMPLE, 1, null, false); |
4544 |
25 Sep 08 |
nicklas |
65 |
int ageId = TestAnnotationType.test_create("Age (years)", Type.INT, 0, null, 100, Item.SAMPLE, 1, null, false); |
4544 |
25 Sep 08 |
nicklas |
66 |
int commentId = TestAnnotationType.test_create("Comment", Type.STRING, 0, null, 20, Item.SAMPLE, 0, null, false); |
4544 |
25 Sep 08 |
nicklas |
67 |
int enumId = TestAnnotationType.test_create("Subtype", Type.STRING, 0, null, null, |
4544 |
25 Sep 08 |
nicklas |
68 |
Item.SAMPLE, 1, new String[] { "alfa", "beta", "gamma" }, false); |
5430 |
28 Sep 10 |
nicklas |
69 |
int timestampId = TestAnnotationType.test_create("Timestamp", Type.TIMESTAMP, 0, null, null, Item.SAMPLE, 1, null, false); |
3586 |
20 Jul 07 |
nicklas |
70 |
|
6100 |
04 Sep 12 |
nicklas |
71 |
int sample1 = TestSample.test_create(0, "Sample #1", 0, false); |
6100 |
04 Sep 12 |
nicklas |
72 |
int sample2 = TestSample.test_create(0, "Sample #2", 0, false); |
6100 |
04 Sep 12 |
nicklas |
73 |
int sample3 = TestSample.test_create(0, "Sample #3", 0, false); |
6100 |
04 Sep 12 |
nicklas |
74 |
int sample4 = TestSample.test_create(0, "Sample #4", 0, false); |
6100 |
04 Sep 12 |
nicklas |
75 |
int sampleDup1 = TestSample.test_create(0, "Sample dup", 0, false); |
6100 |
04 Sep 12 |
nicklas |
76 |
int sampleDup2 = TestSample.test_create(0, "Sample dup", 0, false); |
3586 |
20 Jul 07 |
nicklas |
77 |
|
4544 |
25 Sep 08 |
nicklas |
78 |
TestAnnotation.test_annotatate(Item.SAMPLE, sample4, ageId, 0, 2); |
4544 |
25 Sep 08 |
nicklas |
79 |
TestAnnotation.test_annotatate(Item.SAMPLE, sample4, enumId, 0, "gamma"); |
4544 |
25 Sep 08 |
nicklas |
80 |
TestAnnotation.test_annotatate(Item.SAMPLE, sample4, commentId, 0, "A comment from code"); |
4304 |
21 May 08 |
nicklas |
81 |
|
3719 |
12 Sep 07 |
nicklas |
82 |
int fileId = TestFile.test_create("data/test.annotation.import.txt", false, false); |
7670 |
21 Mar 19 |
nicklas |
83 |
int excelFileId = TestFile.test_create("data/test.annotation.import.xlsx", false, false); |
3586 |
20 Jul 07 |
nicklas |
84 |
|
3586 |
20 Jul 07 |
nicklas |
// Create job |
3586 |
20 Jul 07 |
nicklas |
86 |
int pluginDefinitionId = TestPluginDefinition.test_get("net.sf.basedb.plugins.AnnotationFlatFileImporter"); |
5430 |
28 Sep 10 |
nicklas |
87 |
int jobId = test_create_job(pluginDefinitionId, fileId, timeId, ageId, enumId, timestampId, commentId, commentId); |
3586 |
20 Jul 07 |
nicklas |
88 |
|
3586 |
20 Jul 07 |
nicklas |
// Execute job |
5319 |
20 Apr 10 |
nicklas |
90 |
ok &= TestJob.test_execute(jobId, false); |
3586 |
20 Jul 07 |
nicklas |
91 |
|
7469 |
03 Apr 18 |
nicklas |
// One more time to check if update is possible (due to Hibernate bug described in #2110) |
7469 |
03 Apr 18 |
nicklas |
93 |
int jobId2 = test_create_job(pluginDefinitionId, fileId, timeId, ageId, enumId, timestampId, commentId, commentId); |
7469 |
03 Apr 18 |
nicklas |
94 |
ok &= TestJob.test_execute(jobId2, false); |
7469 |
03 Apr 18 |
nicklas |
95 |
|
3586 |
20 Jul 07 |
nicklas |
// Test: list the result |
6921 |
26 May 15 |
nicklas |
97 |
TestAnnotation.test_list_annotations(Item.SAMPLE, sample1, Annotation.Source.PRIMARY, 5); |
6921 |
26 May 15 |
nicklas |
98 |
TestAnnotation.test_list_annotations(Item.SAMPLE, sample2, Annotation.Source.PRIMARY, 3); |
6921 |
26 May 15 |
nicklas |
99 |
TestAnnotation.test_list_annotations(Item.SAMPLE, sample3, Annotation.Source.PRIMARY, 3); |
6921 |
26 May 15 |
nicklas |
100 |
TestAnnotation.test_list_annotations(Item.SAMPLE, sample4, Annotation.Source.PRIMARY, 3); |
6921 |
26 May 15 |
nicklas |
101 |
TestAnnotation.test_list_annotations(Item.SAMPLE, sampleDup1, Annotation.Source.PRIMARY, 5); |
6921 |
26 May 15 |
nicklas |
102 |
TestAnnotation.test_list_annotations(Item.SAMPLE, sampleDup2, Annotation.Source.PRIMARY, 5); |
5319 |
20 Apr 10 |
nicklas |
103 |
ok &= TestAnnotation.ok; |
3586 |
20 Jul 07 |
nicklas |
104 |
|
3586 |
20 Jul 07 |
nicklas |
105 |
if (TestUtil.waitBeforeDelete()) TestUtil.waitForEnter(); |
3586 |
20 Jul 07 |
nicklas |
106 |
|
7670 |
21 Mar 19 |
nicklas |
107 |
TestAnnotation.test_remove_all_annotations(Item.SAMPLE, sample1); |
7670 |
21 Mar 19 |
nicklas |
108 |
TestAnnotation.test_remove_all_annotations(Item.SAMPLE, sample2); |
7670 |
21 Mar 19 |
nicklas |
109 |
TestAnnotation.test_remove_all_annotations(Item.SAMPLE, sample3); |
7670 |
21 Mar 19 |
nicklas |
110 |
TestAnnotation.test_remove_all_annotations(Item.SAMPLE, sample4); |
7670 |
21 Mar 19 |
nicklas |
111 |
TestAnnotation.test_remove_all_annotations(Item.SAMPLE, sampleDup1); |
7670 |
21 Mar 19 |
nicklas |
112 |
TestAnnotation.test_remove_all_annotations(Item.SAMPLE, sampleDup2); |
7670 |
21 Mar 19 |
nicklas |
113 |
|
7670 |
21 Mar 19 |
nicklas |
// One more time to check import from Excel file |
7670 |
21 Mar 19 |
nicklas |
115 |
int jobId3 = test_create_job(pluginDefinitionId, excelFileId, timeId, ageId, enumId, timestampId, commentId, commentId); |
7670 |
21 Mar 19 |
nicklas |
116 |
ok &= TestJob.test_execute(jobId3, false); |
7670 |
21 Mar 19 |
nicklas |
117 |
|
7670 |
21 Mar 19 |
nicklas |
118 |
TestAnnotation.test_list_annotations(Item.SAMPLE, sample1, Annotation.Source.PRIMARY, 5); |
7670 |
21 Mar 19 |
nicklas |
119 |
TestAnnotation.test_list_annotations(Item.SAMPLE, sample2, Annotation.Source.PRIMARY, 4); |
7670 |
21 Mar 19 |
nicklas |
120 |
TestAnnotation.test_list_annotations(Item.SAMPLE, sample3, Annotation.Source.PRIMARY, 3); |
7670 |
21 Mar 19 |
nicklas |
121 |
TestAnnotation.test_list_annotations(Item.SAMPLE, sample4, Annotation.Source.PRIMARY, 3); |
7670 |
21 Mar 19 |
nicklas |
122 |
TestAnnotation.test_list_annotations(Item.SAMPLE, sampleDup1, Annotation.Source.PRIMARY, 5); |
7670 |
21 Mar 19 |
nicklas |
123 |
TestAnnotation.test_list_annotations(Item.SAMPLE, sampleDup2, Annotation.Source.PRIMARY, 5); |
7670 |
21 Mar 19 |
nicklas |
124 |
ok &= TestAnnotation.ok; |
7670 |
21 Mar 19 |
nicklas |
125 |
|
7670 |
21 Mar 19 |
nicklas |
126 |
if (TestUtil.waitBeforeDelete()) TestUtil.waitForEnter(); |
7670 |
21 Mar 19 |
nicklas |
127 |
|
3586 |
20 Jul 07 |
nicklas |
128 |
TestJob.test_delete(jobId); |
7469 |
03 Apr 18 |
nicklas |
129 |
TestJob.test_delete(jobId2); |
7670 |
21 Mar 19 |
nicklas |
130 |
TestJob.test_delete(jobId3); |
3586 |
20 Jul 07 |
nicklas |
131 |
TestFile.test_delete(fileId); |
7670 |
21 Mar 19 |
nicklas |
132 |
TestFile.test_delete(excelFileId); |
3586 |
20 Jul 07 |
nicklas |
133 |
TestSample.test_delete(sample1); |
3586 |
20 Jul 07 |
nicklas |
134 |
TestSample.test_delete(sample2); |
3586 |
20 Jul 07 |
nicklas |
135 |
TestSample.test_delete(sample3); |
4304 |
21 May 08 |
nicklas |
136 |
TestSample.test_delete(sample4); |
3586 |
20 Jul 07 |
nicklas |
137 |
TestSample.test_delete(sampleDup1); |
3586 |
20 Jul 07 |
nicklas |
138 |
TestSample.test_delete(sampleDup2); |
3586 |
20 Jul 07 |
nicklas |
139 |
TestAnnotationType.test_delete(commentId); |
3586 |
20 Jul 07 |
nicklas |
140 |
TestAnnotationType.test_delete(ageId); |
3586 |
20 Jul 07 |
nicklas |
141 |
TestAnnotationType.test_delete(timeId); |
3586 |
20 Jul 07 |
nicklas |
142 |
TestAnnotationType.test_delete(enumId); |
5430 |
28 Sep 10 |
nicklas |
143 |
TestAnnotationType.test_delete(timestampId); |
3586 |
20 Jul 07 |
nicklas |
144 |
|
3586 |
20 Jul 07 |
nicklas |
145 |
write("++Testing annotation import using plugin "+(ok ? "OK" : "Failed")+"\n"); |
3586 |
20 Jul 07 |
nicklas |
146 |
return ok; |
3586 |
20 Jul 07 |
nicklas |
147 |
} |
3586 |
20 Jul 07 |
nicklas |
148 |
|
3586 |
20 Jul 07 |
nicklas |
149 |
static int test_create_job(int pluginDefinitionId, int fileId, int... annotationTypes) |
3586 |
20 Jul 07 |
nicklas |
150 |
{ |
3586 |
20 Jul 07 |
nicklas |
151 |
if (pluginDefinitionId == 0 || fileId == 0 || !TestUtil.hasPermission(Permission.CREATE, Item.JOB)) return 0; |
3586 |
20 Jul 07 |
nicklas |
152 |
int id = 0; |
3586 |
20 Jul 07 |
nicklas |
153 |
DbControl dc = null; |
3586 |
20 Jul 07 |
nicklas |
154 |
try |
3586 |
20 Jul 07 |
nicklas |
155 |
{ |
3586 |
20 Jul 07 |
nicklas |
156 |
dc = TestUtil.getDbControl(); |
3586 |
20 Jul 07 |
nicklas |
157 |
|
3586 |
20 Jul 07 |
nicklas |
158 |
PluginDefinition plugin = PluginDefinition.getById(dc, pluginDefinitionId); |
4254 |
28 Apr 08 |
nicklas |
159 |
Job j = Job.getNew(dc, plugin, null, null); |
3586 |
20 Jul 07 |
nicklas |
160 |
j.setName("Import annotations"); |
3586 |
20 Jul 07 |
nicklas |
161 |
|
3586 |
20 Jul 07 |
nicklas |
// Step 1 - file and parser regular expressions |
3586 |
20 Jul 07 |
nicklas |
163 |
PluginConfigurationRequest request = j.configure(new GuiContext(Item.SAMPLE, GuiContext.Type.LIST)); |
3586 |
20 Jul 07 |
nicklas |
164 |
request.getRequestInformation(); |
3586 |
20 Jul 07 |
nicklas |
165 |
request.setParameterValue("file", File.getById(dc, fileId)); |
3586 |
20 Jul 07 |
nicklas |
166 |
request.setParameterValue("dataSplitterRegexp", "\\t"); |
3586 |
20 Jul 07 |
nicklas |
167 |
request.setParameterValue("dataHeaderRegexp", "Name.*"); |
3586 |
20 Jul 07 |
nicklas |
168 |
request.setParameterValue("nameColumnMapping", "\\Name\\"); |
3586 |
20 Jul 07 |
nicklas |
169 |
request.setParameterValue("ignoreRegexp", "#.*"); |
5430 |
28 Sep 10 |
nicklas |
170 |
request.setParameterValue("timestampFormat", "yyyy-MM-dd HH:mm"); |
7592 |
20 Feb 19 |
nicklas |
171 |
request.setParameterValue("idMethod", "name"); |
7592 |
20 Feb 19 |
nicklas |
172 |
request.setParameterValue("includeMine", true); |
3586 |
20 Jul 07 |
nicklas |
173 |
PluginResponse response = request.invoke(); |
3586 |
20 Jul 07 |
nicklas |
174 |
if (response.getStatus() != Response.Status.CONTINUE) |
3586 |
20 Jul 07 |
nicklas |
175 |
{ |
3586 |
20 Jul 07 |
nicklas |
176 |
throw new BaseException(response.getMessage()); |
3586 |
20 Jul 07 |
nicklas |
177 |
} |
3586 |
20 Jul 07 |
nicklas |
178 |
|
3586 |
20 Jul 07 |
nicklas |
// Step 2 - mapping to annotation types |
3586 |
20 Jul 07 |
nicklas |
180 |
request = response.getNextRequest(); |
3586 |
20 Jul 07 |
nicklas |
181 |
request.getRequestInformation(); |
3586 |
20 Jul 07 |
nicklas |
182 |
for (int i = 0; i < annotationTypes.length; ++i) |
3586 |
20 Jul 07 |
nicklas |
183 |
{ |
3586 |
20 Jul 07 |
nicklas |
184 |
request.setParameterValue("columnMapping." + (i+1), AnnotationType.getById(dc, annotationTypes[i])); |
3586 |
20 Jul 07 |
nicklas |
185 |
} |
3586 |
20 Jul 07 |
nicklas |
186 |
response = request.invoke(); |
3586 |
20 Jul 07 |
nicklas |
187 |
|
3586 |
20 Jul 07 |
nicklas |
188 |
if (response.getStatus() != Response.Status.CONTINUE) |
3586 |
20 Jul 07 |
nicklas |
189 |
{ |
3586 |
20 Jul 07 |
nicklas |
190 |
throw new BaseException(response.getMessage()); |
3586 |
20 Jul 07 |
nicklas |
191 |
} |
3586 |
20 Jul 07 |
nicklas |
192 |
|
3586 |
20 Jul 07 |
nicklas |
// Step 3 - other options and error handling |
3586 |
20 Jul 07 |
nicklas |
194 |
request = response.getNextRequest(); |
3586 |
20 Jul 07 |
nicklas |
195 |
request.getRequestInformation(); |
4304 |
21 May 08 |
nicklas |
196 |
request.setParameterValue("replaceExisting", true); |
4304 |
21 May 08 |
nicklas |
197 |
request.setParameterValue("removeExisting", true); |
4304 |
21 May 08 |
nicklas |
198 |
request.setParameterValue("addToUnlimited", true); |
3586 |
20 Jul 07 |
nicklas |
199 |
request.setParameterValue("defaultError", "fail"); |
4304 |
21 May 08 |
nicklas |
200 |
request.setParameterValue("itemNotFoundError", "skip"); |
3586 |
20 Jul 07 |
nicklas |
201 |
request.setParameterValue("stringTooLongError", "crop"); |
3586 |
20 Jul 07 |
nicklas |
202 |
request.setParameterValue("numberFormatError", "skip"); |
5430 |
28 Sep 10 |
nicklas |
203 |
request.setParameterValue("dateFormatError", "skip"); |
3586 |
20 Jul 07 |
nicklas |
204 |
request.setParameterValue("numberOutOfRangeError", "skip"); |
3586 |
20 Jul 07 |
nicklas |
205 |
request.setParameterValue("invalidEnumError", "skip"); |
5319 |
20 Apr 10 |
nicklas |
206 |
request.setParameterValue("tooManyValuesError", "crop"); |
3586 |
20 Jul 07 |
nicklas |
207 |
request.setParameterValue("multipleItemsFoundError", "all"); |
3586 |
20 Jul 07 |
nicklas |
208 |
response = request.invoke(); |
3586 |
20 Jul 07 |
nicklas |
209 |
|
3586 |
20 Jul 07 |
nicklas |
210 |
if (response.getStatus() == Response.Status.DONE) |
3586 |
20 Jul 07 |
nicklas |
211 |
{ |
3586 |
20 Jul 07 |
nicklas |
212 |
response.saveParameters(dc); |
3586 |
20 Jul 07 |
nicklas |
213 |
dc.saveItem(j); |
3586 |
20 Jul 07 |
nicklas |
214 |
dc.commit(); |
3586 |
20 Jul 07 |
nicklas |
215 |
} |
3586 |
20 Jul 07 |
nicklas |
216 |
else |
3586 |
20 Jul 07 |
nicklas |
217 |
{ |
3586 |
20 Jul 07 |
nicklas |
218 |
throw new BaseException(response.getMessage()); |
3586 |
20 Jul 07 |
nicklas |
219 |
} |
3586 |
20 Jul 07 |
nicklas |
220 |
id = j.getId(); |
3586 |
20 Jul 07 |
nicklas |
221 |
write("--Create job for annotation import OK"); |
3586 |
20 Jul 07 |
nicklas |
222 |
} |
3586 |
20 Jul 07 |
nicklas |
223 |
catch (Throwable ex) |
3586 |
20 Jul 07 |
nicklas |
224 |
{ |
3586 |
20 Jul 07 |
nicklas |
225 |
write("--Create job for annotation import FAILED"); |
3586 |
20 Jul 07 |
nicklas |
226 |
ex.printStackTrace(); |
3586 |
20 Jul 07 |
nicklas |
227 |
ok = false; |
3586 |
20 Jul 07 |
nicklas |
228 |
} |
3586 |
20 Jul 07 |
nicklas |
229 |
finally |
3586 |
20 Jul 07 |
nicklas |
230 |
{ |
3586 |
20 Jul 07 |
nicklas |
231 |
if (dc != null) dc.close(); |
3586 |
20 Jul 07 |
nicklas |
232 |
} |
3586 |
20 Jul 07 |
nicklas |
233 |
return id; |
3586 |
20 Jul 07 |
nicklas |
234 |
} |
3586 |
20 Jul 07 |
nicklas |
235 |
|
3586 |
20 Jul 07 |
nicklas |
236 |
static void write(String message) |
3586 |
20 Jul 07 |
nicklas |
237 |
{ |
3586 |
20 Jul 07 |
nicklas |
238 |
System.out.println(message); |
3586 |
20 Jul 07 |
nicklas |
239 |
} |
3586 |
20 Jul 07 |
nicklas |
240 |
|
3586 |
20 Jul 07 |
nicklas |
241 |
|
3586 |
20 Jul 07 |
nicklas |
242 |
static void write_request_information(RequestInformation ri) |
3586 |
20 Jul 07 |
nicklas |
243 |
{ |
3586 |
20 Jul 07 |
nicklas |
244 |
if (TestUtil.getSilent()) return; |
3586 |
20 Jul 07 |
nicklas |
245 |
|
3586 |
20 Jul 07 |
nicklas |
246 |
write("Request information for command: "+ri.getCommand()); |
3586 |
20 Jul 07 |
nicklas |
247 |
write("\tTitle:\t"+ri.getTitle()); |
3586 |
20 Jul 07 |
nicklas |
248 |
write("\tDescription:\t"+ri.getDescription()); |
3586 |
20 Jul 07 |
nicklas |
249 |
for (PluginParameter<?> pp : ri.getParameters()) |
3586 |
20 Jul 07 |
nicklas |
250 |
{ |
6875 |
20 Apr 15 |
nicklas |
251 |
ParameterType<?> pt = pp.getParameterType(); |
3586 |
20 Jul 07 |
nicklas |
252 |
System.out.println("\tParameter:\t"+pp.getName() + "\t" + pp.getLabel() + "\t" + pt ); |
3586 |
20 Jul 07 |
nicklas |
253 |
} |
3586 |
20 Jul 07 |
nicklas |
254 |
} |
3586 |
20 Jul 07 |
nicklas |
255 |
} |
3586 |
20 Jul 07 |
nicklas |
256 |
|