X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fstructure%2FStructureSelectionManagerTest.java;h=d8f73145cb5994c1850614cde8f93c4560a40676;hb=98d59199a7d3ecd84b44a1c24629a6687577f565;hp=a882bceb1f4b7f98bec296153ae99e2ea3eed06c;hpb=5a1711dd94cfb12881f76fd29c940cfcb01685b3;p=jalview.git diff --git a/test/jalview/structure/StructureSelectionManagerTest.java b/test/jalview/structure/StructureSelectionManagerTest.java index a882bce..d8f7314 100644 --- a/test/jalview/structure/StructureSelectionManagerTest.java +++ b/test/jalview/structure/StructureSelectionManagerTest.java @@ -27,6 +27,7 @@ import static org.testng.AssertJUnit.assertTrue; import jalview.analysis.AlignmentUtils; import jalview.api.structures.JalviewStructureDisplayI; +import jalview.bin.Cache; import jalview.datamodel.AlignedCodonFrame; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; @@ -46,6 +47,7 @@ import jalview.io.FileLoader; import jalview.io.Jalview2xmlBase; import jalview.io.StructureFile; import jalview.util.MapList; +import jalview.ws.DBRefFetcher; import jalview.ws.sifts.SiftsSettings; import java.util.ArrayList; @@ -78,7 +80,8 @@ public class StructureSelectionManagerTest extends Jalview2xmlBase public void setUp() { StructureImportSettings.setShowSeqFeatures(true); - ssm = new StructureSelectionManager(); + StructureSelectionManager.release(null); + ssm = StructureSelectionManager.getStructureSelectionManager(null); } @Test(groups = { "Functional" }) @@ -122,10 +125,10 @@ public class StructureSelectionManagerTest extends Jalview2xmlBase acf3.addMap(new Sequence("s3", "ttt"), new Sequence("p3", "p"), new MapList(new int[] { 1, 3 }, new int[] { 1, 1 }, 1, 1)); - List set1 = new ArrayList(); + List set1 = new ArrayList<>(); set1.add(acf1); set1.add(acf2); - List set2 = new ArrayList(); + List set2 = new ArrayList<>(); set2.add(acf2); set2.add(acf3); @@ -153,7 +156,8 @@ public class StructureSelectionManagerTest extends Jalview2xmlBase SequenceI seq = new Sequence( "1GAQ|B", "ATYNVKLITPEGEVELQVPDDVYILDQAEEDGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSYLDDGQIADGWVLTCHAYPTSDVVIETHKEEELTGA"); - StructureSelectionManager sm = new StructureSelectionManager(); + StructureSelectionManager sm = StructureSelectionManager + .getStructureSelectionManager(null); sm.setProcessSecondaryStructure(true); sm.setAddTempFacAnnot(true); StructureFile pmap = sm.setMapping(true, new SequenceI[] { seq }, @@ -197,14 +201,15 @@ public class StructureSelectionManagerTest extends Jalview2xmlBase { // for some reason 'BeforeMethod' (which should be inherited from // Jalview2XmlBase isn't always called)... - Desktop.instance.closeAll_actionPerformed(null); + Desktop.getInstance().closeAll_actionPerformed(null); try { Thread.sleep(200); - } catch (Exception foo) {}; + } catch (Exception foo) {} SequenceI seq = new Sequence("4IM2|A", "LDFCIRNIEKTVMGEISDIHTKLLRLSSSQGTIE"); String P4IM2_MISSING = "examples/testdata/4IM2_missing.pdb"; - StructureSelectionManager sm = new StructureSelectionManager(); + StructureSelectionManager sm = StructureSelectionManager + .getStructureSelectionManager(null); sm.setProcessSecondaryStructure(true); sm.setAddTempFacAnnot(true); StructureFile pmap = sm.setMapping(true, new SequenceI[] { seq }, @@ -349,6 +354,9 @@ public class StructureSelectionManagerTest extends Jalview2xmlBase public void testAssociatedMappingToSubSeq() throws Exception { + // currently this test fails if trimming is enabled + Cache.setProperty(DBRefFetcher.TRIM_RETRIEVED_SEQUENCES, + Boolean.FALSE.toString()); String TEMP_FACTOR_AA="Temperature Factor"; String PDBID = "4IM2"; String FullLengthSeq = ">TBK1_HUMAN Serine/threonine-protein kinase TBK1\n" + @@ -401,7 +409,7 @@ public class StructureSelectionManagerTest extends Jalview2xmlBase ">TBK1_HUMAN/470-502 Serine/threonine-protein kinase TBK1\nFCIRNIEKTVKVYEKLMKINLEAAELGEISDIH", DataSourceType.PASTE); Desktop.addInternalFrame(alf, "Foo", 800, 600); - ; + AlignmentI al = alf.getViewport().getAlignment(); SequenceI seq = al.getSequenceAt(0); assertEquals(470, seq.getStart()); @@ -413,7 +421,7 @@ public class StructureSelectionManagerTest extends Jalview2xmlBase PDBID); AlignmentAnnotation subseq_tf=null; - assertTrue(seq.getDBRefs() != null && seq.getDBRefs().length > 0); + assertTrue(seq.getDBRefs() != null && seq.getDBRefs().size() > 0); if (!al.findAnnotations(seq, null, TEMP_FACTOR_AA).iterator().hasNext()) { @@ -454,14 +462,12 @@ public class StructureSelectionManagerTest extends Jalview2xmlBase Assert.assertNull(subseq, "Expected no annotation transferred at position " + p); } - ; if (orig != null) { Assert.assertNotNull(subseq, "Expected annotation transfer at position " + p); assertEquals(orig.value, subseq.value); } - ; } } @@ -482,7 +488,6 @@ public class StructureSelectionManagerTest extends Jalview2xmlBase } catch (InterruptedException q) { } - ; Assert.assertTrue(schoose.selectStructure(pDBID), "Couldn't select structure via structure chooser: " + pDBID); schoose.showStructures(true);