From 046aff3885029c55f22027c6fdbeba8167a3a733 Mon Sep 17 00:00:00 2001 From: James Procter Date: Mon, 13 Nov 2023 10:28:37 +0000 Subject: [PATCH] JAL-4334 failing test using whole of Q29079 accession. Can be trimmed. --- test/jalview/ws/dbsources/UniprotTest.java | 315 ++++++++++++++++++++++++++++ 1 file changed, 315 insertions(+) diff --git a/test/jalview/ws/dbsources/UniprotTest.java b/test/jalview/ws/dbsources/UniprotTest.java index 176cddc..48f1f43 100644 --- a/test/jalview/ws/dbsources/UniprotTest.java +++ b/test/jalview/ws/dbsources/UniprotTest.java @@ -34,6 +34,7 @@ import java.util.List; import org.testng.Assert; import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import jalview.datamodel.DBRefEntry; @@ -324,4 +325,318 @@ public class UniprotTest ft.getVariation().clear(); // variant missing - is ignored assertEquals("Hello", Uniprot.getDescription(ft)); } + + @DataProvider + public Object[][] problemEntries() + { + return new Object[][] { + new Object[] + { new String( + "\n" + + "\n" + + "Q29079\n" + + "Q29017\n" + + "PAG2_PIG\n" + "\n" + + "\n" + + "Pregnancy-associated glycoprotein 2\n" + + "PAG 2\n" + + "3.4.23.-\n" + + "\n" + "\n" + + "\n" + + "PAG2\n" + + "\n" + "\n" + + "Sus scrofa\n" + + "Pig\n" + + "\n" + + "\n" + "Eukaryota\n" + + "Metazoa\n" + + "Chordata\n" + + "Craniata\n" + + "Vertebrata\n" + + "Euteleostomi\n" + + "Mammalia\n" + + "Eutheria\n" + + "Laurasiatheria\n" + + "Artiodactyla\n" + + "Suina\n" + + "Suidae\n" + "Sus\n" + + "\n" + "\n" + + "\n" + + "\n" + + "Porcine pregnancy-associated glycoproteins: new members of the aspartic proteinase gene family expressed in trophectoderm.\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "NUCLEOTIDE SEQUENCE [GENOMIC DNA]\n" + + "\n" + "\n" + + "\n" + + "Gene for porcine pregnancy-associated glycoprotein 2 (poPAG2): its structural organization and analysis of its promoter.\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "NUCLEOTIDE SEQUENCE [GENOMIC DNA]\n" + + "\n" + "Placenta\n" + + "\n" + "\n" + + "\n" + + "\n" + + "Secreted\n" + + "Extracellular space\n" + + "\n" + "\n" + + "\n" + + "Expressed throughout the chorion, with the signal localized exclusively over the trophectoderm.\n" + + "\n" + + "\n" + + "Expression was detected at day 15, coinciding with the beginning of implantation, and continued throughout gestation.\n" + + "\n" + "\n" + + "Belongs to the peptidase A1 family.\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "Aspartyl protease\n" + + "Disulfide bond\n" + + "Glycoprotein\n" + + "Hydrolase\n" + + "Protease\n" + + "Reference proteome\n" + + "Secreted\n" + + "Signal\n" + + "Zymogen\n" + + "\n" + + "\n" + "\n" + + "\n" + "\n" + + "\n" + + "\n" + + "\n" + "\n" + + "\n" + "\n" + + "\n" + + "\n" + + "\n" + "\n" + + "\n" + "\n" + + "\n" + + "\n" + + "\n" + "\n" + + "\n" + "\n" + + "\n" + + "\n" + + "\n" + "\n" + + "\n" + "\n" + + "\n" + + "\n" + "\n" + + "\n" + "\n" + + "\n" + + "\n" + "\n" + + "\n" + "\n" + + "\n" + + "\n" + "\n" + + "\n" + "\n" + + "\n" + + "\n" + "\n" + + "\n" + "\n" + + "\n" + + "\n" + + "\n" + "\n" + + "\n" + "\n" + + "\n" + + "\n" + + "\n" + "\n" + + "\n" + "\n" + + "\n" + + "\n" + + "\n" + "\n" + + "\n" + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + "\n" + + "\n" + + "MKWLVILGLVALSDCLVMIPLTKVKSVRESLREKGLLKNFLKEHPYNMIQNLLSKNSSHVQKFSYQPLRNYLDMVYVGNISIGTPPQQFSVVFDTGSSDLWVPSIYCKSKACVTHRSFNPSHSSTFHDRGKSIKLEYGSGKMSGFLGQDTVRIGQLTSTGQAFGLSKEETGKAFEHAIFDGILGLAYPSIAIKGTTTVIDNLKKQDQISEPVFAFYLSSDKEEGSVVMFGGVDKKYYKGDLKWVPLTQTSYWQIALDRITCRGRVIGCPRGCQAIVDTGTSMLHGPSKAVAKIHSLIKHFEKEYVVPCNARKALPDIVFTINNVDYPVPAQAYIRKYVVPCNARKALPDIVFTINNVDYPVPAQAYIRKNANNNRCYSTFEDIMDTLNQREIWILGDVFLRLYFTVYDEGQNRIGLAQAT\n" + + "\n" + + " Copyrighted by the UniProt Consortium, see https://www.uniprot.org/terms Distributed under the Creative Commons Attribution (CC BY 4.0) License \n" + + "") } }; + } + + @Test(groups = "Functional", dataProvider = "problemEntries") + public void testimportOfProblemEntries(String entry) + { + Uniprot u = new Uniprot(); + InputStream is = new ByteArrayInputStream(entry.getBytes()); + List entries = u.getUniprotEntries(is); + assertEquals(1, entries.size()); + SequenceI sq = u.uniprotEntryToSequence(entries.get(0)); + assertNotNull(sq); + } } -- 1.7.10.2