X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fio%2FSequenceAnnotationReportTest.java;h=7f4f3a335aa4274bc0b522e69a12d9cda9cba181;hb=2350ea66072d77b929d89e5ba42599c0e8d3ea53;hp=0b5dfdda390449a21a9d72de37336426db090fa9;hpb=586b87fca07c53c935ffe67827e498eb80fad4bf;p=jalview.git diff --git a/test/jalview/io/SequenceAnnotationReportTest.java b/test/jalview/io/SequenceAnnotationReportTest.java index 0b5dfdd..7f4f3a3 100644 --- a/test/jalview/io/SequenceAnnotationReportTest.java +++ b/test/jalview/io/SequenceAnnotationReportTest.java @@ -248,14 +248,13 @@ public class SequenceAnnotationReportTest SequenceI seq = new Sequence("s1", "MAKLKRFQSSTLL"); seq.setDescription("SeqDesc"); - sar.createSequenceAnnotationReport(sb, seq, true, true, null); - /* * positional features are ignored */ seq.addSequenceFeature(new SequenceFeature("Domain", "Ferredoxin", 5, 10, 1f, null)); - assertEquals("
SeqDesc
", sb.toString()); + sar.createSequenceAnnotationReport(sb, seq, true, true, null); + assertEquals("SeqDesc", sb.toString()); /* * non-positional feature @@ -264,7 +263,7 @@ public class SequenceAnnotationReportTest null)); sb.setLength(0); sar.createSequenceAnnotationReport(sb, seq, true, true, null); - String expected = "
SeqDesc
Type1 ; Nonpos Score=1.0
"; + String expected = "SeqDesc
Type1 ; Nonpos Score=1.0
"; assertEquals(expected, sb.toString()); /* @@ -272,7 +271,7 @@ public class SequenceAnnotationReportTest */ sb.setLength(0); sar.createSequenceAnnotationReport(sb, seq, true, false, null); - assertEquals("
SeqDesc
", sb.toString()); + assertEquals("SeqDesc", sb.toString()); /* * add non-pos feature with score inside min-max range for feature type @@ -289,7 +288,7 @@ public class SequenceAnnotationReportTest sb.setLength(0); sar.createSequenceAnnotationReport(sb, seq, true, true, fr); - expected = "
SeqDesc
Metal ; Desc
Type1 ; Nonpos
"; + expected = "SeqDesc
Metal ; Desc
Type1 ; Nonpos
"; assertEquals(expected, sb.toString()); /* @@ -305,8 +304,8 @@ public class SequenceAnnotationReportTest assertEquals(expected, sb.toString()); // unchanged! /* - * 'clinical_significance' attribute only included when - * used for feature colouring + * 'clinical_significance' attribute is only included in description + * when used for feature colouring */ SequenceFeature sf2 = new SequenceFeature("Variant", "Havana", 0, 0, 5f, null); @@ -314,7 +313,7 @@ public class SequenceAnnotationReportTest seq.addSequenceFeature(sf2); sb.setLength(0); sar.createSequenceAnnotationReport(sb, seq, true, true, fr); - expected = "
SeqDesc
Metal ; Desc
Type1 ; Nonpos
Variant ; Havana
"; + expected = "SeqDesc
Metal ; Desc
Type1 ; Nonpos
Variant ; Havana
"; assertEquals(expected, sb.toString()); /* @@ -335,13 +334,23 @@ public class SequenceAnnotationReportTest fc.setAttributeName("clinical_significance"); fr.setColour("Variant", fc); sar.createSequenceAnnotationReport(sb, seq, true, true, fr); - expected = "
SeqDesc
UNIPROT P30419
PDB 3iu1
Metal ; Desc
" + expected = "SeqDesc
UNIPROT P30419
PDB 3iu1
Metal ; Desc
" + "Type1 ; Nonpos
Variant ; Havana; clinical_significance=benign
"; assertEquals(expected, sb.toString()); // with showNonPositionalFeatures = false sb.setLength(0); sar.createSequenceAnnotationReport(sb, seq, true, false, fr); - expected = "
SeqDesc
UNIPROT P30419
PDB 3iu1
"; + expected = "SeqDesc
UNIPROT P30419
PDB 3iu1
"; + assertEquals(expected, sb.toString()); + + /* + * long feature description is truncated with ellipsis + */ + sb.setLength(0); + sf2.setDescription( + "This is a very long description which should be truncated"); + sar.createSequenceAnnotationReport(sb, seq, false, true, fr); + expected = "SeqDesc
Metal ; Desc
Type1 ; Nonpos
Variant ; This is a very long description which sh...; clinical_significance=benign
"; assertEquals(expected, sb.toString()); // see other tests for treatment of status and html