1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.bin; |
22 |
|
|
23 |
|
import static org.testng.Assert.assertNotNull; |
24 |
|
import static org.testng.Assert.assertTrue; |
25 |
|
|
26 |
|
import java.io.BufferedReader; |
27 |
|
import java.io.File; |
28 |
|
import java.io.IOException; |
29 |
|
import java.io.InputStreamReader; |
30 |
|
import java.nio.file.Files; |
31 |
|
import java.nio.file.Path; |
32 |
|
import java.nio.file.Paths; |
33 |
|
import java.util.ArrayList; |
34 |
|
import java.util.List; |
35 |
|
|
36 |
|
import org.testng.Assert; |
37 |
|
import org.testng.FileAssert; |
38 |
|
import org.testng.annotations.BeforeClass; |
39 |
|
import org.testng.annotations.DataProvider; |
40 |
|
import org.testng.annotations.Test; |
41 |
|
|
42 |
|
import io.github.classgraph.ClassGraph; |
43 |
|
import io.github.classgraph.ModuleRef; |
44 |
|
import io.github.classgraph.ScanResult; |
45 |
|
import jalview.gui.JvOptionPane; |
46 |
|
|
|
|
| 81.5% |
Uncovered Elements: 28 (151) |
Complexity: 41 |
Complexity Density: 0.38 |
|
47 |
|
public class CommandLineOperationsNG |
48 |
|
{ |
49 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
50 |
1 |
@BeforeClass(alwaysRun = true)... |
51 |
|
public void setUpJvOptionPane() |
52 |
|
{ |
53 |
1 |
JvOptionPane.setInteractiveMode(false); |
54 |
1 |
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); |
55 |
|
} |
56 |
|
|
57 |
|
|
58 |
|
private static final int TEST_TIMEOUT = 13000; |
59 |
|
|
60 |
|
private static final int SETUP_TIMEOUT = 9500; |
61 |
|
|
62 |
|
private static final int MINFILESIZE_SMALL = 2096; |
63 |
|
|
64 |
|
private static final int MINFILESIZE_BIG = 4096; |
65 |
|
|
66 |
|
private List<String> successfulCMDs = new ArrayList<>(); |
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
@author |
74 |
|
|
75 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (14) |
Complexity: 7 |
Complexity Density: 0.88 |
|
76 |
|
private static class Worker extends Thread |
77 |
|
{ |
78 |
|
private final Process process; |
79 |
|
|
80 |
|
private BufferedReader outputReader; |
81 |
|
|
82 |
|
private BufferedReader errorReader; |
83 |
|
|
84 |
|
private Integer exit; |
85 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
86 |
26 |
private Worker(Process process)... |
87 |
|
{ |
88 |
26 |
this.process = process; |
89 |
|
} |
90 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 2 |
Complexity Density: 0.67 |
|
91 |
26 |
@Override... |
92 |
|
public void run() |
93 |
|
{ |
94 |
26 |
try |
95 |
|
{ |
96 |
26 |
exit = process.waitFor(); |
97 |
|
} catch (InterruptedException ignore) |
98 |
|
{ |
99 |
1 |
return; |
100 |
|
} |
101 |
|
} |
102 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
103 |
18944 |
public BufferedReader getOutputReader()... |
104 |
|
{ |
105 |
18944 |
return outputReader; |
106 |
|
} |
107 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
108 |
26 |
public void setOutputReader(BufferedReader outputReader)... |
109 |
|
{ |
110 |
26 |
this.outputReader = outputReader; |
111 |
|
} |
112 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
113 |
7 |
public BufferedReader getErrorReader()... |
114 |
|
{ |
115 |
7 |
return errorReader; |
116 |
|
} |
117 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
118 |
26 |
public void setErrorReader(BufferedReader errorReader)... |
119 |
|
{ |
120 |
26 |
this.errorReader = errorReader; |
121 |
|
} |
122 |
|
} |
123 |
|
|
124 |
|
private static ClassGraph scanner = null; |
125 |
|
|
126 |
|
private static String classpath = null; |
127 |
|
|
128 |
|
private static String modules = null; |
129 |
|
|
130 |
|
private static String java_exe = null; |
131 |
|
|
|
|
| 75% |
Uncovered Elements: 4 (16) |
Complexity: 4 |
Complexity Density: 0.33 |
|
132 |
26 |
public synchronized static String getClassPath()... |
133 |
|
{ |
134 |
26 |
if (scanner == null) |
135 |
|
{ |
136 |
1 |
scanner = new ClassGraph(); |
137 |
1 |
ScanResult scan = scanner.scan(); |
138 |
1 |
classpath = scan.getClasspath(); |
139 |
1 |
modules = ""; |
140 |
1 |
for (ModuleRef mr : scan.getModules()) |
141 |
|
{ |
142 |
0 |
modules.concat(mr.getName()); |
143 |
|
} |
144 |
1 |
java_exe = System.getProperty("java.home") + File.separator + "bin" |
145 |
|
+ File.separator + "java"; |
146 |
|
|
147 |
|
} |
148 |
|
|
149 |
26 |
while (classpath == null) |
150 |
|
{ |
151 |
0 |
try |
152 |
|
{ |
153 |
0 |
Thread.sleep(10); |
154 |
|
} catch (InterruptedException x) |
155 |
|
{ |
156 |
|
|
157 |
|
} |
158 |
|
} |
159 |
26 |
return classpath; |
160 |
|
} |
161 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
162 |
18 |
private Worker getJalviewDesktopRunner(boolean withAwt, String cmd,... |
163 |
|
int timeout) |
164 |
|
{ |
165 |
18 |
return getJalviewDesktopRunner(withAwt, cmd, timeout, true); |
166 |
|
} |
167 |
|
|
|
|
| 89.3% |
Uncovered Elements: 3 (28) |
Complexity: 8 |
Complexity Density: 0.4 |
|
168 |
26 |
private Worker getJalviewDesktopRunner(boolean withAwt, String cmd,... |
169 |
|
int timeout, boolean testoutput) |
170 |
|
{ |
171 |
|
|
172 |
|
|
173 |
|
|
174 |
|
|
175 |
|
|
176 |
|
|
177 |
|
|
178 |
|
|
179 |
|
|
180 |
|
|
181 |
|
|
182 |
|
|
183 |
|
|
184 |
|
|
185 |
|
|
186 |
|
|
187 |
|
|
188 |
|
|
189 |
|
|
190 |
|
|
191 |
26 |
String classpath = getClassPath(); |
192 |
26 |
String _cmd = java_exe + " " |
193 |
26 |
+ (withAwt ? "-Djava.awt.headless=true" : "") + " -classpath " |
194 |
|
+ classpath |
195 |
26 |
+ ((modules != null && modules.length() > 2) |
196 |
|
? "--add-modules=\"" + modules + "\"" |
197 |
|
: "") |
198 |
|
+ " jalview.bin.Jalview "; |
199 |
26 |
Process ls2_proc = null; |
200 |
26 |
Worker worker = null; |
201 |
26 |
try |
202 |
|
{ |
203 |
26 |
cmd = cmd + (testoutput ? " --testoutput " : ""); |
204 |
26 |
System.out.println("Running '" + _cmd + cmd + "'"); |
205 |
26 |
ls2_proc = Runtime.getRuntime().exec(_cmd + cmd); |
206 |
|
} catch (Throwable e1) |
207 |
|
{ |
208 |
0 |
e1.printStackTrace(); |
209 |
|
} |
210 |
26 |
if (ls2_proc != null) |
211 |
|
{ |
212 |
26 |
BufferedReader outputReader = new BufferedReader( |
213 |
|
new InputStreamReader(ls2_proc.getInputStream())); |
214 |
26 |
BufferedReader errorReader = new BufferedReader( |
215 |
|
new InputStreamReader(ls2_proc.getErrorStream())); |
216 |
26 |
worker = new Worker(ls2_proc); |
217 |
26 |
worker.start(); |
218 |
26 |
try |
219 |
|
{ |
220 |
26 |
worker.join(timeout); |
221 |
|
} catch (InterruptedException e) |
222 |
|
{ |
223 |
1 |
System.err.println("Thread interrupted"); |
224 |
|
} |
225 |
26 |
worker.setOutputReader(outputReader); |
226 |
26 |
worker.setErrorReader(errorReader); |
227 |
|
} |
228 |
26 |
return worker; |
229 |
|
} |
230 |
|
|
|
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
231 |
1 |
@Test(groups = { "Functional", "testTask1" })... |
232 |
|
public void reportCurrentWorkingDirectory() |
233 |
|
{ |
234 |
1 |
try |
235 |
|
{ |
236 |
1 |
Path currentRelativePath = Paths.get(""); |
237 |
1 |
String s = currentRelativePath.toAbsolutePath().toString(); |
238 |
1 |
System.out.println("Test CWD is " + s); |
239 |
|
} catch (Exception q) |
240 |
|
{ |
241 |
0 |
q.printStackTrace(); |
242 |
|
} |
243 |
|
} |
244 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
245 |
1 |
@BeforeClass(alwaysRun = true)... |
246 |
|
public void initialize() |
247 |
|
{ |
248 |
1 |
new CommandLineOperationsNG(); |
249 |
|
} |
250 |
|
|
|
|
| 66.7% |
Uncovered Elements: 4 (12) |
Complexity: 3 |
Complexity Density: 0.38 |
|
251 |
1 |
@BeforeClass(alwaysRun = true)... |
252 |
|
public void setUpForHeadlessCommandLineInputOperations() |
253 |
|
throws IOException |
254 |
|
{ |
255 |
1 |
String cmds = "--headless " + "--open examples/uniref50.fa " |
256 |
|
+ "--sortbytree " |
257 |
|
+ "--props test/jalview/bin/testProps.jvprops " |
258 |
|
+ "--colour zappo " |
259 |
|
+ "--jabaws http://www.compbio.dundee.ac.uk/jabaws " |
260 |
|
+ "--features examples/testdata/plantfdx.features " |
261 |
|
+ "--annotations examples/testdata/plantfdx.annotations " |
262 |
|
+ "--tree examples/testdata/uniref50_test_tree " |
263 |
|
+ "--nousagestats "; |
264 |
1 |
Worker worker = getJalviewDesktopRunner(true, cmds, SETUP_TIMEOUT); |
265 |
1 |
String ln = null; |
266 |
? |
while ((ln = worker.getOutputReader().readLine()) != null) |
267 |
|
{ |
268 |
23 |
System.out.println(ln); |
269 |
23 |
successfulCMDs.add(ln); |
270 |
|
} |
271 |
? |
while ((ln = worker.getErrorReader().readLine()) != null) |
272 |
|
{ |
273 |
6 |
System.err.println(ln); |
274 |
|
} |
275 |
|
} |
276 |
|
|
|
|
| 94.4% |
Uncovered Elements: 1 (18) |
Complexity: 6 |
Complexity Density: 0.43 |
|
277 |
1 |
@BeforeClass(alwaysRun = true)... |
278 |
|
public void setUpForCommandLineInputOperations() throws IOException |
279 |
|
{ |
280 |
1 |
String cmds = "--open examples/uniref50.fa --noquestionnaire --nousagestats"; |
281 |
1 |
final Worker worker = getJalviewDesktopRunner(false, cmds, |
282 |
|
SETUP_TIMEOUT); |
283 |
|
|
284 |
|
|
285 |
|
|
286 |
1 |
final int STDERR_SETUPLINES = 50; |
287 |
|
|
288 |
|
|
289 |
|
|
290 |
1 |
Thread runner = new Thread(new Runnable() |
291 |
|
{ |
|
|
| 57.1% |
Uncovered Elements: 6 (14) |
Complexity: 4 |
Complexity Density: 0.4 |
|
292 |
1 |
@Override... |
293 |
|
public void run() |
294 |
|
{ |
295 |
1 |
String ln = null; |
296 |
1 |
int count = 0; |
297 |
1 |
try |
298 |
|
{ |
299 |
? |
while ((ln = worker.getOutputReader().readLine()) != null) |
300 |
|
{ |
301 |
33 |
System.out.println(ln); |
302 |
33 |
successfulCMDs.add(ln); |
303 |
33 |
if (++count > STDERR_SETUPLINES) |
304 |
|
{ |
305 |
0 |
break; |
306 |
|
} |
307 |
|
} |
308 |
|
} catch (Exception e) |
309 |
|
{ |
310 |
0 |
System.err.println( |
311 |
|
"Unexpected Exception reading stderr from the Jalview process"); |
312 |
0 |
e.printStackTrace(); |
313 |
|
} |
314 |
|
} |
315 |
|
}); |
316 |
1 |
long t = System.currentTimeMillis() + SETUP_TIMEOUT; |
317 |
1 |
runner.start(); |
318 |
20 |
while (!runner.isInterrupted() && System.currentTimeMillis() < t) |
319 |
|
{ |
320 |
19 |
try |
321 |
|
{ |
322 |
19 |
Thread.sleep(500); |
323 |
|
} catch (InterruptedException e) |
324 |
|
{ |
325 |
|
} |
326 |
|
} |
327 |
1 |
runner.interrupt(); |
328 |
1 |
if (worker != null && worker.exit == null) |
329 |
|
{ |
330 |
1 |
worker.interrupt(); |
331 |
1 |
Thread.currentThread().interrupt(); |
332 |
1 |
worker.process.destroy(); |
333 |
|
} |
334 |
|
} |
335 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
336 |
10 |
@Test(... |
337 |
|
groups = |
338 |
|
{ "Functional", "testTask1" }, |
339 |
|
dataProvider = "allInputOperationsData") |
340 |
|
public void testAllInputOperations(String expectedString, |
341 |
|
String failureMsg) |
342 |
|
{ |
343 |
10 |
Assert.assertTrue(successfulCMDs.contains(expectedString), |
344 |
|
failureMsg + "; was expecting '" + expectedString + "'"); |
345 |
|
} |
346 |
|
|
|
|
| 70.6% |
Uncovered Elements: 5 (17) |
Complexity: 3 |
Complexity Density: 0.2 |
|
347 |
16 |
@Test(... |
348 |
|
groups = |
349 |
|
{ "Functional", "testTask1" }, |
350 |
|
dataProvider = "headlessModeOutputOperationsData") |
351 |
|
public void testHeadlessModeOutputOperations(String harg, String type, |
352 |
|
String fileName, boolean withAWT, int expectedMinFileSize, |
353 |
|
int timeout) |
354 |
|
{ |
355 |
16 |
String cmd = harg + type + " " + fileName; |
356 |
|
|
357 |
16 |
File file = new File(fileName); |
358 |
16 |
file.deleteOnExit(); |
359 |
16 |
Worker worker = getJalviewDesktopRunner(withAWT, cmd, timeout); |
360 |
16 |
assertNotNull(worker, "worker is null"); |
361 |
16 |
String msg = "Didn't create an output" + type + " file '" + fileName |
362 |
|
+ "'. [" + cmd + "]"; |
363 |
16 |
assertTrue(file.exists(), msg); |
364 |
16 |
FileAssert.assertFile(file, msg); |
365 |
16 |
FileAssert.assertMinLength(file, expectedMinFileSize); |
366 |
16 |
if (worker != null && worker.exit == null) |
367 |
|
{ |
368 |
0 |
worker.interrupt(); |
369 |
0 |
Thread.currentThread().interrupt(); |
370 |
0 |
worker.process.destroy(); |
371 |
0 |
Assert.fail("Jalview did not exit after " + type |
372 |
|
+ " generation (try running test again to verify - timeout at " |
373 |
|
+ timeout + "ms). [" + harg + "]"); |
374 |
|
} |
375 |
16 |
file.delete(); |
376 |
|
} |
377 |
|
|
|
|
| 75% |
Uncovered Elements: 4 (16) |
Complexity: 4 |
Complexity Density: 0.29 |
|
378 |
8 |
@Test(... |
379 |
|
groups = |
380 |
|
{ "Functional", "testTask1" }, |
381 |
|
dataProvider = "headlessModeOutputToStdout") |
382 |
|
public void testHeadlessModeOutputToStdout(String args, |
383 |
|
String comparisonFile, int timeout) |
384 |
|
{ |
385 |
8 |
String cmd = args; |
386 |
8 |
File file = new File(comparisonFile); |
387 |
8 |
Worker worker = getJalviewDesktopRunner(true, cmd, timeout, false); |
388 |
8 |
int b = -1; |
389 |
8 |
StringBuilder sb = new StringBuilder(); |
390 |
8 |
try |
391 |
|
{ |
392 |
? |
while ((b = worker.getOutputReader().read()) != -1) |
393 |
|
{ |
394 |
18878 |
sb.append(Character.toChars(b)); |
395 |
|
} |
396 |
|
} catch (IOException e) |
397 |
|
{ |
398 |
0 |
Assert.fail("IOException whilst trying to read from jalview process"); |
399 |
|
} |
400 |
|
|
401 |
8 |
String comparisonContent = null; |
402 |
8 |
try |
403 |
|
{ |
404 |
8 |
comparisonContent = new String(Files.readAllBytes(file.toPath())); |
405 |
|
} catch (IOException e) |
406 |
|
{ |
407 |
0 |
Assert.fail("IOException whilst trying to read comparison file"); |
408 |
|
} |
409 |
|
|
410 |
8 |
Assert.assertEquals(sb.toString(), comparisonContent, |
411 |
|
"STDOUT from jalview command did not match the comparison file"); |
412 |
|
} |
413 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
414 |
1 |
@DataProvider(name = "allInputOperationsData")... |
415 |
|
public Object[][] getHeadlessModeInputParams() |
416 |
|
{ |
417 |
1 |
return new Object[][] { |
418 |
|
|
419 |
|
{ "[TESTOUTPUT] arg --colour='zappo' was set", |
420 |
|
"Failed setting arg --colour" }, |
421 |
|
{ "[TESTOUTPUT] arg --props='test/jalview/bin/testProps.jvprops' was set", |
422 |
|
"Failed setting arg --props" }, |
423 |
|
{ "[TESTOUTPUT] arg --sortbytree was set", |
424 |
|
"Failed setting arg --sortbytree" }, |
425 |
|
{ "[TESTOUTPUT] arg --jabaws='http://www.compbio.dundee.ac.uk/jabaws' was set", |
426 |
|
"Failed setting arg --jabaws" }, |
427 |
|
{ "[TESTOUTPUT] arg --open='examples/uniref50.fa' was set", |
428 |
|
"Failed setting arg --open" }, |
429 |
|
{ "[TESTOUTPUT] arg --features='examples/testdata/plantfdx.features' was set", |
430 |
|
"Failed setting arg --features" }, |
431 |
|
{ "[TESTOUTPUT] arg --annotations='examples/testdata/plantfdx.annotations' was set", |
432 |
|
"Failed setting arg --annotations" }, |
433 |
|
{ "[TESTOUTPUT] arg --tree='examples/testdata/uniref50_test_tree' was set", |
434 |
|
"Failed setting arg --tree" }, |
435 |
|
|
436 |
|
{ "[TESTOUTPUT] arg --nousagestats was set", |
437 |
|
"Failed setting arg --nousagestats" }, |
438 |
|
{ "[TESTOUTPUT] arg --noquestionnaire was set", |
439 |
|
"Failed setting arg --noquestionnaire" } |
440 |
|
|
441 |
|
}; |
442 |
|
} |
443 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
444 |
1 |
@DataProvider(name = "headlessModeOutputOperationsData")... |
445 |
|
public static Object[][] getHeadlessModeOutputParams() |
446 |
|
{ |
447 |
|
|
448 |
|
|
449 |
|
|
450 |
|
|
451 |
1 |
String workingDir = "test/jalview/bin/"; |
452 |
1 |
return new Object[][] { |
453 |
|
|
454 |
|
{ "--headless --open examples/uniref50.fa", " --image", |
455 |
|
workingDir + "test_uniref50_out.eps", true, MINFILESIZE_BIG, |
456 |
|
TEST_TIMEOUT }, |
457 |
|
{ "--headless --open examples/uniref50.fa", " --image", |
458 |
|
workingDir + "test_uniref50_out.eps", false, MINFILESIZE_BIG, |
459 |
|
TEST_TIMEOUT }, |
460 |
|
{ "--headless --open examples/uniref50.fa", " --image", |
461 |
|
workingDir + "test_uniref50_out.eps", true, MINFILESIZE_BIG, |
462 |
|
TEST_TIMEOUT }, |
463 |
|
{ "--headless --open examples/uniref50.fa", " --image", |
464 |
|
workingDir + "test_uniref50_out.eps", false, MINFILESIZE_BIG, |
465 |
|
TEST_TIMEOUT }, |
466 |
|
{ "--headless --open examples/uniref50.fa", " --image", |
467 |
|
workingDir + "test_uniref50_out.eps", true, MINFILESIZE_BIG, |
468 |
|
TEST_TIMEOUT }, |
469 |
|
{ "--headless --open examples/uniref50.fa", " --image", |
470 |
|
workingDir + "test_uniref50_out.svg", false, MINFILESIZE_BIG, |
471 |
|
TEST_TIMEOUT }, |
472 |
|
{ "--headless --open examples/uniref50.fa", " --image", |
473 |
|
workingDir + "test_uniref50_out.png", true, MINFILESIZE_BIG, |
474 |
|
TEST_TIMEOUT }, |
475 |
|
{ "--headless --open examples/uniref50.fa", " --image", |
476 |
|
workingDir + "test_uniref50_out.html", true, MINFILESIZE_BIG, |
477 |
|
TEST_TIMEOUT }, |
478 |
|
{ "--headless --open examples/uniref50.fa", " --output", |
479 |
|
workingDir + "test_uniref50_out.mfa", true, MINFILESIZE_SMALL, |
480 |
|
TEST_TIMEOUT }, |
481 |
|
{ "--headless --open examples/uniref50.fa", " --output", |
482 |
|
workingDir + "test_uniref50_out.aln", true, MINFILESIZE_SMALL, |
483 |
|
TEST_TIMEOUT }, |
484 |
|
{ "--headless --open examples/uniref50.fa", " --output", |
485 |
|
workingDir + "test_uniref50_out.msf", true, MINFILESIZE_SMALL, |
486 |
|
TEST_TIMEOUT }, |
487 |
|
{ "--headless --open examples/uniref50.fa", " --output", |
488 |
|
workingDir + "test_uniref50_out.aln", true, MINFILESIZE_SMALL, |
489 |
|
TEST_TIMEOUT }, |
490 |
|
{ "--headless --open examples/uniref50.fa", " --output", |
491 |
|
workingDir + "test_uniref50_out.pir", true, MINFILESIZE_SMALL, |
492 |
|
TEST_TIMEOUT }, |
493 |
|
{ "--headless --open examples/uniref50.fa", " --output", |
494 |
|
workingDir + "test_uniref50_out.pfam", true, MINFILESIZE_SMALL, |
495 |
|
TEST_TIMEOUT }, |
496 |
|
{ "--headless --open examples/uniref50.fa", " --output", |
497 |
|
workingDir + "test_uniref50_out.blc", true, MINFILESIZE_SMALL, |
498 |
|
TEST_TIMEOUT }, |
499 |
|
{ "--headless --open examples/uniref50.fa", " --output", |
500 |
|
workingDir + "test_uniref50_out.jvp", true, MINFILESIZE_SMALL, |
501 |
|
TEST_TIMEOUT }, |
502 |
|
|
503 |
|
}; |
504 |
|
} |
505 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
506 |
1 |
@DataProvider(name = "headlessModeOutputToStdout")... |
507 |
|
public static Object[][] getHeadlessModeOutputToStdout() |
508 |
|
{ |
509 |
|
|
510 |
|
|
511 |
|
|
512 |
|
|
513 |
1 |
String workingDir = "test/jalview/bin"; |
514 |
1 |
return new Object[][] { |
515 |
|
|
516 |
|
{ "--open=examples/uniref50.fa --output=-", |
517 |
|
workingDir + "/uniref50-output.fa", TEST_TIMEOUT }, |
518 |
|
{ "--open examples/uniref50.fa --output -", |
519 |
|
workingDir + "/uniref50-output.fa", TEST_TIMEOUT }, |
520 |
|
{ "--open examples/uniref50.fa --output=[format=blc]-", |
521 |
|
workingDir + "/uniref50-output.blc", TEST_TIMEOUT }, |
522 |
|
{ "--open examples/uniref50.fa --output - --format blc", |
523 |
|
workingDir + "/uniref50-output.blc", TEST_TIMEOUT }, |
524 |
|
{ "./examples/uniref50.fa --output=-", |
525 |
|
workingDir + "/uniref50-output.fa", TEST_TIMEOUT }, |
526 |
|
{ "./examples/uniref50.fa --output - --format blc", |
527 |
|
workingDir + "/uniref50-output.blc", TEST_TIMEOUT }, |
528 |
|
|
529 |
|
{ "./test/jalview/bin/argparser/testfiles/test1.fa ./test/jalview/bin/argparser/testfiles/test2.fa ./test/jalview/bin/argparser/testfiles/test3.fa --all --output -", |
530 |
|
workingDir + "/test1-3.fa", TEST_TIMEOUT }, |
531 |
|
|
532 |
|
{ "--open=./test/jalview/bin/argparser/testfiles/test*.fa --all --output -", |
533 |
|
workingDir + "/test1-3.fa", TEST_TIMEOUT }, |
534 |
|
|
535 |
|
}; |
536 |
|
} |
537 |
|
} |