+
+ @Test(groups = { "Network" })
+ public void getEntityByMostOptimalMatchedIdTest1() throws IOException,
+ SiftsException
+ {
+ SiftsClient siftsClientX = null;
+ PDBfile pdbFile;
+ pdbFile = new PDBfile(false, false, false, "test/jalview/io/2nq2"
+ + ".pdb", DataSourceType.FILE);
+ siftsClientX = new SiftsClient(pdbFile);
+ Entity entityA = siftsClientX.getEntityByMostOptimalMatchedId("A");
+ Assert.assertEquals(entityA.getEntityId(), "A");
+ Entity entityB = siftsClientX.getEntityByMostOptimalMatchedId("B");
+ Assert.assertEquals(entityB.getEntityId(), "C");
+ Entity entityC = siftsClientX.getEntityByMostOptimalMatchedId("C");
+ Assert.assertEquals(entityC.getEntityId(), "B");
+ Entity entityD = siftsClientX.getEntityByMostOptimalMatchedId("D");
+ Assert.assertEquals(entityD.getEntityId(), "D");
+
+ }
+
+ @Test(groups = { "Network" })
+ public void getEntityByMostOptimalMatchedIdTest2() throws IOException,
+ SiftsException
+ {
+ // This test is for a SIFTS file in which entity A should map to chain P for
+ // the given PDB Id. All the other chains shouldn't be mapped as there are
+ // no SIFTS entity records for them.
+ SiftsClient siftsClientX = null;
+ PDBfile pdbFile;
+ pdbFile = new PDBfile(false, false, false, "test/jalview/io/3ucu.cif",
+ DataSourceType.FILE);
+ siftsClientX = new SiftsClient(pdbFile);
+ Entity entityA = siftsClientX.getEntityByMostOptimalMatchedId("P");
+ Entity entityP = siftsClientX.getEntityByMostOptimalMatchedId("A");
+ Entity entityR = siftsClientX.getEntityByMostOptimalMatchedId("R");
+ Assert.assertEquals(entityA.getEntityId(), "A");
+ Assert.assertNotEquals(entityR, "A");
+ Assert.assertNotEquals(entityP, "A");
+ Assert.assertNotEquals(entityR, "R");
+ Assert.assertNotEquals(entityP, "P");
+ Assert.assertNull(entityR);
+ Assert.assertNull(entityP);
+
+ }