X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=test%2Fjalview%2Fgui%2FAnnotationLabelsTest2.java;h=ad97e8bc4c3f34998ab073a7035c2a2877b56211;hb=ca160187a050f6d4e50158cd5b51f75c83a7179e;hp=e8fa9f16a5dfa7938a5491dcc903f77fb7cfa1a4;hpb=744e4ade5413aa7e8006a8d4d29fdb718489bf08;p=jalview.git diff --git a/test/jalview/gui/AnnotationLabelsTest2.java b/test/jalview/gui/AnnotationLabelsTest2.java index e8fa9f1..ad97e8b 100644 --- a/test/jalview/gui/AnnotationLabelsTest2.java +++ b/test/jalview/gui/AnnotationLabelsTest2.java @@ -87,11 +87,11 @@ public class AnnotationLabelsTest2 groups = { "Functional", "testTask1" }, dataProvider = "openFilesWithIdWidthChanges") - public void testIdWidthChanges(String alignmentFilename, int idWidth1min, - int idWidth1max, int manualWidth, String structureFilename, - String paeFilename, boolean secondaryStructureView, - TFType temperatureFactorType, ViewerType viewerType, - int idWidth2min, int idWidth2max) + public void testIdWidthChanges(String alignmentFilename, boolean wrap, + int idWidth1min, int idWidth1max, int manualWidth, + String structureFilename, String paeFilename, + boolean secondaryStructureView, TFType temperatureFactorType, + ViewerType viewerType, int idWidth2min, int idWidth2max) { AlignFrame af = new FileLoader() .LoadFileWaitTillLoaded(alignmentFilename, DataSourceType.FILE); @@ -110,8 +110,19 @@ public class AnnotationLabelsTest2 idWidth = av.getIdWidth(); assertTrue(idWidth > idWidth1min, "idWidth (" + idWidth + ") is not greater than " + idWidth1min); - assertTrue(idWidth < idWidth1max, "idWidth (" + idWidth - + ") is not less wide than" + idWidth1max); + assertTrue(idWidth < idWidth1max, + "idWidth (" + idWidth + ") is not narrower than" + idWidth1max); + + // set wrap + if (wrap) + { + af.setWrapFormat(true, false); + idWidth = av.getIdWidth(); + assertTrue(idWidth > idWidth1min, "After wrap idWidth (" + idWidth + + ") is not greater than " + idWidth1min); + assertTrue(idWidth < idWidth1max, "After wrap idWidth (" + idWidth + + ") is not narrower than" + idWidth1max); + } AlignmentI al = av.getAlignment(); SequenceI s = al.getSequenceAt(0); @@ -134,18 +145,19 @@ public class AnnotationLabelsTest2 e.printStackTrace(); } + // idWidth = ap.getIdPanel().getWidth(); idWidth = av.getIdWidth(); assertTrue(idWidth > idWidth2min, "idWidth (" + idWidth + ") is not greater than " + idWidth2min); - assertTrue(idWidth < idWidth2max, "idWidth (" + idWidth - + ") is not less wide than" + idWidth2max); + assertTrue(idWidth < idWidth2max, + "idWidth (" + idWidth + ") is not narrower than" + idWidth2max); } @Test( groups = { "Functional", "testTask1" }, dataProvider = "openFilesWithIdWidthChanges") - public void testIdWidthNoChanges(String alignmentFilename, + public void testIdWidthNoChanges(String alignmentFilename, boolean wrap, int idWidth1min, int idWidth1max, int manualWidth, String structureFilename, String paeFilename, boolean secondaryStructureView, TFType temperatureFactorType, @@ -168,8 +180,8 @@ public class AnnotationLabelsTest2 idWidth = av.getIdWidth(); assertTrue(idWidth > idWidth1min, "idWidth (" + idWidth + ") is not greater than " + idWidth1min); - assertTrue(idWidth < idWidth1max, "idWidth (" + idWidth - + ") is not less wide than" + idWidth1max); + assertTrue(idWidth < idWidth1max, + "idWidth (" + idWidth + ") is not narrower than" + idWidth1max); AlignmentI al = av.getAlignment(); SequenceI s = al.getSequenceAt(0); @@ -207,6 +219,7 @@ public class AnnotationLabelsTest2 { /* String alignmentFilename, + boolean wrap, int idWidth1min, int idWidth1max, int manualWidth, // ignored by testIdWidthChanges() @@ -222,14 +235,16 @@ public class AnnotationLabelsTest2 // /* */ - { - // - "./test/files/annotation_label_width/sample.a2m", 50, 70, 100, + { "./test/files/annotation_label_width/sample.a2m", false, 50, 70, + 100, "./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb", "./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3_scores.json", - true, TFType.PLDDT, null, 115, 130 - // - }, + true, TFType.PLDDT, null, 115, 130 }, + { "./test/files/annotation_label_width/sample.a2m", true, 50, 70, + 100, + "./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb", + "./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3_scores.json", + true, TFType.PLDDT, null, 115, 130 }, /* */ };