4177acc1ab5d3517acd507b7cd075572d8eae867
[jalview.git] / test / jalview / gui / SeqPanelTest.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package jalview.gui;
22
23 import static org.testng.Assert.assertEquals;
24 import static org.testng.Assert.assertTrue;
25
26 import jalview.api.AlignViewportI;
27 import jalview.bin.Cache;
28 import jalview.bin.Jalview;
29 import jalview.datamodel.Alignment;
30 import jalview.datamodel.AlignmentI;
31 import jalview.datamodel.Sequence;
32 import jalview.datamodel.SequenceI;
33 import jalview.gui.SeqPanel.MousePos;
34 import jalview.io.DataSourceType;
35 import jalview.io.FileLoader;
36
37 import java.awt.Event;
38 import java.awt.event.MouseEvent;
39
40 import org.testng.annotations.AfterMethod;
41 import org.testng.annotations.BeforeClass;
42 import org.testng.annotations.Test;
43
44 public class SeqPanelTest
45 {
46   AlignFrame af;
47
48   @BeforeClass(alwaysRun = true)
49   public void setUpJvOptionPane()
50   {
51     JvOptionPane.setInteractiveMode(false);
52     JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
53   }
54   @Test(groups = "Functional")
55   public void testSetStatusReturnsNearestResiduePosition()
56   {
57     SequenceI seq1 = new Sequence("Seq1", "AACDE");
58     SequenceI seq2 = new Sequence("Seq2", "AA--E");
59     AlignmentI al = new Alignment(new SequenceI[] { seq1, seq2 });
60     AlignFrame alignFrame = new AlignFrame(al, al.getWidth(),
61             al.getHeight());
62     AlignmentI visAl = alignFrame.getViewport().getAlignment();
63
64     // Test either side of gap
65     assertEquals(
66             alignFrame.alignPanel.getSeqPanel().setStatusMessage(
67                     visAl.getSequenceAt(1), 1, 1), 2);
68     assertEquals(alignFrame.statusBar.getText(),
69             "Sequence 2 ID: Seq2 Residue: ALA (2)");
70     assertEquals(
71             alignFrame.alignPanel.getSeqPanel().setStatusMessage(
72                     visAl.getSequenceAt(1), 4, 1), 3);
73     assertEquals(alignFrame.statusBar.getText(),
74             "Sequence 2 ID: Seq2 Residue: GLU (3)");
75     // no status message at a gap, returns next residue position to the right
76     assertEquals(
77             alignFrame.alignPanel.getSeqPanel().setStatusMessage(
78                     visAl.getSequenceAt(1), 2, 1), 3);
79     assertEquals(alignFrame.statusBar.getText(), "Sequence 2 ID: Seq2");
80     assertEquals(
81             alignFrame.alignPanel.getSeqPanel().setStatusMessage(
82                     visAl.getSequenceAt(1), 3, 1), 3);
83     assertEquals(alignFrame.statusBar.getText(), "Sequence 2 ID: Seq2");
84   }
85
86   @Test(groups = "Functional")
87   public void testAmbiguousAminoAcidGetsStatusMessage()
88   {
89     SequenceI seq1 = new Sequence("Seq1", "ABCDE");
90     SequenceI seq2 = new Sequence("Seq2", "AB--E");
91     AlignmentI al = new Alignment(new SequenceI[] { seq1, seq2 });
92     AlignFrame alignFrame = new AlignFrame(al, al.getWidth(),
93             al.getHeight());
94     AlignmentI visAl = alignFrame.getViewport().getAlignment();
95
96     assertEquals(
97             alignFrame.alignPanel.getSeqPanel().setStatusMessage(
98                     visAl.getSequenceAt(1), 1, 1), 2);
99     assertEquals(alignFrame.statusBar.getText(),
100             "Sequence 2 ID: Seq2 Residue: B (2)");
101   }
102
103   @Test(groups = "Functional")
104   public void testFindMousePosition_unwrapped()
105   {
106     String seqData = ">Seq1\nAACDE\n>Seq2\nAA--E\n";
107     AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded(seqData,
108             DataSourceType.PASTE);
109     AlignViewportI av = alignFrame.getViewport();
110     av.setShowAnnotation(true);
111     av.setWrapAlignment(false);
112     final int charHeight = av.getCharHeight();
113     final int charWidth = av.getCharWidth();
114     // sanity checks:
115     assertTrue(charHeight > 0);
116     assertTrue(charWidth > 0);
117     assertTrue(alignFrame.alignPanel.getSeqPanel().getWidth() > 0);
118
119     SeqPanel testee = alignFrame.alignPanel.getSeqPanel();
120     int x = 0;
121     int y = 0;
122
123     /*
124      * mouse at top left of unwrapped panel
125      */
126     MouseEvent evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y,
127             0, 0, 0, false, 0);
128     MousePos pos = testee.findMousePosition(evt);
129     assertEquals(pos.column, 0);
130     assertEquals(pos.seqIndex, 0);
131     assertEquals(pos.annotationIndex, -1);
132   }
133
134   @AfterMethod(alwaysRun = true)
135   public void tearDown()
136   {
137     Desktop.instance.closeAll_actionPerformed(null);
138   }
139
140   @Test(groups = "Functional")
141   public void testFindMousePosition_wrapped()
142   {
143     Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", "true");
144     Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", "true");
145     AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded(
146             "examples/uniref50.fa", DataSourceType.FILE);
147     AlignViewportI av = alignFrame.getViewport();
148     av.setScaleAboveWrapped(false);
149     av.setScaleLeftWrapped(false);
150     av.setScaleRightWrapped(false);
151     alignFrame.alignPanel.paintAlignment(false, false);
152
153     final int charHeight = av.getCharHeight();
154     final int charWidth = av.getCharWidth();
155     final int alignmentHeight = av.getAlignment().getHeight();
156     
157     // sanity checks:
158     assertTrue(charHeight > 0);
159     assertTrue(charWidth > 0);
160     assertTrue(alignFrame.alignPanel.getSeqPanel().getWidth() > 0);
161   
162     SeqPanel testee = alignFrame.alignPanel.getSeqPanel();
163     int x = 0;
164     int y = 0;
165   
166     /*
167      * mouse at top left of wrapped panel; there is a gap of charHeight
168      * above the alignment
169      */
170     MouseEvent evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y,
171             0, 0, 0, false, 0);
172     MousePos pos = testee.findMousePosition(evt);
173     assertEquals(pos.column, 0);
174     assertEquals(pos.seqIndex, -1); // above sequences
175     assertEquals(pos.annotationIndex, -1);
176
177     /*
178      * cursor at bottom of gap above
179      */
180     y = charHeight - 1;
181     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
182             false, 0);
183     pos = testee.findMousePosition(evt);
184     assertEquals(pos.seqIndex, -1);
185     assertEquals(pos.annotationIndex, -1);
186
187     /*
188      * cursor over top of first sequence
189      */
190     y = charHeight;
191     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
192             false, 0);
193     pos = testee.findMousePosition(evt);
194     assertEquals(pos.seqIndex, 0);
195     assertEquals(pos.annotationIndex, -1);
196
197     /*
198      * cursor at bottom of first sequence
199      */
200     y = 2 * charHeight - 1;
201     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
202             false, 0);
203     pos = testee.findMousePosition(evt);
204     assertEquals(pos.seqIndex, 0);
205     assertEquals(pos.annotationIndex, -1);
206
207     /*
208      * cursor at top of second sequence
209      */
210     y = 2 * charHeight;
211     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
212             false, 0);
213     pos = testee.findMousePosition(evt);
214     assertEquals(pos.seqIndex, 1);
215     assertEquals(pos.annotationIndex, -1);
216
217     /*
218      * cursor at bottom of second sequence
219      */
220     y = 3 * charHeight - 1;
221     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
222             false, 0);
223     pos = testee.findMousePosition(evt);
224     assertEquals(pos.seqIndex, 1);
225     assertEquals(pos.annotationIndex, -1);
226
227     /*
228      * cursor at bottom of last sequence
229      */
230     y = charHeight * (1 + alignmentHeight) - 1;
231     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
232             false, 0);
233     pos = testee.findMousePosition(evt);
234     assertEquals(pos.seqIndex, alignmentHeight - 1);
235     assertEquals(pos.annotationIndex, -1);
236
237     /*
238      * cursor below sequences, in 3-pixel gap above annotations
239      */
240     y += 1;
241     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
242             false, 0);
243     pos = testee.findMousePosition(evt);
244     assertEquals(pos.seqIndex, alignmentHeight - 1);
245     assertEquals(pos.annotationIndex, -1);
246
247     /*
248      * cursor still in the gap above annotations, now at the bottom of it
249      * method reports index of nearest sequence above  
250      */
251     y += SeqCanvas.SEQS_ANNOTATION_GAP - 1; // 3-1 = 2
252     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
253             false, 0);
254     pos = testee.findMousePosition(evt);
255     assertEquals(pos.seqIndex, alignmentHeight - 1);
256     assertEquals(pos.annotationIndex, -1);
257
258     /*
259      * cursor at the top of the first annotation  
260      */
261     y += 1;
262     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
263             false, 0);
264     pos = testee.findMousePosition(evt);
265     assertEquals(pos.seqIndex, alignmentHeight - 1);
266     assertEquals(pos.annotationIndex, 0); // over first annotation
267
268     /*
269      * cursor at the bottom of the first annotation  
270      */
271     y += av.getAlignment().getAlignmentAnnotation()[0].height - 1;
272     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
273             false, 0);
274     pos = testee.findMousePosition(evt);
275     assertEquals(pos.seqIndex, alignmentHeight - 1);
276     assertEquals(pos.annotationIndex, 0);
277
278     /*
279      * cursor at the top of the second annotation  
280      */
281     y += 1;
282     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
283             false, 0);
284     pos = testee.findMousePosition(evt);
285     assertEquals(pos.seqIndex, alignmentHeight - 1);
286     assertEquals(pos.annotationIndex, 1);
287
288     /*
289      * cursor at the bottom of the second annotation  
290      */
291     y += av.getAlignment().getAlignmentAnnotation()[1].height - 1;
292     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
293             false, 0);
294     pos = testee.findMousePosition(evt);
295     assertEquals(pos.seqIndex, alignmentHeight - 1);
296     assertEquals(pos.annotationIndex, 1);
297
298     /*
299      * cursor at the top of the third annotation  
300      */
301     y += 1;
302     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
303             false, 0);
304     pos = testee.findMousePosition(evt);
305     assertEquals(pos.seqIndex, alignmentHeight - 1);
306     assertEquals(pos.annotationIndex, 2);
307
308     /*
309      * cursor at the bottom of the third annotation  
310      */
311     y += av.getAlignment().getAlignmentAnnotation()[2].height - 1;
312     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
313             false, 0);
314     pos = testee.findMousePosition(evt);
315     assertEquals(pos.seqIndex, alignmentHeight - 1);
316     assertEquals(pos.annotationIndex, 2);
317
318     /*
319      * cursor in gap between wrapped widths  
320      */
321     y += 1;
322     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
323             false, 0);
324     pos = testee.findMousePosition(evt);
325     assertEquals(pos.seqIndex, -1);
326     assertEquals(pos.annotationIndex, -1);
327
328     /*
329      * cursor at bottom of gap between wrapped widths  
330      */
331     y += charHeight - 1;
332     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
333             false, 0);
334     pos = testee.findMousePosition(evt);
335     assertEquals(pos.seqIndex, -1);
336     assertEquals(pos.annotationIndex, -1);
337
338     /*
339      * cursor at top of first sequence, second wrapped width  
340      */
341     y += 1;
342     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
343             false, 0);
344     pos = testee.findMousePosition(evt);
345     assertEquals(pos.seqIndex, 0);
346     assertEquals(pos.annotationIndex, -1);
347   }
348
349   @Test(groups = "Functional")
350   public void testFindMousePosition_wrapped_scaleAbove()
351   {
352     Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", "true");
353     Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", "true");
354     AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded(
355             "examples/uniref50.fa", DataSourceType.FILE);
356     AlignViewportI av = alignFrame.getViewport();
357     av.setScaleAboveWrapped(true);
358     av.setScaleLeftWrapped(false);
359     av.setScaleRightWrapped(false);
360     alignFrame.alignPanel.paintAlignment(false, false);
361   
362     final int charHeight = av.getCharHeight();
363     final int charWidth = av.getCharWidth();
364     final int alignmentHeight = av.getAlignment().getHeight();
365     
366     // sanity checks:
367     assertTrue(charHeight > 0);
368     assertTrue(charWidth > 0);
369     assertTrue(alignFrame.alignPanel.getSeqPanel().getWidth() > 0);
370   
371     SeqPanel testee = alignFrame.alignPanel.getSeqPanel();
372     int x = 0;
373     int y = 0;
374   
375     /*
376      * mouse at top left of wrapped panel; there is a gap of charHeight
377      * above the alignment
378      */
379     MouseEvent evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y,
380             0, 0, 0, false, 0);
381     MousePos pos = testee.findMousePosition(evt);
382     assertEquals(pos.column, 0);
383     assertEquals(pos.seqIndex, -1); // above sequences
384     assertEquals(pos.annotationIndex, -1);
385   
386     /*
387      * cursor at bottom of gap above
388      * two charHeights including scale panel
389      */
390     y = 2 * charHeight - 1;
391     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
392             false, 0);
393     pos = testee.findMousePosition(evt);
394     assertEquals(pos.seqIndex, -1);
395     assertEquals(pos.annotationIndex, -1);
396   
397     /*
398      * cursor over top of first sequence
399      */
400     y += 1;
401     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
402             false, 0);
403     pos = testee.findMousePosition(evt);
404     assertEquals(pos.seqIndex, 0);
405     assertEquals(pos.annotationIndex, -1);
406   
407     /*
408      * cursor at bottom of first sequence
409      */
410     y += charHeight - 1;
411     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
412             false, 0);
413     pos = testee.findMousePosition(evt);
414     assertEquals(pos.seqIndex, 0);
415     assertEquals(pos.annotationIndex, -1);
416   
417     /*
418      * cursor at top of second sequence
419      */
420     y += 1;
421     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
422             false, 0);
423     pos = testee.findMousePosition(evt);
424     assertEquals(pos.seqIndex, 1);
425     assertEquals(pos.annotationIndex, -1);
426   
427     /*
428      * cursor at bottom of second sequence
429      */
430     y += charHeight - 1;
431     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
432             false, 0);
433     pos = testee.findMousePosition(evt);
434     assertEquals(pos.seqIndex, 1);
435     assertEquals(pos.annotationIndex, -1);
436   
437     /*
438      * cursor at bottom of last sequence
439      * (scale + gap + sequences)
440      */
441     y = charHeight * (2 + alignmentHeight) - 1;
442     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
443             false, 0);
444     pos = testee.findMousePosition(evt);
445     assertEquals(pos.seqIndex, alignmentHeight - 1);
446     assertEquals(pos.annotationIndex, -1);
447   
448     /*
449      * cursor below sequences, in 3-pixel gap above annotations
450      */
451     y += 1;
452     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
453             false, 0);
454     pos = testee.findMousePosition(evt);
455     assertEquals(pos.seqIndex, alignmentHeight - 1);
456     assertEquals(pos.annotationIndex, -1);
457   
458     /*
459      * cursor still in the gap above annotations, now at the bottom of it
460      * method reports index of nearest sequence above  
461      */
462     y += SeqCanvas.SEQS_ANNOTATION_GAP - 1; // 3-1 = 2
463     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
464             false, 0);
465     pos = testee.findMousePosition(evt);
466     assertEquals(pos.seqIndex, alignmentHeight - 1);
467     assertEquals(pos.annotationIndex, -1);
468   
469     /*
470      * cursor at the top of the first annotation  
471      */
472     y += 1;
473     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
474             false, 0);
475     pos = testee.findMousePosition(evt);
476     assertEquals(pos.seqIndex, alignmentHeight - 1);
477     assertEquals(pos.annotationIndex, 0); // over first annotation
478   
479     /*
480      * cursor at the bottom of the first annotation  
481      */
482     y += av.getAlignment().getAlignmentAnnotation()[0].height - 1;
483     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
484             false, 0);
485     pos = testee.findMousePosition(evt);
486     assertEquals(pos.seqIndex, alignmentHeight - 1);
487     assertEquals(pos.annotationIndex, 0);
488   
489     /*
490      * cursor at the top of the second annotation  
491      */
492     y += 1;
493     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
494             false, 0);
495     pos = testee.findMousePosition(evt);
496     assertEquals(pos.seqIndex, alignmentHeight - 1);
497     assertEquals(pos.annotationIndex, 1);
498   
499     /*
500      * cursor at the bottom of the second annotation  
501      */
502     y += av.getAlignment().getAlignmentAnnotation()[1].height - 1;
503     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
504             false, 0);
505     pos = testee.findMousePosition(evt);
506     assertEquals(pos.seqIndex, alignmentHeight - 1);
507     assertEquals(pos.annotationIndex, 1);
508   
509     /*
510      * cursor at the top of the third annotation  
511      */
512     y += 1;
513     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
514             false, 0);
515     pos = testee.findMousePosition(evt);
516     assertEquals(pos.seqIndex, alignmentHeight - 1);
517     assertEquals(pos.annotationIndex, 2);
518   
519     /*
520      * cursor at the bottom of the third annotation  
521      */
522     y += av.getAlignment().getAlignmentAnnotation()[2].height - 1;
523     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
524             false, 0);
525     pos = testee.findMousePosition(evt);
526     assertEquals(pos.seqIndex, alignmentHeight - 1);
527     assertEquals(pos.annotationIndex, 2);
528   
529     /*
530      * cursor in gap between wrapped widths  
531      */
532     y += 1;
533     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
534             false, 0);
535     pos = testee.findMousePosition(evt);
536     assertEquals(pos.seqIndex, -1);
537     assertEquals(pos.annotationIndex, -1);
538   
539     /*
540      * cursor at bottom of gap between wrapped widths  
541      */
542     y += charHeight - 1;
543     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
544             false, 0);
545     pos = testee.findMousePosition(evt);
546     assertEquals(pos.seqIndex, -1);
547     assertEquals(pos.annotationIndex, -1);
548   
549     /*
550      * cursor at top of scale, second wrapped width  
551      */
552     y += 1;
553     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
554             false, 0);
555     pos = testee.findMousePosition(evt);
556     assertEquals(pos.seqIndex, -1);
557     assertEquals(pos.annotationIndex, -1);
558
559     /*
560      * cursor at bottom of scale, second wrapped width  
561      */
562     y += charHeight - 1;
563     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
564             false, 0);
565     pos = testee.findMousePosition(evt);
566     assertEquals(pos.seqIndex, -1);
567     assertEquals(pos.annotationIndex, -1);
568
569     /*
570      * cursor at top of first sequence, second wrapped width  
571      */
572     y += 1;
573     evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0,
574             false, 0);
575     pos = testee.findMousePosition(evt);
576     assertEquals(pos.seqIndex, 0);
577     assertEquals(pos.annotationIndex, -1);
578   }
579   @BeforeClass(alwaysRun = true)
580   public static void setUpBeforeClass() throws Exception
581   {
582     /*
583      * use read-only test properties file
584      */
585     Cache.loadProperties("test/jalview/io/testProps.jvprops");
586     Jalview.main(new String[] { "-nonews" });
587   }
588 }