X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=test%2Fjalview%2Fws%2Fdbsources%2FUniprotTest.java;h=2df8be69fb71d97168519ec0a04cb68661d9c8ab;hb=1e943acf589b7393c666204f533d2ebce28d7471;hp=26fcaf03fca547a4b5a2a2a9357eb3e003932a8e;hpb=6c96743ff6c65895e4b96523d0e3d05f6dc3cb01;p=jalview.git
diff --git a/test/jalview/ws/dbsources/UniprotTest.java b/test/jalview/ws/dbsources/UniprotTest.java
index 26fcaf0..2df8be6 100644
--- a/test/jalview/ws/dbsources/UniprotTest.java
+++ b/test/jalview/ws/dbsources/UniprotTest.java
@@ -22,10 +22,12 @@ package jalview.ws.dbsources;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertNotNull;
import static org.testng.AssertJUnit.assertNull;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceI;
import jalview.datamodel.UniprotEntry;
import java.io.Reader;
@@ -47,6 +49,7 @@ public class UniprotTest
+ "Mitogen-activated protein kinase 13Henry"
+ ""
+ ""
+ + ""
+ ""
+ ""
+ ""
@@ -110,7 +113,7 @@ public class UniprotTest
* Check cross-references
*/
Vector xrefs = entry.getDbReference();
- assertEquals(2, xrefs.size());
+ assertEquals(3, xrefs.size());
PDBEntry xref = xrefs.get(0);
assertEquals("2FSQ", xref.getId());
@@ -122,6 +125,25 @@ public class UniprotTest
assertEquals("2FSR", xref.getId());
assertEquals("PDBsum", xref.getType());
assertFalse(xref.getProperties().hasMoreElements());
+
+ xref = xrefs.get(2);
+ assertEquals("AE007869", xref.getId());
+ assertEquals("EMBL", xref.getType());
+ assertEquals("AAK85932.1",
+ xref.getProperty("protein sequence ID"));
+ assertEquals("Genomic_DNA",
+ xref.getProperty("molecule type"));
+ }
+
+ @Test(groups = { "Functional" })
+ public void testGetUniprotSequence()
+ {
+ UniprotEntry entry = new Uniprot().getUniprotEntries(
+ new StringReader(UNIPROT_XML)).get(0);
+ SequenceI seq = new Uniprot().uniprotEntryToSequenceI(entry);
+ assertNotNull(seq);
+ assertEquals(6, seq.getDBRefs().length); // 2*Uniprot, PDB, PDBsum, 2*EMBL
+
}
/**
@@ -149,7 +171,7 @@ public class UniprotTest
{
UniprotEntry entry = new Uniprot().getUniprotEntries(
new StringReader(UNIPROT_XML)).get(0);
-
+
/*
* recommended names concatenated with space separator
*/