/* * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1) * Copyright (C) 2015 The Jalview Authors * * This file is part of Jalview. * * Jalview is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. * * Jalview is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Jalview. If not, see . * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.analysis; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertSame; import jalview.datamodel.DBRefEntry; import org.testng.annotations.Test; public class CrossRefTest { @Test(groups = { "Functional" }) public void testFindXDbRefs() { DBRefEntry ref1 = new DBRefEntry("UNIPROT", "1", "A123"); DBRefEntry ref2 = new DBRefEntry("UNIPROTKB/TREMBL", "1", "A123"); DBRefEntry ref3 = new DBRefEntry("pdb", "1", "A123"); DBRefEntry ref4 = new DBRefEntry("EMBLCDSPROTEIN", "1", "A123"); DBRefEntry ref5 = new DBRefEntry("embl", "1", "A123"); DBRefEntry ref6 = new DBRefEntry("emblCDS", "1", "A123"); DBRefEntry ref7 = new DBRefEntry("GeneDB", "1", "A123"); DBRefEntry ref8 = new DBRefEntry("PFAM", "1", "A123"); DBRefEntry[] refs = new DBRefEntry[] { ref1, ref2, ref3, ref4, ref5, ref6, ref7, ref8 }; /* * Just the DNA refs: */ DBRefEntry[] found = CrossRef.findXDbRefs(false, refs); assertEquals(3, found.length); assertSame(ref5, found[0]); assertSame(ref6, found[1]); assertSame(ref7, found[2]); /* * Just the protein refs: */ found = CrossRef.findXDbRefs(true, refs); assertEquals(4, found.length); assertSame(ref1, found[0]); assertSame(ref2, found[1]); assertSame(ref3, found[2]); assertSame(ref4, found[3]); } }