*/
package jalview.io;
-import static org.testng.AssertJUnit.assertTrue;
-
import jalview.analysis.CrossRef;
import jalview.api.AlignmentViewPanel;
import jalview.datamodel.AlignedCodonFrame;
af = jalview.gui.SequenceFetcher.fetchAndShow(did[0], did[1])
.get(0);
- assertTrue("Didn't retrieve " + first, af != null);
+ Assert.assertTrue(af != null, "Didn't retrieve " + first);
// verify references for retrieved data
AlignmentTest.assertAlignmentDatasetRefs(af.getViewport()
// start of pass2: retrieve each cross-ref for fetched or restored
// project.
- pass2 = 0;
- do // second cross ref and recover crossref loop
+ do // first cross ref and recover crossref loop
{
for (String db : ptypes)
// perform crossref action, or retrieve stored project
List<AlignmentViewPanel> cra_views = new ArrayList<AlignmentViewPanel>();
CrossRefAction cra = null;
+
if (pass2 == 0)
{ // retrieve and show cross-refs in this thread
cra = new CrossRefAction(af, seqs, dna, db);
else
{
Desktop.instance.closeAll_actionPerformed(null);
+ pass3 = 0;
// recover stored project
AlignFrame af2 = new FileLoader(false)
.LoadFileWaitTillLoaded(savedProjects.get(nextxref)
xrptypes.put(nextxref, _xrptypes);
}
- // now do the next xref pass starting from either saved or just
+
+ // now do the second xref pass starting from either saved or just
// recovered split pane, in sequence
- pass3 = 0;
- do // 3rd cross ref and recover crossref loop, for each view from
- // second xref view set or recover viewset
+ do // retrieve second set of cross refs or recover and verify
{
firstcr_ap = 0;
for (AlignmentViewPanel avp : cra_views)
} // end of loop around showing all xrefdb for crossrf2
} // end of loop around all viewpanels from crossrf1
- } while (pass3++ < 2 && pass2 < 1);
+ } while (pass2 == 2 && pass3++ < 2);
// fetchdb->crossref1->crossref-2->verify for xrefs we
// either loop twice when pass2=0, or just once when pass2=1
// (recovered project from previous crossref)
- }
+ } // end of loop over db-xrefs for crossref-2
+
// fetchdb-->crossref1
// for each xref we try to retrieve xref, store and verify when
// pass1=0, or just retrieve and verify when pass1=1
- } while (pass2++ < 2 && pass1 < 1);
+ } while (pass1 == 1 && pass2++ < 2);
// fetchdb
// for each ref we
// loop twice: first, do the retrieve, second recover from saved project
- } while (pass1++ < 2);
+
+ // increment pass counters, so we repeat traversal starting from the
+ // oldest saved project first.
+ if (pass1 == 0)
+ {
+ // verify stored projects for first set of cross references
+ pass1 = 1;
+ // and verify cross-references retrieved from stored projects
+ pass2 = 0;
+ pass3 = 0;
+ }
+ else
+ {
+ // verify stored projects for second set of cross references
+ pass2 = 1;
+ // and verify cross-references retrievable from those stored projects.
+ pass3 = 0;
+ }
+ } while (pass3 < 2);
}
}