X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fws%2Fdbsources%2FEBIAlphaFoldTest.java;h=076ee7e6948e3674041cf2bb0845d4962034372f;hb=0788111a588187a04dd0d254d70b055274cf2c9d;hp=e619b8e3768f29cba030786b4e1617ca845f1444;hpb=c71453f1c7de4cc250700c1b6dd39d061982e794;p=jalview.git diff --git a/test/jalview/ws/dbsources/EBIAlphaFoldTest.java b/test/jalview/ws/dbsources/EBIAlphaFoldTest.java index e619b8e..076ee7e 100644 --- a/test/jalview/ws/dbsources/EBIAlphaFoldTest.java +++ b/test/jalview/ws/dbsources/EBIAlphaFoldTest.java @@ -1,14 +1,22 @@ package jalview.ws.dbsources; +import java.io.File; import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import org.json.simple.parser.ParseException; import org.junit.Assert; +import org.testng.FileAssert; import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import jalview.datamodel.Sequence; +import jalview.gui.Desktop; import jalview.gui.JvOptionPane; +import jalview.structure.StructureMapping; +import jalview.structure.StructureSelectionManager; import jalview.ws.datamodel.alphafold.PAEContactMatrix; public class EBIAlphaFoldTest @@ -40,4 +48,36 @@ public class EBIAlphaFoldTest new FileInputStream(paeFile))); Assert.assertNotEquals("No data from " + paeFile, cm.getMax(), 0); } + + @Test(groups = { "Functional" }, dataProvider = "getPDBandPAEfiles") + public void checkImportPAEToStructure(String pdbFile, String paeFile) + { + FileInputStream paeInput = null; + try + { + paeInput = new FileInputStream(paeFile); + } catch (FileNotFoundException e) + { + e.printStackTrace(); + FileAssert.assertFile(new File(paeFile), + "Test file '" + paeFile + "' doesn't seem to exist"); + } + StructureSelectionManager ssm = StructureSelectionManager + .getStructureSelectionManager(Desktop.instance); + + StructureMapping[] smArray = ssm.getMapping(pdbFile); + + try + { + boolean done = EBIAlfaFold.importPaeJSONAsContactMatrixToStructure( + smArray, paeInput, "label"); + Assert.assertTrue( + "Import of '" + paeFile + "' didn't complete successfully", + done); + } catch (IOException | ParseException e) + { + e.printStackTrace(); + } + + } }