X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fstructure%2FMapping.java;h=4bee3f5ad73614f1912c83110d8b78e4e9592cdc;hb=refs%2Fheads%2Fpatch%2FJAL-2321_addsecstrForDroppedPDBFile;hp=8674ed8d80bc7d15a2d52bd84ef2c9659414bec3;hpb=39a3725d4d499eb0f1bd14e3c049cd954faddfdc;p=jalview.git diff --git a/test/jalview/structure/Mapping.java b/test/jalview/structure/Mapping.java index 8674ed8..4bee3f5 100644 --- a/test/jalview/structure/Mapping.java +++ b/test/jalview/structure/Mapping.java @@ -28,17 +28,27 @@ import jalview.datamodel.Annotation; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; +import jalview.io.DataSourceType; +import jalview.io.FileFormat; import jalview.io.FileLoader; -import jalview.io.FormatAdapter; import jalview.io.StructureFile; import org.testng.Assert; import org.testng.AssertJUnit; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class Mapping { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /* * more test data * @@ -68,7 +78,7 @@ public class Mapping StructureSelectionManager ssm = new jalview.structure.StructureSelectionManager(); StructureFile pmap = ssm.setMapping(true, new SequenceI[] { uprot }, new String[] { "A" }, "test/jalview/ext/jmol/1QCF.pdb", - jalview.io.FormatAdapter.FILE); + DataSourceType.FILE); assertTrue(pmap != null); SequenceI protseq = pmap.getSeqsAsArray()[0]; AlignmentAnnotation pstra = protseq @@ -139,7 +149,7 @@ public class Mapping // source StructureFile pde = ssm.setMapping(true, new SequenceI[] { sq }, new String[] - { "A" }, inFile = "examples/1gaq.txt", jalview.io.FormatAdapter.FILE); + { "A" }, inFile = "examples/1gaq.txt", DataSourceType.FILE); assertTrue("PDB File couldn't be found", pde != null); StructureMapping[] mp = ssm.getMapping(inFile); assertTrue("No mappings made.", mp != null && mp.length > 0); @@ -231,12 +241,12 @@ public class Mapping AlignFrame seqf = new FileLoader(false) .LoadFileWaitTillLoaded( ">FER1_MAIZE/1-150 Ferredoxin-1, chloroplast precursor\nMATVLGSPRAPAFFFSSSSLRAAPAPTAVALPAAKVGIMGRSASSRRRLRAQATYNVKLITPEGEVELQVPD\nDVYILDQAEEDGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSYLDDGQIADGWVLTCHAYPTSDVVIETHKE\nEELTGA", - FormatAdapter.PASTE, "FASTA"); + DataSourceType.PASTE, FileFormat.Fasta); SequenceI newseq = seqf.getViewport().getAlignment().getSequenceAt(0); StructureSelectionManager ssm = new jalview.structure.StructureSelectionManager(); StructureFile pmap = ssm.setMapping(true, new SequenceI[] { newseq }, new String[] { null }, "examples/3W5V.pdb", - jalview.io.FormatAdapter.FILE); + DataSourceType.FILE); if (pmap == null) { AssertJUnit.fail("Couldn't make a mapping for 3W5V to FER1_MAIZE"); @@ -250,10 +260,12 @@ public class Mapping @Test(groups = { "Functional" }) public void compareTransferredToRefPDBAnnot() throws Exception { - StructureViewSettings.setShowSeqFeatures(true); + StructureImportSettings.setProcessSecondaryStructure(true); + StructureImportSettings.setVisibleChainAnnotation(true); + StructureImportSettings.setShowSeqFeatures(true); AlignFrame ref = new FileLoader(false) .LoadFileWaitTillLoaded("test/jalview/ext/jmol/1QCF.pdb", - jalview.io.FormatAdapter.FILE); + DataSourceType.FILE); SequenceI refseq = ref.getViewport().getAlignment().getSequenceAt(0); SequenceI newseq = new Sequence(refseq.getName() + "Copy", refseq.getSequenceAsString()); @@ -265,7 +277,7 @@ public class Mapping ssm.setAddTempFacAnnot(true); StructureFile pmap = ssm.setMapping(true, new SequenceI[] { newseq }, new String[] { null }, "test/jalview/ext/jmol/1QCF.pdb", - jalview.io.FormatAdapter.FILE); + DataSourceType.FILE); assertTrue(pmap != null); assertEquals("Original and copied sequence of different lengths.", refseq.getLength(), newseq.getLength());