X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fws%2Fdbsources%2FUniprotTest.java;h=ed3ac772598ce214ad884abdb29ed586ecc7a3d5;hb=f225620636ce3b7ec768b4bed98ba000f09efc2a;hp=7e387bd7fdc4e3725b61823f21bb3bde364566f9;hpb=ef9282b464dc189faf9ce40a4b7420a204266668;p=jalview.git diff --git a/test/jalview/ws/dbsources/UniprotTest.java b/test/jalview/ws/dbsources/UniprotTest.java index 7e387bd..ed3ac77 100644 --- a/test/jalview/ws/dbsources/UniprotTest.java +++ b/test/jalview/ws/dbsources/UniprotTest.java @@ -89,19 +89,19 @@ public class UniprotTest assertEquals("signal peptide", sf.getType()); assertNull(sf.getDescription()); assertNull(sf.getStatus()); - assertEquals(1, sf.getPosition()); // wrong - Castor bug?? + assertEquals(1, sf.getPosition()); assertEquals(1, sf.getBegin()); assertEquals(18, sf.getEnd()); sf = features.get(1); assertEquals("propeptide", sf.getType()); assertEquals("Activation peptide", sf.getDescription()); - assertEquals(19, sf.getPosition()); // wrong - Castor bug?? + assertEquals(19, sf.getPosition()); assertEquals(19, sf.getBegin()); assertEquals(20, sf.getEnd()); sf = features.get(2); assertEquals("chain", sf.getType()); assertEquals("Granzyme B", sf.getDescription()); - assertEquals(21, sf.getPosition()); // wrong - Castor bug?? + assertEquals(21, sf.getPosition()); assertEquals(21, sf.getBegin()); assertEquals(247, sf.getEnd()); @@ -125,22 +125,34 @@ public class UniprotTest } /** - * Test the method that formats the sequence name in Fasta style + * Test the method that formats the sequence id */ @Test(groups = { "Functional" }) - public void testConstructSequenceFastaHeader() + public void testGetUniprotEntryId() { - Uniprot u = new Uniprot(); - Reader reader = new StringReader(UNIPROT_XML); - Vector entries = u.getUniprotEntries(reader); - UniprotEntry entry = entries.get(0); + UniprotEntry entry = new Uniprot().getUniprotEntries( + new StringReader(UNIPROT_XML)).get(0); - // source + accession ids + names + /* + * name formatted as source | accession ids | names + */ String expectedName = "UniProt/Swiss-Prot|A9CKP4|A9CKP5|A9CKP4_AGRT5|A9CKP4_AGRT6"; - // protein names - String expectedDescription = "Mitogen-activated protein kinase 13 Henry "; - assertEquals(expectedName, Uniprot.getUniprotEntryId(entry)); + } + + /** + * Test the method that formats the sequence description + */ + @Test(groups = { "Functional" }) + public void testGetUniprotEntryDescription() + { + UniprotEntry entry = new Uniprot().getUniprotEntries( + new StringReader(UNIPROT_XML)).get(0); + + /* + * recommended names concatenated with space separator + */ + String expectedDescription = "Mitogen-activated protein kinase 13 Henry"; assertEquals(expectedDescription, Uniprot.getUniprotEntryDescription(entry)); }