/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Annotation;
{
AppletFormatAdapter rf = new AppletFormatAdapter();
- Alignment al = rf.readFile(ff, AppletFormatAdapter.FILE,
+ AlignmentI al = rf.readFile(ff, AppletFormatAdapter.FILE,
new IdentifyFile().Identify(ff, AppletFormatAdapter.FILE));
assertNotNull("Couldn't read supplied alignment data.", al);
System.out.println("Output file in '" + ioformat + "':\n"
+ outputfile + "\n<<EOF\n");
// test for consistency in io
- Alignment al_input = new AppletFormatAdapter().readFile(outputfile,
+ AlignmentI al_input = new AppletFormatAdapter().readFile(outputfile,
AppletFormatAdapter.PASTE, ioformat);
assertNotNull("Couldn't parse reimported alignment data.", al_input);
"Identify routine could not recognise output generated by '"
+ ioformat + "' writer",
ioformat.equals(identifyoutput));
- testAlignmentEquivalence(al, al_input);
+ testAlignmentEquivalence(al, al_input, false);
int numaliannot = 0, numsqswithali = 0;
for (AlignmentAnnotation ala : al_input.getAlignmentAnnotation())
{
* @param al_input
* 'secondary' or generated alignment from some datapreserving
* transformation
+ * @param ignoreFeatures
+ * when true, differences in seuqence feature annotation are ignored.
*/
public static void testAlignmentEquivalence(AlignmentI al,
- AlignmentI al_input)
+ AlignmentI al_input, boolean ignoreFeatures)
{
assertNotNull("Original alignment was null", al);
assertNotNull("Generated alignment was null", al_input);
+ " are not equal", ss_original.equals(ss_new));
assertTrue(
- "Sequence Features were not equivalent",
- (seq_original[i].getSequenceFeatures() == null && seq_new[in]
+ "Sequence Features were not equivalent"
+ + (ignoreFeatures ? " ignoring." : ""),
+ ignoreFeatures
+ || (seq_original[i].getSequenceFeatures() == null && seq_new[in]
.getSequenceFeatures() == null)
|| (seq_original[i].getSequenceFeatures() != null && seq_new[in]
.getSequenceFeatures() != null));