import static org.testng.Assert.assertSame;
import static org.testng.Assert.assertTrue;
+import java.awt.Color;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.swing.JInternalFrame;
+
+import org.testng.Assert;
+import org.testng.AssertJUnit;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
import jalview.analysis.scoremodels.SimilarityParams;
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
import jalview.datamodel.Mapping;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.PDBEntry.Type;
+import jalview.datamodel.Sequence.DBModList;
import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceGroup;
import jalview.viewmodel.AlignmentViewport;
import jalview.viewmodel.seqfeatures.FeatureRendererModel;
-import java.awt.Color;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.swing.JInternalFrame;
-
-import org.testng.Assert;
-import org.testng.AssertJUnit;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
@Test(singleThreaded = true)
public class Jalview2xmlTests extends Jalview2xmlBase
{
DataSourceType.FILE);
AlignmentViewPanel rap = Desktop.getAlignmentPanels(null)[0];
SequenceI rpep = rap.getAlignment().getSequenceAt(0);
+ DBModList<DBRefEntry> dbrefs = rpep.getDBRefs();
assertEquals(rpep.getName(), "P30419");
- DBRefEntry[] dbrefs = (DBRefEntry[]) rpep.getDBRefs().toArray();
- assertEquals(dbrefs.length, 3);
- DBRefEntry dbRef = dbrefs[0];
+ assertEquals(dbrefs.size(), 3);
+ DBRefEntry dbRef = dbrefs.get(0);
assertFalse(dbRef instanceof GeneLocus);
assertNull(dbRef.getMap());
assertEquals(dbRef, dbref1);
* restored dbrefs with mapping have a different 'map to'
* sequence but otherwise match the original dbrefs
*/
- dbRef = dbrefs[1];
+ dbRef = dbrefs.get(1);
assertFalse(dbRef instanceof GeneLocus);
assertTrue(dbRef.equalRef(dbref2));
assertNotNull(dbRef.getMap());
/*
* GeneLocus map.to is null so can compare Mapping objects
*/
- dbRef = dbrefs[2];
+ dbRef = dbrefs.get(2);
assertTrue(dbRef instanceof GeneLocus);
assertEquals(dbRef, dbref3);
}